Skip to content

Commit

Permalink
Merge pull request #162 from cgay/report-file
Browse files Browse the repository at this point in the history
Remove the --report-file option
  • Loading branch information
cgay authored Oct 13, 2023
2 parents 7b83aed + a7183e3 commit 6c359d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
24 changes: 5 additions & 19 deletions command-line.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ define function parse-args
help: "Order in which to run tests. Note that when suites are being used"
" the suite is ordered with other tests/suites at the same level and"
" then when that suite runs its components are ordered separately."));

// TODO(cgay): I adopted the convention of using ./_test in test-temp-directory()
// and we could use it here as the default location of the report file.
add-option(parser,
make(<parameter-option>,
names: "report-file",
variable: "FILE",
help: "File in which to store the report."));

add-option(parser,
make(<repeated-parameter-option>,
names: "load",
Expand Down Expand Up @@ -270,18 +261,13 @@ define function run-or-list-tests
0
else
// Run the requested tests.
let pathname = get-option-value(parser, "report-file");
let result = run-tests(runner, start-suite);
if (pathname)
fs/with-open-file(stream = pathname, direction: #"output", if-exists: #"replace")
report-function(result, stream);
end;
// Always display the summary on the console.
print-summary-report(result, *standard-output*);
report-function(result, *standard-output*);
if (result.result-status == $passed)
0
else
report-function(result, *standard-output*);
end;
if (result.result-status == $passed) 0 else 1 end
1
end
end
end function;

Expand Down
15 changes: 8 additions & 7 deletions documentation/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,20 @@ xxx-test-suite-app.lid`` and run with ``xxx-test-suite-app --help``.
Reports
=======

The ``--report`` and ``--report-file`` options can be used to write a full
report of test run results so that those results can be compared with
subsequent test runs, for example to find regressions. These are the available
report types:
The ``--report`` option can be used to generate a full report of test run
results. These are the available report types:

failures
Prints out only the list of failures and a summary.
failures (the default)
Prints out only the list of failures and a summary, in readable text format.

full
Like ``failures`` but prints results whether passing or failing.

json
Outputs JSON objects that match the suite/test/assertion tree structure,
with full detail.

summary (the default)
summary
Prints out only a summary of how many assertions, tests and suites
were executed, passed, failed or crashed.

Expand Down

0 comments on commit 6c359d9

Please sign in to comment.