diff --git a/test/asserts.t b/test/asserts.t index 6b34be9..7802a11 100644 --- a/test/asserts.t +++ b/test/asserts.t @@ -145,3 +145,11 @@ Long assert messages should wrap [\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) diff --git a/test/core.t b/test/core.t index 0484530..6910f7d 100644 --- a/test/core.t +++ b/test/core.t @@ -131,3 +131,23 @@ Testing descriptions [\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 diff --git a/test/pattern.t b/test/pattern.t new file mode 100644 index 0000000..fdfc55a --- /dev/null +++ b/test/pattern.t @@ -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) diff --git a/test/theories.t b/test/theories.t new file mode 100644 index 0000000..8acfef3 --- /dev/null +++ b/test/theories.t @@ -0,0 +1,13 @@ +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)