3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

command to exit tests early

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-10-12 14:17:52 -07:00
parent 11f1a81d7b
commit 3554554533

View file

@ -10,27 +10,30 @@
#include "util/memory_manager.h"
#include "util/gparams.h"
static void tst_exit_all_tests() {
exit(0);
}
//
// Unit tests fail by asserting.
// If they return, we assume the unit test succeeds
// and print "PASS" to indicate success.
//
#define TST(MODULE) { \
std::string s("test "); \
s += #MODULE; \
void tst_##MODULE(); \
if (do_display_usage) \
std::cout << #MODULE << "\n"; \
for (int i = 0; i < argc; i++) \
if (test_all || strcmp(argv[i], #MODULE) == 0) { \
enable_trace(#MODULE); \
enable_debug(#MODULE); \
timeit timeit(true, s.c_str()); \
tst_##MODULE(); \
std::cout << "PASS" << std::endl; \
} \
}
#define TST(MODULE) { \
std::string s("test "); \
s += #MODULE; \
void tst_##MODULE(); \
if (do_display_usage) \
std::cout << #MODULE << "\n"; \
for (int i = 0; i < argc; i++) \
if (test_all || strcmp(argv[i], #MODULE) == 0) { \
enable_trace(#MODULE); \
enable_debug(#MODULE); \
timeit timeit(true, s.c_str()); \
tst_##MODULE(); \
std::cout << "PASS" << std::endl; \
} \
}
#define TST_ARGV(MODULE) { \
std::string s("test "); \
@ -207,6 +210,7 @@ int main(int argc, char ** argv) {
TST(prime_generator);
TST(permutation);
TST(nlsat);
TST(exit_all_tests);
TST(ext_numeral);
TST(interval);
TST(f2n);