Skip to content

Tags: silentbicycle/greatest

Tags

v1.5.0

Toggle v1.5.0's commit message
v1.5.0 release.

- API Changes

Changed default: `GREATEST_USE_LONGJMP` now defaults to 0. This eliminates
a warning about variables that can possibly become stale/corrupt in the
presence of `longjmp`. Since `GREATEST_FAIL_WITH_LONGJMP` isn't frequently
used, it should probably be opt-in.

Added `greatest_set_exact_name_match()` / `-e` flag, which changes the
name-based filtering from substring to exact match. Note that filtering
on an exact suite name will not skip tests run outside of any suite.

Added `GREATEST_ASSERT_NEQ` and `GREATEST_ASSERT_NEQm`. (Thanks @tekknolagi.)

Added `GREATEST_ASSERT_GT`, `GREATEST_ASSERT_GTE`, `GREATEST_ASSERT_LT`,
and `GREATEST_ASSERT_LTE`, along with their custom message (`m`)
variants.

- Bug Fixes

Makefile: Fix targets so all files are rebuilt when `greatest.h` or the
`Makefile` are modified, but without potentially breaking the build due
to including `greatest.h` as a linker argument to `example_trunc` (which
could happen with clang). (Thanks @vemakereporter, @theosotr.)

Calls to `GREATEST_RUN_TEST` from inside another test are now ignored.

Other flags starting with `--` besides `--help` (print help) and `--`
(ignore rest of ARGV) now produce an "Unknown argument" message;
previously they were unintentionally handled like `--`.

- Other Improvements

Added built `example_cpp` executable to `.gitignore`.

Expanded on the role of `RUN_TEST`, `RUN_TEST1`, `RUN_TESTp`,
`PASS`, `SKIP`, and `FAIL` in the README.

Addressed a `-Wimplicit-fallthrough` warning when building with clang
using `-Weverything`.

v1.4.2

Toggle v1.4.2's commit message
v1.4.2 - 2019-03-24

- API Changes

None.

- Other Improvements

Fixed configuration parameters for the PRNG (used for shuffling).
Previously, certain rare combinations of test counts and input states
could prevent the linear congruential RNG from having its full period
before repeating values, which could cause tests to be run multiple
times or skipped during shuffling.

Fixed an assertion in the example code where the expected and actual
parameters were swapped. (Reported by @shaohuasong.)

Updated a comment to reflect that `GREATEST_ASSERT_STR_EQm` compares
using `strncmp`, not `strcmp`. (Reported by @orangewait.)

Minor formatting improvements in the README.

v1.4.1

Toggle v1.4.1's commit message
- API Changes

None.

- Other Improvements

Fixed a warning when compiled with `-Wconversion`. (Thanks @HawkSK.)

Replaced a remaining direct use of `fprintf` with `GREATEST_FPRINTF`.
(Thanks @ligurio.)

Fixed typo in example code. (Thanks @ligurio.)

Bugfix: Previously, a test failure in first-fail mode didn't prevent
later suites from running.

Added a comment noting that the duplicated declaration inside the
`GREATEST_SUITE` macro is intentional.

Renamed `exp` local variable to `expd`, to prevent a possible
warning about shadowing `exp(3)`.

Updated the command line argument documentation in the README and
the usage message.

Added a description of output behaviors for each test case
result type, and clarified that the custom message variants
(e.g. `SKIPm("TODO")`) can be used to set custom messages, but
do not affect whether or not the message is printed.

v1.4.0

Toggle v1.4.0's commit message
- API Changes

Added `greatest_abort_on_fail`, which sets a flag to call `abort()` on
the first test failure (`-a` in the CLI test runner). If tests are
running inside a debugger, this will break right on the failure.
Feature suggestion and initial implementation by @fsaintjacques.

Added `greatest_list_only()`, which sets the same flag as the `-l`
option in the CLI test runner.

Added `greatest_set_test_suffix(const char *suffix)`, which can
be used to add a suffix to the name printed for the next test.
This can be used to distinguish between tests when running
parametric tests (particularly when shuffled). Note that this
suffix is included in the matching for `-t` and `-x`.

The `greatest_info` struct now allocates a `char` buffer for the test
name and optional '_' separator & suffix. The buffer size can be
configured by `#define`ing `GREATEST_TESTNAME_BUF_SIZE`. (See
`example_trunc.c`.) If the test name plus optional suffix does not fit
in the buffer, it will be truncated and `\0` terminated.

Made a couple functions `static` that were previously exposed, but
explictly listed as being internal (`greatest_do_pass`,
`greatest_do_fail`, `greatest_do_skip`, `greatest_suite_pre`,
`greatest_suite_post`, `greatest_usage`).

