Gen-test-cases tool: Print total number of test cases 89/61789/1
authorGeorg Kunz <georg.kunz@ericsson.com>
Mon, 3 Sep 2018 21:59:54 +0000 (23:59 +0200)
committerGeorg Kunz <georg.kunz@ericsson.com>
Mon, 3 Sep 2018 21:59:54 +0000 (23:59 +0200)
The tool for generating the testcases.json now prints the total number
of test cases per area. This is not needed by the webportal which does
the math itself but rather for updating the total numbers in the
documentation.

Change-Id: I02b8b4eba0d1046495002d32aa476b9abb45c0de
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
utils/generate-testcase-list/generate-testcases-list.py

index bafd329..5bfaa2f 100755 (executable)
@@ -71,6 +71,7 @@ class TestcaseList:
         }
 
         for area in ['mandatory', 'optional']:
+            total_per_area = 0
             testcase_names = testsuite_data.values()[0]['testcases_list'][area]
             for name in testcase_names:
                 tc = {
@@ -87,8 +88,12 @@ class TestcaseList:
                     tc['cases'] = cases
                     tc['total'] = len(cases)
 
+                total_per_area += tc['total']
                 testcase_list[area][name] = tc
 
+            print "Total number of test cases in area {}: {}".format(
+                    area, total_per_area)
+
         output_file = os.path.join(self.output_dir, 'testcases.json')
         with open(output_file, 'w') as file:
             json.dump(testcase_list, file, indent=4, sort_keys=True)