diff --git a/test/ci_support/cdash_analyze_and_report_random_failures_UnitTests.py b/test/ci_support/cdash_analyze_and_report_random_failures_UnitTests.py index 6dade3b3d..21cbf997c 100644 --- a/test/ci_support/cdash_analyze_and_report_random_failures_UnitTests.py +++ b/test/ci_support/cdash_analyze_and_report_random_failures_UnitTests.py @@ -45,6 +45,7 @@ from FindCISupportDir import * import CDashQueryAnalyzeReport as CDQAR +from cdash_analyze_and_report_random_failures import * from CDashQueryAnalyzeReportUnitTestHelpers import * # Base test directory in the build tree @@ -101,8 +102,39 @@ def __enter__(self): def __exit__(self, exc_type, exc_val, exc_tb): self.remove() +############################################################################# +# +# Unit tests for cdash_analyze_and_report_random_failures.py +# +############################################################################# + + +class test_getBuildIdFromTest(unittest.TestCase): + + def test_single_slash(self): + test_dict = { 'buildSummaryLink':'build/somenumber' } + self.assertEqual( + getBuildIdFromTest(test_dict), 'somenumber') + + def test_multiple_slash(self): + test_dict = { 'buildSummaryLink':'build/path/temp/somenumber' } + self.assertEqual( + getBuildIdFromTest(test_dict), 'somenumber') + + def test_no_slash(self): + test_dict = { 'buildSummaryLink':'buildid' } + self.assertEqual( + getBuildIdFromTest(test_dict), 'buildid') + + +############################################################################# +# +# System-level tests for cdash_analyze_and_report_random_failures.py +# +############################################################################# + -class test_cdash_analyze_and_report(unittest.TestCase): +class test_cdash_analyze_and_report_random_failures(unittest.TestCase): def cdash_analyze_and_report_run_case( self, expectedRtnCode,