1. Edd Dawson
  2. test_o_matic

Wiki

Clone wiki

test_o_matic / Sample_output

Sample output

Here's the output from test-o-matic's self-tests:

test_o_matic::test construction and registration, defined on line 4 of self_test\test.cpp
ok:   't != 0', line 13
ok:   'test::root != 0', line 14
ok:   't != 0', line 20
ok:   'std::strcmp(t->file, __FILE__) == 0', line 21
ok:   'std::strcmp(t->time, __TIME__) == 0', line 22
ok:   'std::strcmp(t->date, __DATE__) == 0', line 23
ok:   't->line == 4', line 24

test_o_matic::stats constrution, defined on line 3 of self_test\stats.cpp
ok:   's.successes == 0', line 7
ok:   's.failures == 0', line 8
ok:   's.complete == 0', line 9
ok:   's.aborted == 0', line 10

test_o_matic::runner catching exceptions, defined on line 58 of self_test\runner.cpp
ok:   'rnr.run(t, lgr)' threw nothing as expected, line 62
ok:   'aborted == true', line 63
ok:   'mrnr.run(t, lgr)' threw an exception of type 'int' as expected, line 66

test_o_matic::runner recognises aborted tests, defined on line 69 of self_test\runner.cpp
ok:   'rnr.run(t, lgr)' threw nothing as expected, line 73
ok:   'aborted == true', line 74

test_o_matic::default_logger() registers 'check' handler, defined on line 34 of self_test\misc.cpp
ok:   'lgr.summary() == s', line 41
ok:   'lgr.summary() == s', line 48

test_o_matic::default_logger() registers 'throws' handler, defined on line 51 of self_test\misc.cpp
ok:   'lgr.summary() == s', line 58
ok:   'lgr.summary() == s', line 65

test_o_matic::default_logger() registers 'try' handler, defined on line 68 of self_test\misc.cpp
ok:   'lgr.summary() == s', line 75
ok:   'lgr.summary() == s', line 82

test_o_matic::default_logger() registers 'pre_test' handler, defined on line 85 of self_test\misc.cpp
ok:   '!captured.empty()', line 95

test_o_matic::default_logger() registers 'post_test' handler, defined on line 98 of self_test\misc.cpp
ok:   'lgr.summary() == s', line 105
ok:   'lgr.summary() == s', line 112

test_o_matic::summary() mentions successes, failures and aborted tests, defined on line 115 of self_test\misc.cpp
ok:   'lines.size() == 3', line 145
ok:   'lines[0].find("successes") != not_found', line 149
ok:   'lines[0].find("1") != not_found', line 150
ok:   'lines[1].find("failures") != not_found', line 152
ok:   'lines[1].find("2") != not_found', line 153
ok:   'lines[2].find("aborted") != not_found', line 155
ok:   'lines[2].find("3") != not_found', line 156

test_o_matic::stringize on output-streamable types, defined on line 159 of self_test\misc.cpp
ok:   'stringize<int>::convert(-5) == "-5"', line 161
ok:   'stringize<const char *>::convert("hello, world!") == "hello, world!"', line 162
ok:   'stringize<std::string>::convert("hello, world!") == "hello, world!"', line 163
ok:   'stringize<double>::convert(42) == "42"', line 164

test_o_matic::stringize specialized for custom type, defined on line 167 of self_test\misc.cpp
ok:   'stringize<custom>::convert(c) == "custom"', line 170

test_o_matic::detail::to_const_ref, defined on line 173 of self_test\misc.cpp
ok:   'same_type<int_const_ref, const int &>::value', line 179
ok:   'same_type<int_const_ref, const int &>::value', line 184
ok:   'same_type<int_const_ref, const int &>::value', line 189

test_o_matic CHECK() macro, defined on line 19 of self_test\macros.cpp
ok:   's1 == 1', line 39
ok:   'f1 == 0', line 40
ok:   's2 == 1', line 41
ok:   'f2 == 1', line 42

test_o_matic CHECK() macro applies side effects only once, defined on line 45 of self_test\macros.cpp
ok:   'n == 2', line 55

test_o_matic CHECK() variadic usage, defined on line 59 of self_test\macros.cpp
ok:   'always_true<bool, bool, bool>::value', line 61

test_o_matic REQUIRE() macro, defined on line 65 of self_test\macros.cpp
ok:   's1 == 1', line 87
ok:   'f1 == 0', line 88
ok:   's2 == 1', line 89
ok:   'f2 == 1', line 90
ok:   'caught', line 91

test_o_matic REQUIRE() macro applies side effects only once, defined on line 94 of self_test\macros.cpp
ok:   'n == 2', line 104

