From aee07d0496df7c26feebe37288d03bc46343f6fd Mon Sep 17 00:00:00 2001 From: Jakob Rath Date: Thu, 1 Dec 2022 09:44:56 +0100 Subject: [PATCH] less visual noise when running unit tests --- src/test/polysat.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/test/polysat.cpp b/src/test/polysat.cpp index 788534542..9686af5f1 100644 --- a/src/test/polysat.cpp +++ b/src/test/polysat.cpp @@ -186,7 +186,7 @@ namespace polysat { } void test_record_manager::display(std::ostream& out) const { - out << "\n\nTest Results:\n"; + out << "\n\n\nTest Results:\n\n"; size_t max_name_len = 0; for (test_record const* r : m_records) { @@ -215,12 +215,12 @@ namespace polysat { if (r->m_result == test_result::error) n_error++; } - out << n_total << " tests, " << (n_sat + n_unsat) << " ok (" << n_sat << " sat, " << n_unsat << " unsat)"; + out << "\n" << n_total << " tests, " << (n_sat + n_unsat) << " ok (" << n_sat << " sat, " << n_unsat << " unsat)"; if (n_wrong) out << ", " << color_red() << n_wrong << " wrong!" << color_reset(); if (n_error) out << ", " << color_red() << n_error << " error" << color_reset(); - out << std::endl; + out << "\n" << std::endl; } test_record_manager test_records; @@ -241,8 +241,10 @@ namespace polysat { public: scoped_solver(std::string name): solver(lim), m_name(name) { - std::cout << std::string(78, '#') << "\n\n"; - std::cout << "START: " << m_name << "\n"; + if (!collect_test_records) { + std::cout << std::string(78, '#') << "\n\n"; + std::cout << "START: " << m_name << "\n"; + } set_max_conflicts(test_max_conflicts); test_records.begin_batch(name); @@ -275,10 +277,11 @@ namespace polysat { } rec->m_finished = true; m_last_finished = rec; - std::cout << "DONE: " << m_name << ": " << m_last_result << "\n"; + std::cout << "DONE: " << m_name << ": " << m_last_result << "\n"; statistics st; collect_statistics(st); - std::cout << st << "\n"; + if (!collect_test_records) + std::cout << st << "\n"; rec->m_answer = m_last_result; rec->m_result = (m_last_result == l_undef) ? test_result::resource_out : test_result::ok;