Jelajahi Sumber

arranged test fixture as new attempt to fix test failure not reproducible on local win64 environment (no new collect invocation)

Greg Junkietech 4 tahun lalu
induk
melakukan
2e1e8a4ebf

+ 8 - 2
metrixpp/tests/general/test_basic.py

@@ -226,8 +226,14 @@ class Test(tests.common.TestCase):
 
         runner = tests.common.ToolRunner('view', ['--format=xml'], prefix='xml')
         self.assertExec(runner.run())
-        
-        runner = tests.common.ToolRunner('view', ['--format=prometheus'], prefix='prometheus')
+
+        runner = tests.common.ToolRunner('view', ['--format=prometheus', '--log-level=ERROR'], prefix='prometheus')
+        self.assertExec(runner.run())
+
+        runner = tests.common.ToolRunner('view',
+                                         ['--format=prometheus', '--log-level=ERROR'],
+                                         prefix='prometheus_simple.cpp',
+                                         dirs_list=['./simple.cpp'])
         self.assertExec(runner.run())
         
         runner = tests.common.ToolRunner('collect',

+ 23 - 0
metrixpp/tests/general/test_basic/test_view_format_view_prometheus_simple.cpp_stdout.gold.txt

@@ -0,0 +1,23 @@
+
+
+
+std_code_complexity_cyclomatic {file="./simple.cpp", region="A"} 3
+
+std_code_complexity_cyclomatic {file="./simple.cpp", region="func"} 1
+
+
+std_code_complexity_cyclomatic {file="./simple.cpp", region="embeded"} 1
+
+std_code_complexity_cyclomatic {file="./simple.cpp", region="func_to_be_removed_in_new_sources"} 2
+
+
+std_code_complexity_cyclomatic {file="./simple.cpp", region="embeded"} 1
+
+std_code_complexity_cyclomatic {file="./simple.cpp", region="never"} 1
+
+std_code_complexity_cyclomatic_avg {file="./simple.cpp"} 1.5
+std_code_complexity_cyclomatic_min {file="./simple.cpp"} 1
+std_code_complexity_cyclomatic_max {file="./simple.cpp"} 3
+std_code_complexity_cyclomatic_total {file="./simple.cpp"} 9.0
+
+