From a8612ed64fd42e8b98baebd828b1f4de2755a1e5 Mon Sep 17 00:00:00 2001 From: Jakub Witczak <kuba@erlang.org> Date: Tue, 12 Nov 2024 13:22:01 +0100 Subject: [PATCH] common_test: abort_if_missing_suites defaults to true --- .../doc/guides/run_test_chapter.md | 23 +++++++++++-------- lib/common_test/src/ct_run.erl | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/common_test/doc/guides/run_test_chapter.md b/lib/common_test/doc/guides/run_test_chapter.md index 9b1fb266013e..6c357646545c 100644 --- a/lib/common_test/doc/guides/run_test_chapter.md +++ b/lib/common_test/doc/guides/run_test_chapter.md @@ -40,16 +40,19 @@ suites are compiled. If a particular test object directory is specified (meaning all suites in this directory are to be part of the test), `Common Test` runs function `make:all/1` in the directory to compile the suites. -If compilation fails for one or more suites, the compilation errors are printed -to tty and the operator is asked if the test run is to proceed without the -missing suites, or be aborted. If the operator chooses to proceed, the tests -having missing suites are noted in the HTML log. If `Common Test` is unable to -prompt the user after compilation failure (if `Common Test` does not control -`stdin`), the test run proceeds automatically without the missing suites. This -behavior can however be modified with the `ct_run` flag -`-abort_if_missing_suites`, or the `ct:run_test/1` option -`{abort_if_missing_suites,TrueOrFalse}`. If `abort_if_missing_suites` is set to -`true`, the test run stops immediately if some suites fail to compile. +If compilation fails for one or more suites, the test run stops +immediately if some suites fail to compile. This behavior can however +be modified with the `ct_run` flag `-abort_if_missing_suites`, or the +`ct:run_test/1` option `{abort_if_missing_suites,TrueOrFalse}`.Option +`abort_if_missing_suites` is set to `true` by default. + +If `abort_if_missing_suites` is set to `false`, the compilation errors +are printed to tty and the operator is asked if the test run is to +proceed without the missing suites, or be aborted. If the operator +chooses to proceed, the tests having missing suites are noted in the +HTML log. If `Common Test` is unable to prompt the user after +compilation failure (if `Common Test` does not control `stdin`), the +test run proceeds automatically without the missing suites. Any help module (that is, regular Erlang module with name not ending with "\_SUITE") that resides in the same test object directory as a suite, which is diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 5c134c71d0e6..d6d35a8ad29a 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -307,7 +307,7 @@ script_start1(Parent, Args) -> AbortIfMissing = get_start_opt(abort_if_missing_suites, fun([]) -> true; ([Bool]) -> list_to_atom(Bool) - end, false, Args), + end, true, Args), %% silent connections SilentConns = get_start_opt(silent_connections, @@ -1036,7 +1036,7 @@ run_test2(StartOpts) -> end, %% abort test run if some suites can't be compiled - AbortIfMissing = get_start_opt(abort_if_missing_suites, value, false, + AbortIfMissing = get_start_opt(abort_if_missing_suites, value, true, StartOpts), %% decrypt config file