Fixes CLI argument parsing

Accept more than one option for specifying test paths.

Support non-zero exit code when tests fail

Return a non-zero exit code (saturated to max value 255, even if more
than 255 tests fail) indicating number of failed tests. This is helpful
when running in a script (like in CI) to detect failures instead of
detecting failures through manual visual inspection of output text.
This commit is contained in:
Eric Kilmer 2022-05-24 19:53:10 -04:00 committed by caheckman
parent 0241b2b97e
commit cd09ea0c4a
4 changed files with 46 additions and 13 deletions

View file

@ -304,7 +304,7 @@ void FunctionTestCollection::runTests(list<string> &lateStream)
/// Run through all XML files in the given list, processing each in turn.
/// \param testFiles is the given list of test files
/// \param s is the output stream to print results to
void FunctionTestCollection::runTestFiles(const vector<string> &testFiles,ostream &s)
int FunctionTestCollection::runTestFiles(const vector<string> &testFiles,ostream &s)
{
int4 totalTestsApplied = 0;
@ -344,4 +344,5 @@ void FunctionTestCollection::runTestFiles(const vector<string> &testFiles,ostrea
if (iter == failures.end()) break;
}
}
return totalTestsApplied - totalTestsSucceeded;
}