Skip to content

Commit

Permalink
cram: updated tests, remove colors, unicode, and timings.
Browse files Browse the repository at this point in the history
This should simplify a lot of the output testing, since we
don't have to deal with as much character escapes.

Color testing can be reintroduced later on.
  • Loading branch information
Snaipe committed Jul 16, 2017
1 parent 1c2a5c4 commit d8c9c97
Show file tree
Hide file tree
Showing 13 changed files with 1,534 additions and 1,525 deletions.
1,690 changes: 845 additions & 845 deletions test/cram/asserts.t

Large diffs are not rendered by default.

152 changes: 76 additions & 76 deletions test/cram/core.t
Expand Up @@ -9,125 +9,125 @@ Checking the version
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 (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
\[\\x1b\[0;31mFAIL\\x1b\[0m\] misc::failing: \(\d\.\d\ds\) \(esc\) (re)
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[----] simple.c:4: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
[FAIL] misc::failing
[====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0

$ simple.cc.bin
[\x1b[0;34m----\x1b[0m] \x1b[0;1msimple.cc\x1b[0m:\x1b[0;31m4\x1b[0m: Assertion Failed (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
\[\\x1b\[0;31mFAIL\\x1b\[0m\] misc::failing: \(\d\.\d\ds\) \(esc\) (re)
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[----] simple.cc:4: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
[FAIL] misc::failing
[====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0

Running with verbose output

$ simple.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (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 (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
\[\\x1b\[0;31mFAIL\\x1b\[0m\] misc::failing: \(\d\.\d\ds\) \(esc\) (re)
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
\[\\x1b\[0;32mPASS\\x1b\[0m\] misc::passing: \(\d\.\d\ds\) \(esc\) (re)
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[----] Criterion v2.3.2
[====] Running 2 tests from misc:
[RUN ] misc::failing
[----] simple.c:4: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
[FAIL] misc::failing
[RUN ] misc::passing
[PASS] misc::passing
[====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0

$ simple.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (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 (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
\[\\x1b\[0;31mFAIL\\x1b\[0m\] misc::failing: \(\d.\d\ds\) \(esc\) (re)
[\x1b[0;34mRUN \x1b[0m] misc::passing (esc)
\[\\x1b\[0;32mPASS\\x1b\[0m\] misc::passing: \(\d\.\d\ds\) \(esc\) (re)
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[----] Criterion v2.3.2
[====] Running 2 tests from misc:
[RUN ] misc::failing
[----] simple.cc:4: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
[FAIL] misc::failing
[RUN ] misc::passing
[PASS] misc::passing
[====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0

Listing the tests

$ simple.c.bin --list
misc: 2 tests
├── failing
└── passing
|-- failing
`-- passing
$ simple.cc.bin --list
misc: 2 tests
├── failing
└── passing
|-- 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[0m0\x1b[0;1m | Crashing: \x1b[0m0\x1b[0;1m \x1b[0m (esc)
[====] Synthesis: Tested: 1 | Passing: 1 | Failing: 0 | Crashing: 0

$ 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[0m0\x1b[0;1m | Crashing: \x1b[0m0\x1b[0;1m \x1b[0m (esc)
[====] Synthesis: Tested: 1 | Passing: 1 | Failing: 0 | Crashing: 0

Testing descriptions

$ description.c.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (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 (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
\[\\x1b\[0;31mFAIL\\x1b\[0m\] misc::failing: \(\d.\d\ds\) \(esc\) (re)
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[----] Criterion v2.3.2
[====] Running 2 tests from misc:
[RUN ] misc::failing
[----] Just a failing test
[----] description.c:4: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
[FAIL] misc::failing
[SKIP] misc::skipped: Test is disabled
[----] This one is skipped
[====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0

$ description.cc.bin --verbose
[\x1b[0;34m----\x1b[0m] Criterion v2.3.2 (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 (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
\[\\x1b\[0;31mFAIL\\x1b\[0m\] misc::failing: \(\d.\d\ds\) \(esc\) (re)
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[----] Criterion v2.3.2
[====] Running 2 tests from misc:
[RUN ] misc::failing
[----] Just a failing test
[----] description.cc:4: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
[FAIL] misc::failing
[SKIP] misc::skipped: Test is disabled
[----] This one is skipped
[====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0

Testing report hooks

$ report.c.bin
criterion_init
testing test in category sample
[\x1b[0;34m----\x1b[0m] \x1b[0;1mreport.c\x1b[0m:\x1b[0;31m5\x1b[0m: Assertion Failed (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[----] report.c:5: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
Asserts: [1 passed, 1 failed, 2 total]
\[\\x1b\[0;31mFAIL\\x1b\[0m\] sample::test: \(\d\.\d\ds\) \(esc\) (re)
[FAIL] sample::test
criterion_fini
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0

$ report.cc.bin
criterion_init
testing test in category sample
[\x1b[0;34m----\x1b[0m] \x1b[0;1mreport.cc\x1b[0m:\x1b[0;31m5\x1b[0m: Assertion Failed (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[\x1b[0;34m----\x1b[0m] The expression 0 is false. (esc)
[\x1b[0;34m----\x1b[0m] (esc)
[----] report.cc:5: Assertion Failed
[----]
[----] The expression 0 is false.
[----]
Asserts: [1 passed, 1 failed, 2 total]
\[\\x1b\[0;31mFAIL\\x1b\[0m\] sample::test: \(\d\.\d\ds\) \(esc\) (re)
[FAIL] sample::test
criterion_fini
[\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[0m0\x1b[0;1m \x1b[0m (esc)
[====] Synthesis: Tested: 1 | Passing: 0 | Failing: 1 | Crashing: 0

0 comments on commit d8c9c97

Please sign in to comment.