diff --git a/.cmake/Modules/Cram.cmake b/.cmake/Modules/Cram.cmake index bd2439b..0703eec 100644 --- a/.cmake/Modules/Cram.cmake +++ b/.cmake/Modules/Cram.cmake @@ -26,7 +26,6 @@ endif () set(ENV{LC_ALL} "en_US.utf8") set(ENV{CRITERION_ALWAYS_SUCCEED} "1") set(ENV{CRITERION_SHORT_FILENAME} "1") -set(ENV{CRITERION_NO_EARLY_EXIT} "1") set(ENV{CRITERION_JOBS} "1") set(ENV{CRITERION_DISABLE_TIME_MEASUREMENTS} "1") diff --git a/doc/env.rst b/doc/env.rst index e6fe4ce..f807e3b 100644 --- a/doc/env.rst +++ b/doc/env.rst @@ -18,9 +18,7 @@ Command line arguments a number of jobs ideal for your hardware configuration. * ``--pattern [PATTERN]``: Run tests whose string identifier matches the given shell wildcard pattern (see dedicated section below). (\*nix only) -* ``--no-early-exit``: The test workers shall not prematurely exit when done and - will properly return from the main, cleaning up their process space. - This is useful when tracking memory leaks with ``valgrind --tool=memcheck``. +* ``--no-early-exit``: This flag is deprecated and no longer does anything. * ``-S or --short-filename``: The filenames are displayed in their short form. * ``--always-succeed``: The process shall exit with a status of ``0``. * ``--tap[=FILE]``: Writes a TAP (Test Anything Protocol) report to FILE. @@ -81,7 +79,6 @@ Environment Variables Environment variables are alternatives to command line switches when set to 1. * ``CRITERION_ALWAYS_SUCCEED``: Same as ``--always-succeed``. -* ``CRITERION_NO_EARLY_EXIT``: Same as ``--no-early-exit``. * ``CRITERION_FAIL_FAST``: Same as ``--fail-fast``. * ``CRITERION_USE_ASCII``: Same as ``--ascii``. * ``CRITERION_JOBS``: Same as ``--jobs``. Sets the number of jobs to diff --git a/doc/faq.rst b/doc/faq.rst index 6432c06..aa15aa5 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -16,8 +16,3 @@ There are plenty of ways to fix that behaviour: A. Open a new issue on the `github issue tracker `_, and describe the problem you are experiencing, along with the platform you are running criterion on. - -**Q. Why does Gcov show 0% coverage after I run my tests?** - -You need to either pass ``--no-early-exit`` or define -``CRITERION_NO_EARLY_EXIT=1`` in your environment to get proper coverage. diff --git a/doc/internal.rst b/doc/internal.rst index 2958efa..1bc4491 100644 --- a/doc/internal.rst +++ b/doc/internal.rst @@ -30,8 +30,6 @@ logging_threshold enum criterion_logging_level The logging level ------------------- ---------------------------------- -------------------------------------------------------------- logger struct criterion_logger * The logger (see below) ------------------- ---------------------------------- -------------------------------------------------------------- -no_early_exit bool True iff the test worker should exit early -------------------- ---------------------------------- -------------------------------------------------------------- always_succeed bool True iff criterion_run_all_tests should always returns 1 ------------------- ---------------------------------- -------------------------------------------------------------- use_ascii bool True iff the outputs should use the ASCII charset diff --git a/include/criterion/options.h b/include/criterion/options.h index d8e3a0f..a24ee4a 100644 --- a/include/criterion/options.h +++ b/include/criterion/options.h @@ -77,13 +77,7 @@ struct criterion_options { struct criterion_logger *logger; /** - * Don't exit the child immediately after finishing to run the test - * function, and perform a full cleanup. - * - * Useful when tracking memory leaks, and is immediately implied when - * running the process under valgrind. - * - * default: false + * This option doesn't do anything and is deprecated. */ bool no_early_exit; diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 1cbb042..827e612 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -72,7 +72,6 @@ macro(add_samples DIR_ SAMPLES_) add_test(${sample} ${sample}.bin) set_property(TEST ${sample} PROPERTY ENVIRONMENT "CRITERION_ALWAYS_SUCCEED=1" - ENVIRONMENT "CRITERION_NO_EARLY_EXIT=1" # for coverage ) endforeach() endmacro() diff --git a/src/entry/params.c b/src/entry/params.c index 1124753..a8b1393 100644 --- a/src/entry/params.c +++ b/src/entry/params.c @@ -65,8 +65,6 @@ " --xml[=FILE]: writes XML report in FILE " \ "(no file or \"-\" means stderr)\n" \ " --always-succeed: always exit with 0\n" \ - " --no-early-exit: do not exit the test worker " \ - "prematurely after the test\n" \ " --verbose[=level]: sets verbosity to level " \ "(1 by default)\n" \ " --crash: crash failing assertions rather than " \ @@ -196,7 +194,6 @@ CR_API int criterion_handle_args(int argc, char *argv[], opterr = 0; char *env_always_succeed = getenv("CRITERION_ALWAYS_SUCCEED"); - char *env_no_early_exit = getenv("CRITERION_NO_EARLY_EXIT"); char *env_fail_fast = getenv("CRITERION_FAIL_FAST"); char *env_use_ascii = getenv("CRITERION_USE_ASCII"); char *env_jobs = getenv("CRITERION_JOBS"); @@ -208,8 +205,6 @@ CR_API int criterion_handle_args(int argc, char *argv[], struct criterion_options *opt = &criterion_options; if (env_always_succeed) opt->always_succeed = !strcmp("1", env_always_succeed); - if (env_no_early_exit) - opt->no_early_exit = !strcmp("1", env_no_early_exit); if (env_fail_fast) opt->fail_fast = !strcmp("1", env_fail_fast); if (env_use_ascii) @@ -267,7 +262,7 @@ CR_API int criterion_handle_args(int argc, char *argv[], switch (c) { case 'b': criterion_options.logging_threshold = (enum criterion_logging_level) atou(DEF(optarg, "1")); break; case 'y': criterion_options.always_succeed = true; break; - case 'z': criterion_options.no_early_exit = true; break; + case 'z': fprintf(stderr, "--no-early-exit is now deprecated as it no longer does anything.\n"); case 'k': criterion_options.use_ascii = true; break; case 'j': criterion_options.jobs = atou(optarg); break; case 'f': criterion_options.fail_fast = true; break; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d294fd6..5b3131a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,9 +34,6 @@ target_link_libraries(criterion_unit_tests criterion) add_dependencies(criterion_tests criterion_unit_tests) 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) diff --git a/test/cram/early-exit.t b/test/cram/early-exit.t deleted file mode 100644 index bbb265f..0000000 --- a/test/cram/early-exit.t +++ /dev/null @@ -1,13 +0,0 @@ -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[0m0\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[0m0\x1b[0;1m \x1b[0m (esc)