- Other Improvements

Fixed link to ISC license in README.md. (Thanks @vaibhavsagar.)

Fixed issue link and whitespace in README.md and CONTRIBUTING.md.
(Thanks @bebehei.)

Change a couple macros into functions: `GREATEST_INIT` and
`GREATEST_PRINT_REPORT`. Most of the macros have variable capture,
return from their call site, etc., but these two don't need to be
macros.

v1.3.1

Toggle v1.3.1's commit message
- API Changes

None.

- Other Improvements

Bugfix: `GREATEST_SHUFFLE_TESTS` and `GREATEST_SHUFFLE_SUITES`
did not check for the `stop_at_first_fail` flag, and could get
stuck in an infinite loop. Now their loops stop as expected.

Renamed `example_random.c` to `example_shuffle.c`, since its
focus is really on random shuffling of suites and tests.

v1.3.0

Toggle v1.3.0's commit message
- API Changes

Added `GREATEST_SHUFFLE_SUITES(SEED, BODY)` macro (and `SHUFFLE_SUITES`
abbreviation). This runs any suites within BODY in pseudorandom order,
seeded by SEED.

Added `GREATEST_SHUFFLE_TESTS(SEED, BODY)` macro (and `SHUFFLE_TESTS`
abbreviation). This runs any tests within BODY in pseudorandom order,
seeded by SEED.

If `GREATEST_NO_EXTERN_CPLUSPLUS` is `#define`d, then the C++
`extern "C" { ... }` namespacing around greatest is disabled.

All calls to `fprintf` have been wrapped in a macro, `GREATEST_FPRINTF`,
which can be `#define`d to substitute another function with the same
interface. Feature suggestion and initial implementation by
@AndreasMartin72.

Added `greatest_stop_at_first_fail()`, to set the flag to stop the test
runner at the first failure (`-f` in the CLI test runner).

Added `void greatest_test_exclude(const char *filter)`, which takes a
filter string and ignores all tests whose names contain the filter
string. This takes precedence over `greatest_test_filter` matches.

Added a CLI test runner option, `-x`, which calls
`greatest_test_exclude` with its argument.

- Other Improvements

Bugfix: `GREATEST_SAVE_CONTEXT()` was only used in `GREATEST_RUN_TEST`,
not `GREATEST_RUN_TEST1` or `GREATEST_RUN_TESTp`, which could cause
corruption when tests using them called `ASSERT_OR_LONGJMPm` or
`FAIL_WITH_LONGJMPm`. Reported and fixed by @tcarmelveilleux.

Add `contrib/entapment` script, which converts a greatest test runner's
verbose-style output to TAP version 13 format.

Add `contrib/testify` script, which converts calls to `RUN_TEST(test);`
to test functions with `SKIPm("TODO");`.

Disabled `-Weverything` in Makefile: it isn't portable.

Various improvements to the documentation.

If list (`-l`) and test name filtering are both used, only tests that
would have run are printed. This can be used to test filter strings.

v1.2.2

Toggle v1.2.2's commit message
v1.2.2 release.

This patch release addresses a couple warnings, so
test code using greatest is able to build cleanly with
`-Wall -Weverything -Wextra -pedantic -Werror`.

- API Changes

None.

- Other Improvements

Explicitly mention ISC License in README.

Always `fflush(GREATEST_STDOUT)` after tests, rather than checking
whether `GREATEST_STDOUT` expands to `stdout` (the default) first. This
avoids a tautological comparison warning. Reported by @jibsen and
@nemequ.

Address warnings that can appear under `-Weverything`: padding in
`struct greatest_run_info`, a pointer cast that unintentionally removed
`const`, and a non-literal `printf` format string (caused by a literal
format string constructed and saved to a variable in a macro). Reported
by @kozross.

v1.2.1

Toggle v1.2.1's commit message
v1.2.1 release.

- API Changes

None.

- Other Improvements

Accept "--help" as an alternate form of "-h" in command line test
runners. (Thanks @jibsen).

Avoid redundant evaluation of arguments in `ASSERT_ENUM_EQ`.

Clarify type of `ENUM_STR` argument in `ASSERT_ENUM_EQ`. Use a function
pointer typedef so the compiler can give better type errors.

Warn about redundant evaluation of arguments in `ASSERT_EQ_FMT`.

Prefix the variables used in the expansion of the `ASSERT_EQ_FMT`,
`ASSERT_ENUM_EQ`, and `ASSERT_IN_RANGE` macros, to avoid name clashes
that can cause confusing compiler errors.