From ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 30 Apr 2009 13:04:20 -0500 Subject: Second Life viewer sources 1.23.0-RC --- linden/indra/test/test.cpp | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'linden/indra/test/test.cpp') diff --git a/linden/indra/test/test.cpp b/linden/indra/test/test.cpp index 10a2088..ba81c6e 100644 --- a/linden/indra/test/test.cpp +++ b/linden/indra/test/test.cpp @@ -19,7 +19,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -53,9 +54,10 @@ # include "ctype_workaround.h" #endif - namespace tut { + std::string sSourceDir; + test_runner_singleton runner; } @@ -68,7 +70,6 @@ public: mPassedTests(0), mFailedTests(0), mSkippedTests(0), - mSkippedFailTests(0), mStream(stream) { } @@ -107,10 +108,6 @@ public: break; case tut::test_result::skip: ++mSkippedTests; - out << "skipped"; - break; - case tut::test_result::skip_fail: - ++mSkippedFailTests; out << "skipped known failure"; break; default: @@ -159,12 +156,7 @@ private: if (mSkippedTests > 0) { - stream << "Skipped Tests: " << mSkippedTests << std::endl; - } - - if (mSkippedFailTests > 0) - { - stream << "Skipped known failures: " << mSkippedFailTests + stream << "Skipped known failures: " << mSkippedTests << std::endl; } @@ -183,7 +175,6 @@ protected: int mPassedTests; int mFailedTests; int mSkippedTests; - int mSkippedFailTests; std::ostream *mStream; }; @@ -194,7 +185,7 @@ static const apr_getopt_option_t TEST_CL_OPTIONS[] = {"verbose", 'v', 0, "Verbose output."}, {"group", 'g', 1, "Run test group specified by option argument."}, {"output", 'o', 1, "Write output to the named file."}, - {"skip", 's', 1, "Skip test number specified by option argument. Only works when a specific group is being tested"}, + {"sourcedir", 's', 1, "Project source file directory from CMake."}, {"touch", 't', 1, "Touch the given file if all tests succeed"}, {"wait", 'w', 0, "Wait for input before exit."}, {"debug", 'd', 0, "Emit full debug logs."}, @@ -226,8 +217,6 @@ void stream_usage(std::ostream& s, const char* app) s << "\tList all available test groups." << std::endl; s << " " << app << " --group=uuid" << std::endl; s << "\tRun the test group 'uuid'." << std::endl; - s << " " << app << " --skip=2" << std::endl; - s << "\tSkip test case 2." << std::endl; } void stream_groups(std::ostream& s, const char* app) @@ -276,7 +265,6 @@ int main(int argc, char **argv) // values used for controlling application bool verbose_mode = false; bool wait_at_exit = false; - int skip_test_id = 0; std::string test_group; // values use for options parsing @@ -302,9 +290,6 @@ int main(int argc, char **argv) case 'g': test_group.assign(opt_arg); break; - case 's': - skip_test_id = atoi(opt_arg); - break; case 'h': stream_usage(std::cout, argv[0]); return 0; @@ -319,6 +304,11 @@ int main(int argc, char **argv) output = new std::ofstream; output->open(opt_arg); break; + case 's': // --sourcedir + tut::sSourceDir = opt_arg; + // For convenience, so you can use tut::sSourceDir + "myfile" + tut::sSourceDir += '/'; + break; case 't': touch = opt_arg; break; @@ -347,7 +337,7 @@ int main(int argc, char **argv) } else { - tut::runner.get().run_tests(test_group, skip_test_id); + tut::runner.get().run_tests(test_group); } if (wait_at_exit) -- cgit v1.1