Merge branch 'features/cram-tests' into bleeding
This commit is contained in:
commit
dbfffabf84
92 changed files with 1314 additions and 691 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -17,6 +17,7 @@
|
|||
!*.rst
|
||||
!*.po
|
||||
!*.in
|
||||
!*.t
|
||||
!.cmake/Modules/*.cmake
|
||||
!samples/tests/*.sh
|
||||
!samples/**/*.expected
|
||||
|
|
|
@ -90,6 +90,10 @@ before_install:
|
|||
brew unlink cmake
|
||||
brew install llvm cmake
|
||||
fi
|
||||
- |
|
||||
if [ "${TESTS:-ON}" = "ON" ]; then
|
||||
pip install --user cram
|
||||
fi
|
||||
- export CXX=${CC/gcc/g++}; export CXX=${CXX/clang/clang++}
|
||||
- $CC --version
|
||||
- $CXX --version
|
||||
|
@ -122,7 +126,7 @@ after_success:
|
|||
|
||||
after_failure:
|
||||
- |
|
||||
if [ "$TESTS" = "ON" ]; then
|
||||
if [ "${TESTS:-ON}" = "ON" ]; then
|
||||
cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err}
|
||||
fi
|
||||
|
||||
|
|
|
@ -70,42 +70,9 @@ macro(add_samples DIR_ SAMPLES_)
|
|||
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
||||
ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage
|
||||
)
|
||||
|
||||
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
||||
add_test(${sample}_compare sh ${DIR_}/run_test.sh "${CMAKE_CURRENT_LIST_DIR}/outputs" . . ${sample}.bin)
|
||||
set_property(TEST ${sample}_compare PROPERTY
|
||||
ENVIRONMENT "LC_ALL=en_US.utf8"
|
||||
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
||||
ENVIRONMENT "CRITERION_SHORT_FILENAME=1"
|
||||
ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage
|
||||
ENVIRONMENT "CRITERION_JOBS=1" # for output ordering
|
||||
ENVIRONMENT "CRITERION_DISABLE_TIME_MEASUREMENTS=1" # do not compare timings
|
||||
)
|
||||
endif ()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
add_samples("${CMAKE_CURRENT_LIST_DIR}/tests" "${SAMPLES}")
|
||||
|
||||
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
||||
|
||||
foreach(script ${SCRIPTS})
|
||||
add_test(${script} sh "${CMAKE_CURRENT_LIST_DIR}/tests/${script}.sh")
|
||||
set_property(TEST ${script} PROPERTY
|
||||
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
||||
ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage
|
||||
)
|
||||
|
||||
add_test(${script}_compare sh ${CMAKE_CURRENT_LIST_DIR}/tests/run_test.sh "${CMAKE_CURRENT_LIST_DIR}" . "${CMAKE_CURRENT_LIST_DIR}" "tests/${script}.sh")
|
||||
set_property(TEST ${script}_compare PROPERTY
|
||||
ENVIRONMENT "LC_ALL=en_US.utf8"
|
||||
ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1"
|
||||
ENVIRONMENT "CRITERION_SHORT_FILENAME=1"
|
||||
ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage
|
||||
ENVIRONMENT "CRITERION_JOBS=1" # for output ordering
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
|
||||
add_subdirectory(tests)
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m11[0m: Assertion failed: assert is fatal, expect isn't
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m12[0m: Assertion failed: This assert runs
|
||||
[[0;31mFAIL[0m] asserts::base
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m17[0m: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m18[0m: Assertion failed: The conditions for this assertion were not met.
|
||||
[[0;31mFAIL[0m] asserts::old_school
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m6[0;1m | Passing: [0;32m4[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,11 +0,0 @@
|
|||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m83[0m: Assertion failed: The expression (&s1)[0 .. 2] == (&s2)[0 .. 2] is false.
|
||||
[[0;31mFAIL[0m] asserts::array
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m13[0m: Assertion failed: assert is fatal, expect isn't
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m14[0m: Assertion failed: This assert runs
|
||||
[[0;31mFAIL[0m] asserts::base
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m89[0m: Assertion failed: The statement `throw std::exception()` did not throw an instance of the `std::bad_alloc` exception.
|
||||
[[0;31mFAIL[0m] asserts::exception
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m19[0m: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m20[0m: Assertion failed: The conditions for this assertion were not met.
|
||||
[[0;31mFAIL[0m] asserts::old_school
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m7[0;1m | Passing: [0;32m3[0;1m | Failing: [0;31m4[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mdescription.c[0m:[0;31m4[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;31mFAIL[0m] misc::failing
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mdescription.cc[0m:[0;31m4[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;31mFAIL[0m] misc::failing
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,2 +0,0 @@
|
|||
Runs before the test
|
||||
Runs after the test
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,2 +0,0 @@
|
|||
Runs before the test
|
||||
Runs after the test
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m2[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m2[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.[0m
|
||||
[[0;34m----[0m] [0;1mWarning! The test `misc::teardown_crash` crashed during its setup or teardown.[0m
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m1[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.[0m
|
||||
[[0;34m----[0m] [0;1mWarning! The test `misc::teardown_crash` crashed during its setup or teardown.[0m
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m1[0;1m [0m
|
|
@ -1,19 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m76[0m: Assertion failed: Parameters: (1, 2.000000)
|
||||
[[0;31mFAIL[0m] params::cleanup
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m76[0m: Assertion failed: Parameters: (3, 4.000000)
|
||||
[[0;31mFAIL[0m] params::cleanup
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m76[0m: Assertion failed: Parameters: (5, 6.000000)
|
||||
[[0;31mFAIL[0m] params::cleanup
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m36[0m: Assertion failed: Parameters: (1, 2.000000)
|
||||
[[0;31mFAIL[0m] params::multiple
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m36[0m: Assertion failed: Parameters: (3, 4.000000)
|
||||
[[0;31mFAIL[0m] params::multiple
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m36[0m: Assertion failed: Parameters: (5, 6.000000)
|
||||
[[0;31mFAIL[0m] params::multiple
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m15[0m: Assertion failed: Parameter: foo
|
||||
[[0;31mFAIL[0m] params::str
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m15[0m: Assertion failed: Parameter: bar
|
||||
[[0;31mFAIL[0m] params::str
|
||||
[[0;34m----[0m] [0;1mparameterized.c[0m:[0;31m15[0m: Assertion failed: Parameter: baz
|
||||
[[0;31mFAIL[0m] params::str
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m9[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m9[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m2[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m2[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mreport.c[0m:[0;31m5[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;31mFAIL[0m] sample::test
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,4 +0,0 @@
|
|||
criterion_init
|
||||
testing test in category sample
|
||||
Asserts: [1 passed, 1 failed, 2 total]
|
||||
criterion_fini
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mreport.cc[0m:[0;31m5[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;31mFAIL[0m] sample::test
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,4 +0,0 @@
|
|||
criterion_init
|
||||
testing test in category sample
|
||||
Asserts: [1 passed, 1 failed, 2 total]
|
||||
criterion_fini
|
|
@ -1,4 +0,0 @@
|
|||
[[0;34m----[0m] [0;1msignal.c[0m:[0;31m16[0m: Unexpected signal caught below this line!
|
||||
[[0;31mFAIL[0m] simple::uncaught: CRASH!
|
||||
[[0;31mFAIL[0m] simple::wrong_signal
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m3[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m1[0;1m [0m
|
|
@ -1,4 +0,0 @@
|
|||
[[0;34m----[0m] [0;1msignal.cc[0m:[0;31m16[0m: Unexpected signal caught below this line!
|
||||
[[0;31mFAIL[0m] simple::uncaught: CRASH!
|
||||
[[0;31mFAIL[0m] simple::wrong_signal
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m3[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m1[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1msimple.c[0m:[0;31m4[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;31mFAIL[0m] misc::failing
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
[[0;34m----[0m] [0;1msimple.cc[0m:[0;31m4[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;31mFAIL[0m] misc::failing
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m1[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m2[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1 +0,0 @@
|
|||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m2[0;1m | Failing: [0;31m0[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --always-succeed
|
||||
CRITERION_NO_EARLY_EXIT=0 ./simple.c.bin --always-succeed
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --fail-fast --always-succeed
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --help
|
||||
./simple.c.bin --version
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --json --always-succeed
|
||||
./signal.c.bin --json --always-succeed
|
||||
./asserts.c.bin --json --always-succeed
|
||||
./more-suites.c.bin --json --always-succeed
|
||||
./tests/long-messages.c.bin --json --always-succeed
|
||||
./description.c.bin --json --always-succeed
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --list
|
||||
./simple.c.bin --list --ascii
|
|
@ -1,4 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mWarning! The test `exit::unexpected_exit` exited during its setup or teardown.[0m
|
||||
[[0;34m----[0m] [0;1mWarning! The test `exit_with_fixtures::fini_exits` exited during its setup or teardown.[0m
|
||||
[[0;34m----[0m] [0;1mWarning! The test `exit_with_fixtures::init_exits` exited during its setup or teardown.[0m
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m5[0;1m | Passing: [0;32m3[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m2[0;1m [0m
|
|
@ -1,4 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mWarning! The test `exit::unexpected_exit` exited during its setup or teardown.[0m
|
||||
[[0;34m----[0m] [0;1mWarning! The test `exit_with_fixtures::fini_exits` exited during its setup or teardown.[0m
|
||||
[[0;34m----[0m] [0;1mWarning! The test `exit_with_fixtures::init_exits` exited during its setup or teardown.[0m
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m5[0;1m | Passing: [0;32m3[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m2[0;1m [0m
|
|
@ -1,41 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m4[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m5[0m: Assertion failed: The expression (0) == (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m6[0m: Assertion failed: The expression (1) != (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m7[0m: Assertion failed: The expression (2) < (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m8[0m: Assertion failed: The expression (2) <= (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m9[0m: Assertion failed: The expression (1) > (2) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m10[0m: Assertion failed: The expression (1) >= (2) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m11[0m: Assertion failed: "" is not null.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m12[0m: Assertion failed: ((void *)0) is null.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m14[0m: Assertion failed: The expression (2) - (1) <= (0.1) && (1) - (2) <= (0.1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m15[0m: Assertion failed: The expression (2) - (2) > (0.1) || (2) - (2) > (0.1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m17[0m: Assertion failed: "foo" is not empty.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m18[0m: Assertion failed: "" is empty.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m19[0m: Assertion failed: The expression (as strings) ("abc") == ("abd") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m20[0m: Assertion failed: The expression (as strings) ("abc") != ("abc") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m21[0m: Assertion failed: The expression (as strings) ("abc") < ("aba") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m22[0m: Assertion failed: The expression (as strings) ("abc") <= ("aba") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m23[0m: Assertion failed: The expression (as strings) ("abc") > ("abd") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m24[0m: Assertion failed: The expression (as strings) ("abc") >= ("abd") is false.
|
||||
[[0;31mFAIL[0m] messages::default
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m28[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m29[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m30[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m31[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m32[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m33[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m34[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m35[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m36[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m38[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m39[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m41[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m42[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m43[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m44[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m45[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m46[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m47[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.c[0m:[0;31m48[0m: Assertion failed: foo bar
|
||||
[[0;31mFAIL[0m] messages::user
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,49 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m5[0m: Assertion failed: The expression 0 is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m6[0m: Assertion failed: The expression (0) == (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m7[0m: Assertion failed: The expression (1) != (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m8[0m: Assertion failed: The expression (2) < (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m9[0m: Assertion failed: The expression (2) <= (1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m10[0m: Assertion failed: The expression (1) > (2) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m11[0m: Assertion failed: The expression (1) >= (2) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m12[0m: Assertion failed: "" is not null.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m13[0m: Assertion failed: __null is null.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m15[0m: Assertion failed: The expression (2) - (1) <= (0.1) && (1) - (2) <= (0.1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m16[0m: Assertion failed: The expression (2) - (2) > (0.1) || (2) - (2) > (0.1) is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m18[0m: Assertion failed: "foo" is not empty.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m19[0m: Assertion failed: "" is empty.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m20[0m: Assertion failed: The expression (as strings) ("abc") == ("abd") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m21[0m: Assertion failed: The expression (as strings) ("abc") != ("abc") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m22[0m: Assertion failed: The expression (as strings) ("abc") < ("aba") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m23[0m: Assertion failed: The expression (as strings) ("abc") <= ("aba") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m24[0m: Assertion failed: The expression (as strings) ("abc") > ("abd") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m25[0m: Assertion failed: The expression (as strings) ("abc") >= ("abd") is false.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m27[0m: Assertion failed: The statement `throw std::exception()` did not throw an instance of the `std::bad_alloc` exception.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m28[0m: Assertion failed: The statement `throw std::exception()` did throw an instance of the `std::exception` exception.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m29[0m: Assertion failed: The statement `{}` did not throw any exception.
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m30[0m: Assertion failed: The statement `throw std::exception()` threw some exception.
|
||||
[[0;31mFAIL[0m] messages::default
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m34[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m35[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m36[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m37[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m38[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m39[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m40[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m41[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m42[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m44[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m45[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m47[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m48[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m49[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m50[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m51[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m52[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m53[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m54[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m56[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m57[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m58[0m: Assertion failed: foo bar
|
||||
[[0;34m----[0m] [0;1mfailmessages.cc[0m:[0;31m59[0m: Assertion failed: foo bar
|
||||
[[0;31mFAIL[0m] messages::user
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m2[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,237 +0,0 @@
|
|||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "passing",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"simple.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 1,
|
||||
"failed": 2,
|
||||
"errored": 1,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "simple",
|
||||
"passed": 1,
|
||||
"failed": 2,
|
||||
"errored": 1,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "wrong_signal",
|
||||
"assertions": 0,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "uncaught",
|
||||
"assertions": 0,
|
||||
"status": "ERRORED",
|
||||
"messages": ["The test crashed."]
|
||||
},
|
||||
{
|
||||
"name": "caught",
|
||||
"assertions": 0,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 4,
|
||||
"failed": 2,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "asserts",
|
||||
"passed": 4,
|
||||
"failed": 2,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "string",
|
||||
"assertions": 10,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "old_school",
|
||||
"assertions": 2,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"asserts.c:18: The conditions for this assertion were not met.",
|
||||
"asserts.c:17: You can fail an assertion with a message from anywhere"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "native",
|
||||
"assertions": 8,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "float",
|
||||
"assertions": 2,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "base",
|
||||
"assertions": 6,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"asserts.c:12: This assert runs",
|
||||
"asserts.c:11: assert is fatal, expect isn't"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "array",
|
||||
"assertions": 3,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 2,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "suite2",
|
||||
"passed": 1,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "suite1",
|
||||
"passed": 1,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "disabled",
|
||||
"passed": 0,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 0,
|
||||
"status": "SKIPPED",
|
||||
"messages": ["The test was skipped."]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "sample",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "long_msg",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"long-messages.c:4: This is",
|
||||
" A long message",
|
||||
" Spawning multiple lines.",
|
||||
" Formatting is respected."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"tests": [
|
||||
{
|
||||
"name": "skipped",
|
||||
"assertions": 0,
|
||||
"status": "SKIPPED",
|
||||
"messages": ["The test was skipped."]
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"description.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mlong-messages.c[0m:[0;31m4[0m: Assertion failed: This is
|
||||
[[0;34m----[0m] A long message
|
||||
[[0;34m----[0m] Spawning multiple lines.
|
||||
[[0;34m----[0m] Formatting is respected.
|
||||
[[0;31mFAIL[0m] sample::long_msg
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,6 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mlong-messages.cc[0m:[0;31m4[0m: Assertion failed: This is
|
||||
[[0;34m----[0m] A long message
|
||||
[[0;34m----[0m] Spawning multiple lines.
|
||||
[[0;34m----[0m] Formatting is respected.
|
||||
[[0;31mFAIL[0m] sample::long_msg
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,61 +0,0 @@
|
|||
TAP version 13
|
||||
1..2
|
||||
# Criterion v2.1.0
|
||||
|
||||
# Running 2 tests from misc
|
||||
ok - misc::passing (0.00s)
|
||||
not ok - misc::failing (0.00s)
|
||||
simple.c:4: Assertion failed: The expression 0 is false.
|
||||
TAP version 13
|
||||
1..3
|
||||
# Criterion v2.1.0
|
||||
|
||||
# Running 3 tests from simple
|
||||
not ok - simple::wrong_signal (0.00s)
|
||||
not ok - simple::uncaught unexpected signal after signal.c:16
|
||||
ok - simple::caught (0.00s)
|
||||
TAP version 13
|
||||
1..6
|
||||
# Criterion v2.1.0
|
||||
|
||||
# Running 6 tests from asserts
|
||||
ok - asserts::string (0.00s)
|
||||
not ok - asserts::old_school (0.00s)
|
||||
asserts.c:18: Assertion failed: The conditions for this assertion were not met.
|
||||
asserts.c:17: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
ok - asserts::native (0.00s)
|
||||
ok - asserts::float (0.00s)
|
||||
not ok - asserts::base (0.00s)
|
||||
asserts.c:12: Assertion failed: This assert runs
|
||||
asserts.c:11: Assertion failed: assert is fatal, expect isn't
|
||||
ok - asserts::array (0.00s)
|
||||
TAP version 13
|
||||
1..3
|
||||
# Criterion v2.1.0
|
||||
|
||||
# Running 1 tests from suite2
|
||||
ok - suite2::test (0.00s)
|
||||
|
||||
# Running 1 tests from suite1
|
||||
ok - suite1::test (0.00s)
|
||||
|
||||
# Running 1 tests from disabled
|
||||
ok - disabled::test # SKIP suite is disabled
|
||||
TAP version 13
|
||||
1..1
|
||||
# Criterion v2.1.0
|
||||
|
||||
# Running 1 tests from sample
|
||||
not ok - sample::long_msg (0.00s)
|
||||
long-messages.c:4: Assertion failed: This is
|
||||
A long message
|
||||
Spawning multiple lines.
|
||||
Formatting is respected.
|
||||
TAP version 13
|
||||
1..2
|
||||
# Criterion v2.1.0
|
||||
|
||||
# Running 2 tests from misc
|
||||
ok - misc::skipped This one is skipped # SKIP test is disabled
|
||||
not ok - misc::failing Just a failing test (0.00s)
|
||||
description.c:4: Assertion failed: The expression 0 is false.
|
|
@ -1,4 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mtheories_regression.c[0m:[0;31m34[0m: Assertion failed: The conditions for this assertion were not met.
|
||||
[[0;34m----[0m] Theory theory::misc failed with the following parameters: ('a', true, 1, 1, 3.14f, 3.14, "test", "other test")
|
||||
[[0;31mFAIL[0m] theory::misc
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,4 +0,0 @@
|
|||
[[0;34m----[0m] [0;1mtheories_regression.cc[0m:[0;31m36[0m: Assertion failed: The conditions for this assertion were not met.
|
||||
[[0;34m----[0m] Theory theory::misc failed with the following parameters: ('a', true, 1, 1, 3.14f, 3.14, "test", "other test")
|
||||
[[0;31mFAIL[0m] theory::misc
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m1[0;1m | Passing: [0;32m0[0;1m | Failing: [0;31m1[0;1m | Crashing: [0;31m0[0;1m [0m
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.1.0 -->
|
||||
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
|
||||
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="passing" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="failing" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">simple.c:4: The expression 0 is false. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.1.0 -->
|
||||
<testsuites name="Criterion Tests" tests="3" failures="2" errors="1" disabled="0">
|
||||
<testsuite name="simple" tests="3" failures="2" errors="1" disabled="0" skipped="0">
|
||||
<testcase name="wrong_signal" assertions="0" status="FAILED">
|
||||
<failure type="assert" message="0 assertion(s) failed."></failure>
|
||||
</testcase>
|
||||
<testcase name="uncaught" assertions="0" status="ERRORED">
|
||||
<error type="crash" message="The test crashed." /> </testcase>
|
||||
<testcase name="caught" assertions="0" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.1.0 -->
|
||||
<testsuites name="Criterion Tests" tests="6" failures="2" errors="0" disabled="0">
|
||||
<testsuite name="asserts" tests="6" failures="2" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="string" assertions="10" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="old_school" assertions="2" status="FAILED">
|
||||
<failure type="assert" message="2 assertion(s) failed.">asserts.c:18: The conditions for this assertion were not met. asserts.c:17: You can fail an assertion with a message from anywhere </failure>
|
||||
</testcase>
|
||||
<testcase name="native" assertions="8" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="float" assertions="2" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="base" assertions="6" status="FAILED">
|
||||
<failure type="assert" message="2 assertion(s) failed.">asserts.c:12: This assert runs asserts.c:11: assert is fatal, expect isn't </failure>
|
||||
</testcase>
|
||||
<testcase name="array" assertions="3" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.1.0 -->
|
||||
<testsuites name="Criterion Tests" tests="3" failures="0" errors="0" disabled="1">
|
||||
<testsuite name="suite2" tests="1" failures="0" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="test" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite name="suite1" tests="1" failures="0" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="test" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite name="disabled" tests="1" failures="0" errors="0" disabled="1" skipped="1">
|
||||
<testcase name="test" assertions="0" status="SKIPPED">
|
||||
<skipped/>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.1.0 -->
|
||||
<testsuites name="Criterion Tests" tests="1" failures="1" errors="0" disabled="0">
|
||||
<testsuite name="sample" tests="1" failures="1" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="long_msg" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">long-messages.c:4: This is A long message Spawning multiple lines. Formatting is respected. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.1.0 -->
|
||||
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="1">
|
||||
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="1" skipped="1">
|
||||
<testcase name="skipped" assertions="0" status="SKIPPED">
|
||||
<skipped/>
|
||||
</testcase>
|
||||
<testcase name="failing" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">description.c:4: The expression 0 is false. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
./simple.c.bin --pattern '*/passing'
|
||||
./simple.c.bin --pattern '!(*/passing)'
|
||||
./simple.c.bin --pattern '[pf]a@(ss|il)ing'
|
||||
./simple.c.bin --pattern '@(+(nest)ed))'
|
||||
./simple.c.bin --pattern '?(*(a|b))'
|
||||
! ./simple.c.bin --pattern '?(malformed'
|
||||
./simple.c.bin --pattern '[!azerty]assing'
|
||||
./simple.c.bin --pattern '|pipe'
|
||||
./simple.c.bin --pattern '\!(escaped'
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
cmp_dir=$1; shift
|
||||
out_dir=$1; shift
|
||||
bin_dir=$1; shift
|
||||
|
||||
mkdir -p $out_dir
|
||||
|
||||
if [ -f $cmp_dir/$1.in ]; then
|
||||
sh -c "$bin_dir/$*" > $out_dir/$1.out 2> $out_dir/$1.err < $cmp_dir/$1.in
|
||||
else
|
||||
mkdir -p $(dirname $out_dir/$1)
|
||||
sh -c "$bin_dir/$*" > $out_dir/$1.out 2> $out_dir/$1.err
|
||||
fi
|
||||
|
||||
if [ -f $cmp_dir/$1.out.expected ] && [ "$(md5sum $out_dir/$1.out | cut -d' ' -f1)" != "$(md5sum $cmp_dir/$1.out.expected | cut -d' ' -f1)" ]; then
|
||||
if ! diff --strip-trailing-cr $out_dir/$1.out $cmp_dir/$1.out.expected ; then
|
||||
exit 255
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f $cmp_dir/$1.err.expected ] && [ "$(md5sum $out_dir/$1.err | cut -d' ' -f1)" != "$(md5sum $cmp_dir/$1.err.expected | cut -d' ' -f1)" ]; then
|
||||
if ! diff --strip-trailing-cr $out_dir/$1.err $cmp_dir/$1.err.expected ; then
|
||||
exit 255
|
||||
fi
|
||||
fi
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --tap --always-succeed
|
||||
./signal.c.bin --tap --always-succeed
|
||||
./asserts.c.bin --tap --always-succeed
|
||||
./more-suites.c.bin --tap --always-succeed
|
||||
./tests/long-messages.c.bin --tap --always-succeed
|
||||
./description.c.bin --tap --always-succeed
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --verbose --always-succeed
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --xml --always-succeed
|
||||
./signal.c.bin --xml --always-succeed
|
||||
./asserts.c.bin --xml --always-succeed
|
||||
./more-suites.c.bin --xml --always-succeed
|
||||
./tests/long-messages.c.bin --xml --always-succeed
|
||||
./description.c.bin --xml --always-succeed
|
|
@ -32,3 +32,20 @@ add_test(criterion_unit_tests criterion_unit_tests)
|
|||
set_property(TEST criterion_unit_tests PROPERTY
|
||||
ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage
|
||||
)
|
||||
|
||||
if (NOT MSVC) # we disable the scripted tests when building with MSVC
|
||||
|
||||
add_custom_target(cram_tests ${CMAKE_COMMAND} -E env
|
||||
"PATH=$ENV{PATH}:${PROJECT_BINARY_DIR}/samples:${PROJECT_BINARY_DIR}/samples/tests"
|
||||
"LC_ALL=en_US.utf8"
|
||||
"CRITERION_ALWAYS_SUCCEED=1"
|
||||
"CRITERION_SHORT_FILENAME=1"
|
||||
"CRITERION_NO_EARLY_EXIT=1" # for coverage
|
||||
"CRITERION_JOBS=1" # for output ordering
|
||||
"CRITERION_DISABLE_TIME_MEASUREMENTS=1" # do not compare timings
|
||||
cram -v ${CMAKE_CURRENT_SOURCE_DIR}/cram)
|
||||
add_dependencies(cram_tests criterion_samples)
|
||||
|
||||
add_test(cram_tests make cram_tests)
|
||||
|
||||
endif ()
|
||||
|
|
155
test/cram/asserts.t
Normal file
155
test/cram/asserts.t
Normal file
|
@ -0,0 +1,155 @@
|
|||
Test C assertions:
|
||||
|
||||
$ asserts.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.c\x1b[0m:\x1b[0;31m11\x1b[0m: Assertion failed: assert is fatal, expect isn't (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.c\x1b[0m:\x1b[0;31m12\x1b[0m: Assertion failed: This assert runs (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] asserts::base (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.c\x1b[0m:\x1b[0;31m17\x1b[0m: Assertion failed: You can fail an assertion with a message from anywhere (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.c\x1b[0m:\x1b[0;31m18\x1b[0m: Assertion failed: The conditions for this assertion were not met. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] asserts::old_school (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m6\x1b[0;1m | Passing: \x1b[0;32m4\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Test C++ assertions:
|
||||
|
||||
$ asserts.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.cc\x1b[0m:\x1b[0;31m83\x1b[0m: Assertion failed: The expression (&s1)[0 .. 2] == (&s2)[0 .. 2] is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] asserts::array (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.cc\x1b[0m:\x1b[0;31m13\x1b[0m: Assertion failed: assert is fatal, expect isn't (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: This assert runs (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] asserts::base (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.cc\x1b[0m:\x1b[0;31m89\x1b[0m: Assertion failed: The statement `throw std::exception()` did not throw an instance of the `std::bad_alloc` exception. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] asserts::exception (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.cc\x1b[0m:\x1b[0;31m19\x1b[0m: Assertion failed: You can fail an assertion with a message from anywhere (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1masserts.cc\x1b[0m:\x1b[0;31m20\x1b[0m: Assertion failed: The conditions for this assertion were not met. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] asserts::old_school (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m7\x1b[0;1m | Passing: \x1b[0;32m3\x1b[0;1m | Failing: \x1b[0;31m4\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Using redirections
|
||||
|
||||
$ redirect.c.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ redirect.cc.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing all assert messages
|
||||
|
||||
$ failmessages.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m5\x1b[0m: Assertion failed: The expression (0) == (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m6\x1b[0m: Assertion failed: The expression (1) != (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m7\x1b[0m: Assertion failed: The expression (2) < (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m8\x1b[0m: Assertion failed: The expression (2) <= (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m9\x1b[0m: Assertion failed: The expression (1) > (2) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m10\x1b[0m: Assertion failed: The expression (1) >= (2) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m11\x1b[0m: Assertion failed: "" is not null. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m12\x1b[0m: Assertion failed: ((void *)0) is null. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: The expression (2) - (1) <= (0.1) && (1) - (2) <= (0.1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: The expression (2) - (2) > (0.1) || (2) - (2) > (0.1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m17\x1b[0m: Assertion failed: "foo" is not empty. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m18\x1b[0m: Assertion failed: "" is empty. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m19\x1b[0m: Assertion failed: The expression (as strings) ("abc") == ("abd") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m20\x1b[0m: Assertion failed: The expression (as strings) ("abc") != ("abc") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m21\x1b[0m: Assertion failed: The expression (as strings) ("abc") < ("aba") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m22\x1b[0m: Assertion failed: The expression (as strings) ("abc") <= ("aba") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m23\x1b[0m: Assertion failed: The expression (as strings) ("abc") > ("abd") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m24\x1b[0m: Assertion failed: The expression (as strings) ("abc") >= ("abd") is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] messages::default (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m28\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m29\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m30\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m31\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m32\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m33\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m34\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m38\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m39\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m41\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m42\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m43\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m44\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m45\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m46\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m47\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.c\x1b[0m:\x1b[0;31m48\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] messages::user (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ failmessages.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m5\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m6\x1b[0m: Assertion failed: The expression (0) == (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m7\x1b[0m: Assertion failed: The expression (1) != (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m8\x1b[0m: Assertion failed: The expression (2) < (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m9\x1b[0m: Assertion failed: The expression (2) <= (1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m10\x1b[0m: Assertion failed: The expression (1) > (2) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m11\x1b[0m: Assertion failed: The expression (1) >= (2) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m12\x1b[0m: Assertion failed: "" is not null. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m13\x1b[0m: Assertion failed: __null is null. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: The expression (2) - (1) <= (0.1) && (1) - (2) <= (0.1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m16\x1b[0m: Assertion failed: The expression (2) - (2) > (0.1) || (2) - (2) > (0.1) is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m18\x1b[0m: Assertion failed: "foo" is not empty. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m19\x1b[0m: Assertion failed: "" is empty. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m20\x1b[0m: Assertion failed: The expression (as strings) ("abc") == ("abd") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m21\x1b[0m: Assertion failed: The expression (as strings) ("abc") != ("abc") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m22\x1b[0m: Assertion failed: The expression (as strings) ("abc") < ("aba") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m23\x1b[0m: Assertion failed: The expression (as strings) ("abc") <= ("aba") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m24\x1b[0m: Assertion failed: The expression (as strings) ("abc") > ("abd") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m25\x1b[0m: Assertion failed: The expression (as strings) ("abc") >= ("abd") is false. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m27\x1b[0m: Assertion failed: The statement `throw std::exception()` did not throw an instance of the `std::bad_alloc` exception. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m28\x1b[0m: Assertion failed: The statement `throw std::exception()` did throw an instance of the `std::exception` exception. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m29\x1b[0m: Assertion failed: The statement `{}` did not throw any exception. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m30\x1b[0m: Assertion failed: The statement `throw std::exception()` threw some exception. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] messages::default (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m34\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m37\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m38\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m39\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m40\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m41\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m42\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m44\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m45\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m47\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m48\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m49\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m50\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m51\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m52\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m53\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m54\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m56\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m57\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m58\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mfailmessages.cc\x1b[0m:\x1b[0;31m59\x1b[0m: Assertion failed: foo bar (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] messages::user (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Long assert messages should wrap
|
||||
|
||||
$ long-messages.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mlong-messages.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: This is (esc)
|
||||
[\x1b[0;34m----\x1b[0m] A long message (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Spawning multiple lines. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Formatting is respected. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] sample::long_msg (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ long-messages.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mlong-messages.cc\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: This is (esc)
|
||||
[\x1b[0;34m----\x1b[0m] A long message (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Spawning multiple lines. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Formatting is respected. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] sample::long_msg (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Using redirections
|
||||
|
||||
$ redirect.c.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ redirect.cc.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
153
test/cram/core.t
Normal file
153
test/cram/core.t
Normal file
|
@ -0,0 +1,153 @@
|
|||
Checking the version
|
||||
|
||||
$ simple.c.bin --version
|
||||
Tests compiled with Criterion v2.2.0
|
||||
|
||||
$ simple.cc.bin --version
|
||||
Tests compiled with Criterion v2.2.0
|
||||
|
||||
Running the simplest test
|
||||
|
||||
$ simple.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ simple.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.cc\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Running with verbose output
|
||||
|
||||
$ simple.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ simple.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.cc\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Display the help message
|
||||
|
||||
$ simple.c.bin --help
|
||||
Tests compiled with Criterion v2.2.0
|
||||
|
||||
usage: simple.c.bin OPTIONS
|
||||
options:
|
||||
-h or --help: prints this message
|
||||
-q or --quiet: disables all logging
|
||||
-v or --version: prints the version of criterion these tests have been linked against
|
||||
-l or --list: prints all the tests in a list
|
||||
-jN or --jobs N: use N concurrent jobs
|
||||
-f or --fail-fast: exit after the first failure
|
||||
--ascii: don't use fancy unicode symbols or colors in the output
|
||||
-S or --short-filename: only display the base name of the source file on a failure
|
||||
--pattern [PATTERN]: run tests matching the given pattern
|
||||
--tap[=FILE]: writes TAP report in FILE (no file or "-" means stderr)
|
||||
--xml[=FILE]: writes XML report in FILE (no file or "-" means stderr)
|
||||
--always-succeed: always exit with 0
|
||||
--no-early-exit: do not exit the test worker prematurely after the test
|
||||
--verbose[=level]: sets verbosity to level (1 by default)
|
||||
-OP:F or --output=PROVIDER=FILE: write test report to FILE using the specified provider
|
||||
|
||||
$ simple.cc.bin --help
|
||||
Tests compiled with Criterion v2.2.0
|
||||
|
||||
usage: simple.cc.bin OPTIONS
|
||||
options:
|
||||
-h or --help: prints this message
|
||||
-q or --quiet: disables all logging
|
||||
-v or --version: prints the version of criterion these tests have been linked against
|
||||
-l or --list: prints all the tests in a list
|
||||
-jN or --jobs N: use N concurrent jobs
|
||||
-f or --fail-fast: exit after the first failure
|
||||
--ascii: don't use fancy unicode symbols or colors in the output
|
||||
-S or --short-filename: only display the base name of the source file on a failure
|
||||
--pattern [PATTERN]: run tests matching the given pattern
|
||||
--tap[=FILE]: writes TAP report in FILE (no file or "-" means stderr)
|
||||
--xml[=FILE]: writes XML report in FILE (no file or "-" means stderr)
|
||||
--always-succeed: always exit with 0
|
||||
--no-early-exit: do not exit the test worker prematurely after the test
|
||||
--verbose[=level]: sets verbosity to level (1 by default)
|
||||
-OP:F or --output=PROVIDER=FILE: write test report to FILE using the specified provider
|
||||
|
||||
Listing the tests
|
||||
|
||||
$ simple.c.bin --list
|
||||
misc: 2 tests
|
||||
├── failing
|
||||
└── passing
|
||||
|
||||
$ simple.cc.bin --list
|
||||
misc: 2 tests
|
||||
├── failing
|
||||
└── passing
|
||||
|
||||
Testing the fixtures
|
||||
|
||||
$ fixtures.c.bin
|
||||
Runs before the test
|
||||
Runs after the test
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ fixtures.cc.bin
|
||||
Runs before the test
|
||||
Runs after the test
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing descriptions
|
||||
|
||||
$ description.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Just a failing test (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mdescription.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::skipped: Test is disabled (esc)
|
||||
[\x1b[0;34m----\x1b[0m] This one is skipped (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ description.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Just a failing test (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mdescription.cc\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::skipped: Test is disabled (esc)
|
||||
[\x1b[0;34m----\x1b[0m] This one is skipped (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing report hooks
|
||||
|
||||
$ report.c.bin
|
||||
criterion_init
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mreport.c\x1b[0m:\x1b[0;31m5\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] sample::test (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
testing test in category sample
|
||||
Asserts: [1 passed, 1 failed, 2 total]
|
||||
criterion_fini
|
||||
|
||||
$ report.cc.bin
|
||||
criterion_init
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mreport.cc\x1b[0m:\x1b[0;31m5\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] sample::test (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
testing test in category sample
|
||||
Asserts: [1 passed, 1 failed, 2 total]
|
||||
criterion_fini
|
113
test/cram/crashes.t
Normal file
113
test/cram/crashes.t
Normal file
|
@ -0,0 +1,113 @@
|
|||
Simple crashes & signal testing
|
||||
|
||||
$ signal.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msignal.c\x1b[0m:\x1b[0;31m16\x1b[0m: Unexpected signal caught below this line! (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::uncaught: CRASH! (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::wrong_signal (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m3\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ signal.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msignal.cc\x1b[0m:\x1b[0;31m16\x1b[0m: Unexpected signal caught below this line! (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::uncaught: CRASH! (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::wrong_signal (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m3\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Simple crashes & signal testing (verbose)
|
||||
|
||||
$ signal.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33msimple\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] simple::caught (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] simple::caught (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] simple::uncaught (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msignal.c\x1b[0m:\x1b[0;31m16\x1b[0m: Unexpected signal caught below this line! (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::uncaught: CRASH! (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] simple::wrong_signal (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::wrong_signal (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m3\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ signal.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33msimple\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] simple::caught (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] simple::caught (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] simple::uncaught (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msignal.cc\x1b[0m:\x1b[0;31m16\x1b[0m: Unexpected signal caught below this line! (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::uncaught: CRASH! (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] simple::wrong_signal (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] simple::wrong_signal (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m3\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Crashes outside of the test
|
||||
|
||||
$ other-crashes.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::teardown_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ other-crashes.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::teardown_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Crashes outside of the test (verbose)
|
||||
|
||||
$ other-crashes.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::setup_crash (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::teardown_crash (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::teardown_crash (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::teardown_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ other-crashes.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::setup_crash (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::setup_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::teardown_crash (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::teardown_crash (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `misc::teardown_crash` crashed during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m1\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
C++ Exceptions should be handled
|
||||
|
||||
$ exception.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_any: Caught some unexpected exception during the test execution. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_any (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_any_fini: Caught some unexpected exception during the test finalization. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_any_init: Caught some unexpected exception during the test initialization. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_any_init (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_std: Caught an unexpected exception during the test execution: Some exception message. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_std (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_std_fini: Caught an unexpected exception during the test finalization: Some exception message. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_std_init: Caught an unexpected exception during the test initialization: Some exception message. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_std_init (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m6\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m4\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
C++ Exceptions should be handled (verbose)
|
||||
|
||||
$ exception.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m6\x1b[0m tests from \x1b[0;33mexception\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exception::raise_any (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_any: Caught some unexpected exception during the test execution. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_any (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exception::raise_any_fini (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exception::raise_any_fini (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_any_fini: Caught some unexpected exception during the test finalization. (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exception::raise_any_init (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_any_init: Caught some unexpected exception during the test initialization. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_any_init (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exception::raise_std (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_std: Caught an unexpected exception during the test execution: Some exception message. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_std (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exception::raise_std_fini (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exception::raise_std_fini (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_std_fini: Caught an unexpected exception during the test finalization: Some exception message. (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exception::raise_std_init (esc)
|
||||
[\x1b[0;34m----\x1b[0m] exception::raise_std_init: Caught an unexpected exception during the test initialization: Some exception message. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] exception::raise_std_init (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m6\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m4\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
13
test/cram/early-exit.t
Normal file
13
test/cram/early-exit.t
Normal file
|
@ -0,0 +1,13 @@
|
|||
Testing --no-early-exit
|
||||
|
||||
$ simple.c.bin --no-early-exit
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing CRITERION_NO_EARLY_EXIT
|
||||
|
||||
$ CRITERION_NO_EARLY_EXIT=0 simple.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
35
test/cram/exit.t
Normal file
35
test/cram/exit.t
Normal file
|
@ -0,0 +1,35 @@
|
|||
Testing tests that call exit()
|
||||
|
||||
$ exit.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mexit\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit::expected_exit (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exit::expected_exit (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit::normal (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exit::normal (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit::unexpected_exit (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `exit::unexpected_exit` exited during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mexit_with_fixtures\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit_with_fixtures::fini_exits (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exit_with_fixtures::fini_exits (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `exit_with_fixtures::fini_exits` exited during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit_with_fixtures::init_exits (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `exit_with_fixtures::init_exits` exited during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m5\x1b[0;1m | Passing: \x1b[0;32m3\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m2\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ exit.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mexit\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit::expected_exit (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exit::expected_exit (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit::normal (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exit::normal (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit::unexpected_exit (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `exit::unexpected_exit` exited during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mexit_with_fixtures\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit_with_fixtures::fini_exits (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] exit_with_fixtures::fini_exits (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `exit_with_fixtures::fini_exits` exited during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] exit_with_fixtures::init_exits (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mWarning! The test `exit_with_fixtures::init_exits` exited during its setup or teardown.\x1b[0m (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m5\x1b[0;1m | Passing: \x1b[0;32m3\x1b[0;1m | Failing: \x1b[0;31m2\x1b[0;1m | Crashing: \x1b[0;31m2\x1b[0;1m \x1b[0m (esc)
|
7
test/cram/fail-fast.t
Normal file
7
test/cram/fail-fast.t
Normal file
|
@ -0,0 +1,7 @@
|
|||
Testing --fail-fast
|
||||
|
||||
$ simple.c.bin --fail-fast --verbose
|
||||
|
||||
Testing CRITERION_FAIL_FAST
|
||||
|
||||
$ CRITERION_FAIL_FAST=1 simple.c.bin --verbose
|
320
test/cram/json.t
Normal file
320
test/cram/json.t
Normal file
|
@ -0,0 +1,320 @@
|
|||
Testing multiple samples with --json
|
||||
|
||||
$ simple.c.bin --json
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "passing",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"simple.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ signal.c.bin --json
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 1,
|
||||
"failed": 2,
|
||||
"errored": 1,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "simple",
|
||||
"passed": 1,
|
||||
"failed": 2,
|
||||
"errored": 1,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "wrong_signal",
|
||||
"assertions": 0,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "uncaught",
|
||||
"assertions": 0,
|
||||
"status": "ERRORED",
|
||||
"messages": ["The test crashed."]
|
||||
},
|
||||
{
|
||||
"name": "caught",
|
||||
"assertions": 0,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ asserts.c.bin --json
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 4,
|
||||
"failed": 2,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "asserts",
|
||||
"passed": 4,
|
||||
"failed": 2,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "string",
|
||||
"assertions": 10,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "old_school",
|
||||
"assertions": 2,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"asserts.c:18: The conditions for this assertion were not met.",
|
||||
"asserts.c:17: You can fail an assertion with a message from anywhere"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "native",
|
||||
"assertions": 8,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "float",
|
||||
"assertions": 2,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "base",
|
||||
"assertions": 6,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"asserts.c:12: This assert runs",
|
||||
"asserts.c:11: assert is fatal, expect isn't"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "array",
|
||||
"assertions": 3,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ more-suites.c.bin --json
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 2,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "suite2",
|
||||
"passed": 1,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "suite1",
|
||||
"passed": 1,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "disabled",
|
||||
"passed": 0,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 0,
|
||||
"status": "SKIPPED",
|
||||
"messages": ["The test was skipped."]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ long-messages.c.bin --json
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "sample",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "long_msg",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"long-messages.c:4: This is",
|
||||
" A long message",
|
||||
" Spawning multiple lines.",
|
||||
" Formatting is respected."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
$ description.c.bin --json
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"tests": [
|
||||
{
|
||||
"name": "skipped",
|
||||
"assertions": 0,
|
||||
"status": "SKIPPED",
|
||||
"messages": ["The test was skipped."]
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"description.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Testing --output=json
|
||||
|
||||
$ simple.c.bin --output=json:-
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "passing",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"simple.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Testing CRITERION_OUTPUTS
|
||||
|
||||
$ CRITERION_OUTPUTS=json:- simple.c.bin
|
||||
{
|
||||
"id": "Criterion v2.2.0",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "passing",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"simple.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
117
test/cram/parameterized.t
Normal file
117
test/cram/parameterized.t
Normal file
|
@ -0,0 +1,117 @@
|
|||
Using parameterized tests
|
||||
|
||||
$ parameterized.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m76\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m76\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m76\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: Parameter: foo (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: Parameter: bar (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: Parameter: baz (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m9\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m9\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ parameterized.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m74\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m74\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m74\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: Parameter: foo (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: Parameter: bar (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: Parameter: baz (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m9\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m9\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Using parameterized tests (verbose)
|
||||
|
||||
$ parameterized.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mparams\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m76\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m76\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m76\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: Parameter: foo (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: Parameter: bar (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.c\x1b[0m:\x1b[0;31m15\x1b[0m: Assertion failed: Parameter: baz (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m9\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m9\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ parameterized.cc.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m3\x1b[0m tests from \x1b[0;33mparams\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m74\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m74\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m74\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::cleanup (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: Parameters: (1, 2.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: Parameters: (3, 4.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m35\x1b[0m: Assertion failed: Parameters: (5, 6.000000) (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::multiple (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: Parameter: foo (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: Parameter: bar (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mparameterized.cc\x1b[0m:\x1b[0;31m14\x1b[0m: Assertion failed: Parameter: baz (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] params::str (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m9\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m9\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Parameterized tests should be listed as one test
|
||||
|
||||
$ parameterized.c.bin --list
|
||||
params: 3 tests
|
||||
├── cleanup
|
||||
├── multiple
|
||||
└── str
|
84
test/cram/pattern.t
Normal file
84
test/cram/pattern.t
Normal file
|
@ -0,0 +1,84 @@
|
|||
Selecting misc::passing
|
||||
|
||||
$ simple.c.bin --pattern '*/passing' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Selecting misc::failing
|
||||
|
||||
$ simple.c.bin --pattern '!(*/passing)' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Selecting both misc::passing and misc::failing
|
||||
|
||||
$ simple.c.bin --pattern 'misc/[pf]a@(ss|il)ing' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.c\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion failed: The expression 0 is false. (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] misc::failing (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing nested extglob patterns
|
||||
|
||||
$ simple.c.bin --pattern '@(+(nest)ed))' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m0\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing one or more
|
||||
|
||||
$ simple.c.bin --pattern '?(*(a|b))' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m0\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing malformed pattern
|
||||
|
||||
$ simple.c.bin --pattern '?(malformed' --verbose
|
||||
pattern error: mismatching parenthesis
|
||||
[1]
|
||||
|
||||
Testing range negation
|
||||
|
||||
$ simple.c.bin --pattern 'misc/[!azerty]assing' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] misc::passing (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m1\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing unparenthesized pipe
|
||||
|
||||
$ simple.c.bin --pattern '|pipe' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m0\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Testing special char escaping
|
||||
|
||||
$ simple.c.bin --pattern '\!(escaped' --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m2\x1b[0m tests from \x1b[0;33mmisc\x1b[0m: (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::passing: Test is disabled (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] misc::failing: Test is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m0\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
7
test/cram/redirect.t
Normal file
7
test/cram/redirect.t
Normal file
|
@ -0,0 +1,7 @@
|
|||
Using redirections
|
||||
|
||||
$ redirect.c.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ redirect.cc.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
45
test/cram/suites.t
Normal file
45
test/cram/suites.t
Normal file
|
@ -0,0 +1,45 @@
|
|||
Using test suites
|
||||
|
||||
$ suites.c.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ suites.cc.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ more-suites.c.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ more-suites.cc.bin
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Listing tests in multiple suites
|
||||
|
||||
$ suites.c.bin --list
|
||||
first_suite: 1 test
|
||||
└── test
|
||||
second_suite: 1 test
|
||||
└── test
|
||||
|
||||
Running the tests with verbose output
|
||||
|
||||
$ suites.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33mfirst_suite\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] first_suite::test (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] first_suite::test (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33msecond_suite\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] second_suite::test (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] second_suite::test (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ more-suites.c.bin --verbose
|
||||
[\x1b[0;34m----\x1b[0m] Criterion v2.2.0 (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33mdisabled\x1b[0m: (esc)
|
||||
[\x1b[0;33mSKIP\x1b[0m] disabled::test: Suite is disabled (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33msuite1\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] suite1::test (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] suite1::test (esc)
|
||||
[\x1b[0;34m====\x1b[0m] Running \x1b[0;34m1\x1b[0m test from \x1b[0;33msuite2\x1b[0m: (esc)
|
||||
[\x1b[0;34mRUN \x1b[0m] suite2::test (esc)
|
||||
[\x1b[0;32mPASS\x1b[0m] suite2::test (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m2\x1b[0;1m | Passing: \x1b[0;32m2\x1b[0;1m | Failing: \x1b[0;31m0\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
98
test/cram/tap.t
Normal file
98
test/cram/tap.t
Normal file
|
@ -0,0 +1,98 @@
|
|||
Testing multiple samples with --tap
|
||||
|
||||
$ simple.c.bin --tap
|
||||
TAP version 13
|
||||
1..2
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 2 tests from misc
|
||||
ok - misc::passing
|
||||
not ok - misc::failing
|
||||
simple.c:4: Assertion failed: The expression 0 is false.
|
||||
|
||||
$ signal.c.bin --tap
|
||||
TAP version 13
|
||||
1..3
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 3 tests from simple
|
||||
not ok - simple::wrong_signal
|
||||
not ok - simple::uncaught unexpected signal after signal.c:16
|
||||
ok - simple::caught
|
||||
|
||||
$ asserts.c.bin --tap
|
||||
TAP version 13
|
||||
1..6
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 6 tests from asserts
|
||||
ok - asserts::string
|
||||
not ok - asserts::old_school
|
||||
asserts.c:18: Assertion failed: The conditions for this assertion were not met.
|
||||
asserts.c:17: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
ok - asserts::native
|
||||
ok - asserts::float
|
||||
not ok - asserts::base
|
||||
asserts.c:12: Assertion failed: This assert runs
|
||||
asserts.c:11: Assertion failed: assert is fatal, expect isn't
|
||||
ok - asserts::array
|
||||
|
||||
$ more-suites.c.bin --tap
|
||||
TAP version 13
|
||||
1..3
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 1 tests from suite2
|
||||
ok - suite2::test
|
||||
|
||||
# Running 1 tests from suite1
|
||||
ok - suite1::test
|
||||
|
||||
# Running 1 tests from disabled
|
||||
ok - disabled::test # SKIP suite is disabled
|
||||
|
||||
$ long-messages.c.bin --tap
|
||||
TAP version 13
|
||||
1..1
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 1 tests from sample
|
||||
not ok - sample::long_msg
|
||||
long-messages.c:4: Assertion failed: This is
|
||||
A long message
|
||||
Spawning multiple lines.
|
||||
Formatting is respected.
|
||||
|
||||
$ description.c.bin --tap
|
||||
TAP version 13
|
||||
1..2
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 2 tests from misc
|
||||
ok - misc::skipped This one is skipped # SKIP test is disabled
|
||||
not ok - misc::failing Just a failing test
|
||||
description.c:4: Assertion failed: The expression 0 is false.
|
||||
|
||||
Testing --output=tap
|
||||
|
||||
$ simple.c.bin --output=tap:-
|
||||
TAP version 13
|
||||
1..2
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 2 tests from misc
|
||||
ok - misc::passing
|
||||
not ok - misc::failing
|
||||
simple.c:4: Assertion failed: The expression 0 is false.
|
||||
|
||||
Testing CRITERION_OUTPUTS
|
||||
|
||||
$ CRITERION_OUTPUTS=tap:- simple.c.bin
|
||||
TAP version 13
|
||||
1..2
|
||||
# Criterion v2.2.0
|
||||
|
||||
# Running 2 tests from misc
|
||||
ok - misc::passing
|
||||
not ok - misc::failing
|
||||
simple.c:4: Assertion failed: The expression 0 is false.
|
19
test/cram/theories.t
Normal file
19
test/cram/theories.t
Normal file
|
@ -0,0 +1,19 @@
|
|||
Using theories
|
||||
|
||||
$ theories_regression.c.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mtheories_regression.c\x1b[0m:\x1b[0;31m34\x1b[0m: Assertion failed: The conditions for this assertion were not met. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Theory theory::misc failed with the following parameters: ('a', true, 1, 1, 3.14f, 3.14, "test", "other test") (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] theory::misc (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
$ theories_regression.cc.bin
|
||||
[\x1b[0;34m----\x1b[0m] \x1b[0;1mtheories_regression.cc\x1b[0m:\x1b[0;31m36\x1b[0m: Assertion failed: The conditions for this assertion were not met. (esc)
|
||||
[\x1b[0;34m----\x1b[0m] Theory theory::misc failed with the following parameters: ('a', true, 1, 1, 3.14f, 3.14, "test", "other test") (esc)
|
||||
[\x1b[0;31mFAIL\x1b[0m] theory::misc (esc)
|
||||
[\x1b[0;34m====\x1b[0m] \x1b[0;1mSynthesis: Tested: \x1b[0;34m1\x1b[0;1m | Passing: \x1b[0;32m0\x1b[0;1m | Failing: \x1b[0;31m1\x1b[0;1m | Crashing: \x1b[0;31m0\x1b[0;1m \x1b[0m (esc)
|
||||
|
||||
Theories should be listed as only one test
|
||||
|
||||
$ theories_regression.c.bin --list
|
||||
theory: 1 test
|
||||
└── misc
|
125
test/cram/xml.t
Normal file
125
test/cram/xml.t
Normal file
|
@ -0,0 +1,125 @@
|
|||
Testing multiple samples with --xml
|
||||
|
||||
$ simple.c.bin --xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
|
||||
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="passing" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="failing" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">simple.c:4: The expression 0 is false. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
$ signal.c.bin --xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="3" failures="2" errors="1" disabled="0">
|
||||
<testsuite name="simple" tests="3" failures="2" errors="1" disabled="0" skipped="0">
|
||||
<testcase name="wrong_signal" assertions="0" status="FAILED">
|
||||
<failure type="assert" message="0 assertion(s) failed."></failure>
|
||||
</testcase>
|
||||
<testcase name="uncaught" assertions="0" status="ERRORED">
|
||||
<error type="crash" message="The test crashed." /> </testcase>
|
||||
<testcase name="caught" assertions="0" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
$ asserts.c.bin --xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="6" failures="2" errors="0" disabled="0">
|
||||
<testsuite name="asserts" tests="6" failures="2" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="string" assertions="10" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="old_school" assertions="2" status="FAILED">
|
||||
<failure type="assert" message="2 assertion(s) failed.">asserts.c:18: The conditions for this assertion were not met. asserts.c:17: You can fail an assertion with a message from anywhere </failure>
|
||||
</testcase>
|
||||
<testcase name="native" assertions="8" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="float" assertions="2" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="base" assertions="6" status="FAILED">
|
||||
<failure type="assert" message="2 assertion(s) failed.">asserts.c:12: This assert runs asserts.c:11: assert is fatal, expect isn't </failure>
|
||||
</testcase>
|
||||
<testcase name="array" assertions="3" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
$ more-suites.c.bin --xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="3" failures="0" errors="0" disabled="1">
|
||||
<testsuite name="suite2" tests="1" failures="0" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="test" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite name="suite1" tests="1" failures="0" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="test" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite name="disabled" tests="1" failures="0" errors="0" disabled="1" skipped="1">
|
||||
<testcase name="test" assertions="0" status="SKIPPED">
|
||||
<skipped/>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
$ long-messages.c.bin --xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="1" failures="1" errors="0" disabled="0">
|
||||
<testsuite name="sample" tests="1" failures="1" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="long_msg" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">long-messages.c:4: This is A long message Spawning multiple lines. Formatting is respected. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
$ description.c.bin --xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="1">
|
||||
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="1" skipped="1">
|
||||
<testcase name="skipped" assertions="0" status="SKIPPED">
|
||||
<skipped/>
|
||||
</testcase>
|
||||
<testcase name="failing" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">description.c:4: The expression 0 is false. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
Testing --output=xml
|
||||
|
||||
$ simple.c.bin --output=xml:-
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
|
||||
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="passing" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="failing" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">simple.c:4: The expression 0 is false. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
Testing CRITERION_OUTPUTS
|
||||
|
||||
$ CRITERION_OUTPUTS=xml:- simple.c.bin
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Tests compiled with Criterion v2.2.0 -->
|
||||
<testsuites name="Criterion Tests" tests="2" failures="1" errors="0" disabled="0">
|
||||
<testsuite name="misc" tests="2" failures="1" errors="0" disabled="0" skipped="0">
|
||||
<testcase name="passing" assertions="1" status="PASSED">
|
||||
</testcase>
|
||||
<testcase name="failing" assertions="1" status="FAILED">
|
||||
<failure type="assert" message="1 assertion(s) failed.">simple.c:4: The expression 0 is false. </failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
Loading…
Add table
Reference in a new issue