Add a working 'make check' target, which runs both the test suite in src/test-harness, and all the twtest unit tests; update unit test binary to return standard success/fail values, to keep make happy

This commit is contained in:
Brian Cox 2017-03-14 01:23:23 -07:00
parent 2e39db661b
commit 062523a60e
3 changed files with 15 additions and 1 deletions

View File

@ -11,3 +11,8 @@ install-data-hook:
uninstall-hook:
rm -f ${prefix}/sbin/tripwire $(prefix)/sbin/twadmin $(prefix)/sbin/twprint $(prefix)/sbin/siggen
rm -Rf $(prefix)/doc
check:
rm -Rf $(top_srcdir)/src/test-harness/twtest
cd $(top_srcdir)/src/test-harness && ./twtest.pl
$(top_srcdir)/bin/twtest all

View File

@ -808,6 +808,11 @@ uninstall-hook:
rm -f ${prefix}/sbin/tripwire $(prefix)/sbin/twadmin $(prefix)/sbin/twprint $(prefix)/sbin/siggen
rm -Rf $(prefix)/doc
check:
rm -Rf $(top_srcdir)/src/test-harness/twtest
cd $(top_srcdir)/src/test-harness && ./twtest.pl
$(top_srcdir)/bin/twtest all
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -316,11 +316,13 @@ int _tmain(int argc, TCHAR** argv)
{
cTWUtil::PrintErrorMsg(error);
ASSERT(false);
return 1;
}
catch (...)
{
TCERR << _T("Unhandled exception caught!");
ASSERT(false);
return 1;
}
// make sure all the refrence counted objects have been destroyed
@ -329,7 +331,9 @@ int _tmain(int argc, TCHAR** argv)
// force user to hit <CR>
return 1;
std::cout << std::endl << "Tests completed" << std::endl;
return 0;
}