test_o_matic REQUIRE() variadic usage, defined on line 108 of self_test\macros.cpp
ok:   'always_true<bool, bool, bool>::value', line 110

test_o_matic TRY() macro, defined on line 114 of self_test\macros.cpp
ok:   's1 == 1', line 134
ok:   'f1 == 0', line 135
ok:   's2 == 1', line 136
ok:   'f2 == 1', line 137

test_o_matic TRY() macro applies side effects only once, defined on line 140 of self_test\macros.cpp
ok:   'n == 2', line 150

test_o_matic TRY() variadic usage, defined on line 154 of self_test\macros.cpp
ok:   'always_true<bool, bool, bool>::func()' threw nothing as expected, line 156

test_o_matic THROWS() macro, defined on line 160 of self_test\macros.cpp
ok:   's1 == 1', line 186
ok:   'f1 == 0', line 187
ok:   's2 == 1', line 188
ok:   'f2 == 1', line 189
ok:   's3 == 1', line 190
ok:   'f3 == 2', line 191

test_o_matic THROWS() macro applies side effects only once, defined on line 194 of self_test\macros.cpp
ok:   'n == 2', line 204

test_o_matic THROWS() variadic usage, defined on line 208 of self_test\macros.cpp
ok:   'throw a' threw an exception of type 'always_true<bool, bool, bool>' as expected, line 211

test_o_matic ABORT() macro, defined on line 215 of self_test\macros.cpp
ok:   'caught', line 220

test_o_matic::logger default construction, defined on line 27 of self_test\logger.cpp
ok:   's.successes == 0', line 34
ok:   's.failures == 0', line 35
ok:   's.complete == 0', line 36
ok:   's.aborted == 0', line 37
ok:   's.successes == 0', line 41
ok:   's.failures == 0', line 42
ok:   's.complete == 0', line 43
ok:   's.aborted == 0', line 44

test_o_matic::logger anonymous handler, defined on line 47 of self_test\logger.cpp
ok:   'lgr.summary().complete == 1', line 55

test_o_matic::logger with handler, defined on line 58 of self_test\logger.cpp
ok:   'm == strmap()', line 73
ok:   'm == data', line 78
ok:   'm == data', line 84

test_o_matic::handler construction from function pointers, defined on line 34 of self_test\handler.cpp
ok:   's == s2', line 47
ok:   's == s2', line 53
ok:   's == s2', line 59
ok:   's == s2', line 65

test_o_matic::handler construction from functors, defined on line 69 of self_test\handler.cpp
ok:   's == s2', line 83
ok:   's == s2', line 90
ok:   's == s2', line 97
ok:   's == s2', line 104

test_o_matic::handle reference counting, defined on line 131 of self_test\handler.cpp
ok:   'instance_counting_functor::instances == 1', line 134
ok:   'instance_counting_functor::instances == 2', line 138
ok:   'instance_counting_functor::instances == 2', line 141
ok:   'instance_counting_functor::instances == 2', line 144
ok:   'instance_counting_functor::instances == 2', line 147
ok:   'instance_counting_functor::instances == 3', line 150
ok:   'instance_counting_functor::instances == 2', line 153
ok:   'instance_counting_functor::instances == 1', line 156

test_o_matic::handler exception safety, defined on line 163 of self_test\handler.cpp
ok:   'throwing_counting_functor::instances == 1', line 167
ok:   'handler h(f)' threw an exception of type 'int' as expected, line 169
ok:   'throwing_counting_functor::instances == 1', line 172

test_o_matic::data default constructor, defined on line 14 of self_test\data.cpp
ok:   'm.empty()', line 20

test_o_matic::data constructor, defined on line 23 of self_test\data.cpp
ok:   'm["key"] == "value"', line 29

test_o_matic::data conversion operator to strmap, defined on line 32 of self_test\data.cpp
ok:   'cm.find("key") != cm.end()', line 39
ok:   'cm.find("key")->second == "value"', line 40
ok:   'cm.find("colour") != cm.end()', line 45
ok:   'cm.find("colour")->second == "red"', line 46

test_o_matic::data operator(), defined on line 49 of self_test\data.cpp
ok:   '&d("meaning of life", 42) == &d', line 55
ok:   'm.find("meaning of life") != m.end()', line 57
ok:   'm.find("meaning of life")->second == "42"', line 58

test_o_matic::data uses stringize specializations, defined on line 61 of self_test\data.cpp
ok:   'm["a"] == "BLAH"', line 71
ok:   'm["b"] == "BLAH"', line 72

successes: 110
failures:  0

Updated