diff --git a/hoot-test/src/main/cpp/hoot/test/main.cpp b/hoot-test/src/main/cpp/hoot/test/main.cpp index 38f2bc4c32..b2bcdd87da 100644 --- a/hoot-test/src/main/cpp/hoot/test/main.cpp +++ b/hoot-test/src/main/cpp/hoot/test/main.cpp @@ -386,6 +386,40 @@ void populateTests(_TestType t, std::vector& 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 @@ -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 { @@ -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();