3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00
This commit is contained in:
Nikolaj Bjorner 2017-10-12 14:34:13 -07:00
commit 8b280b1f64

View file

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