Skip to content

Commit

Permalink
Fixed --name crash for HootTest (#3500)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarchant authored Sep 27, 2019
1 parent c614df4 commit 0da0399
Showing 1 changed file with 43 additions and 30 deletions.
73 changes: 43 additions & 30 deletions hoot-test/src/main/cpp/hoot/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,40 @@ void populateTests(_TestType t, std::vector<TestPtr>& vTests, bool printDiff,
}
}

void usage(char* argv)
{
// keep this alphabetized
cout << argv << " Usage:\n"
" --all - Run all the tests.\n"
" --all-names - Print the names of all the tests without running them.\n"
" --case-only - Run the conflate case tests only.\n"
" --current - Run the 'current' level tests.\n"
" --debug - Show debug level log messages and above.\n"
" --diff - Print a diff when a script test fails.\n"
" --error - Show error log level messages and above.\n"
" --exclude=[regex] - Exclude tests that match the specified regex. e.g. HootTest '--exclude=.*building.*'\n"
" --fatal - Show fatal error log level messages only.\n"
" --glacial - Run 'glacial' level tests and below.\n"
" --glacial-only - Run the 'glacial' level tests only.\n"
" --include=[regex] - Include only tests that match the specified regex. e.g. HootTest '--include=.*building.*'\n"
" --info - Show info log level messages and above.\n"
" --quick - Run the 'quick' level' tests.\n"
" --quick-only - Run the 'quick' level tests only.\n"
" --names - Show the names of all the tests as they run.\n"
" --parallel [process count] - Run the specified tests in parallel with the specified number of processes. With no process count specified, all available CPU cores are used to launch processes.\n"
" --single [test name] - Run only the test specified.\n"
" --slow - Run the 'slow' level tests and above.\n"
" --slow-only - Run the 'slow' level tests only.\n"
" --status - Show status log level messages and above.\n"
" --suppress-failure-detail - If a test fails, only show the tests' name and do not show a detailed failure message.\n"
" --trace - Show trace log level messages and above.\n"
" --verbose - Show verbose log level messages and above.\n"
" --warn - Show warning log level messages and above.\n"
"\n"
"See the Hootenanny Developer Guide for more information.\n"
;
}

int main(int argc, char* argv[])
{
// set the Qt hash seed to 0 for consistent test results
Expand All @@ -394,36 +428,8 @@ int main(int argc, char* argv[])

if (argc == 1)
{
// keep this alphabetized
cout << argv[0] << " Usage:\n"
"--all - Run all the tests.\n"
"--all-names - Print the names of all the tests without running them.\n"
"--case-only - Run the conflate case tests only.\n"
"--current - Run the 'current' level tests.\n"
"--debug - Show debug level log messages and above.\n"
"--diff - Print a diff when a script test fails.\n"
"--error - Show error log level messages and above.\n"
"--exclude=[regex] - Exclude tests that match the specified regex. e.g. HootTest '--exclude=.*building.*'\n"
"--fatal - Show fatal error log level messages only.\n"
"--glacial - Run 'glacial' level tests and below.\n"
"--glacial-only - Run the 'glacial' level tests only.\n"
"--include=[regex] - Include only tests that match the specified regex. e.g. HootTest '--include=.*building.*'\n"
"--info - Show info log level messages and above.\n"
"--quick - Run the 'quick' level' tests.\n"
"--quick-only - Run the 'quick' level tests only.\n"
"--names - Show the names of all the tests as they run.\n"
"--parallel [process count] - Run the specified tests in parallel with the specified number of processes. With no process count specified, all available CPU cores are used to launch processes.\n"
"--single [test name] - Run only the test specified.\n"
"--slow - Run the 'slow' level tests and above.\n"
"--slow-only - Run the 'slow' level tests only.\n"
"--status - Show status log level messages and above.\n"
"--suppress-failure-detail - If a test fails, only show the tests' name and do not show a detailed failure message.\n"
"--trace - Show trace log level messages and above.\n"
"--verbose - Show verbose log level messages and above.\n"
"--warn - Show warning log level messages and above.\n"
"\n"
"See the Hootenanny Developer Guide for more information.\n"
;
usage(argv[0]);
return 1;
}
else
{
Expand Down Expand Up @@ -602,6 +608,13 @@ int main(int argc, char* argv[])
cout << "Running core tests. Test count: " << vTestsToRun.size() << endl;
}

// Error out here is there is no HootTestListener created by this point
if (!listener)
{
usage(argv[0]);
return 1;
}

if (args.contains("--parallel"))
{
double start = Tgs::Time::getTime();
Expand Down

0 comments on commit 0da0399

Please sign in to comment.