Skip to content

Commit

Permalink
common_test: abort_if_missing_suites defaults to true
Browse files Browse the repository at this point in the history
  • Loading branch information
u3s committed Nov 12, 2024
1 parent 171fb25 commit a8612ed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
23 changes: 13 additions & 10 deletions lib/common_test/doc/guides/run_test_chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/common_test/src/ct_run.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a8612ed

Please sign in to comment.