Count the number of tests that failed due to reqlib()
authorSimon Marlow <marlowsd@gmail.com>
Fri, 6 Jan 2012 09:48:42 +0000 (09:48 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 6 Jan 2012 11:29:57 +0000 (11:29 +0000)
OVERALL SUMMARY for test run started at Fri Jan  6 09:46:46 GMT 2012
      82 total tests, which gave rise to
     820 test cases, of which
       0 caused framework failures
     818 were skipped

       0 expected passes
       2 had missing libraries  <---
       0 expected failures
       0 unexpected passes
       0 unexpected failures

testsuite/driver/testglobals.py
testsuite/driver/testlib.py

index 3da3774..634792c 100644 (file)
@@ -123,6 +123,8 @@ class TestRun:
        self.expected_passes = {}
        self.n_expected_failures = 0
        self.expected_failures = {}
+       self.n_missing_libs = 0
+       self.missing_libs = {}
        self.n_unexpected_passes = 0
        self.unexpected_passes = {}
        self.n_unexpected_failures = 0
index d5e6300..4b905b6 100644 (file)
@@ -111,7 +111,7 @@ def _reqlib( opts, lib ):
         have_lib[lib] = got_it
 
     if not got_it:
-        opts.expect = 'fail'
+        opts.expect = 'missing-lib'
 
 def req_profiling( opts ):
     if not config.have_profiling:
@@ -707,7 +707,9 @@ def do_test(name, way, func, args):
             if config.use_threads:
                 t.lock.acquire()
 
-        if getTestOpts().expect != 'pass' and getTestOpts().expect != 'fail':
+        if getTestOpts().expect != 'pass' and \
+                getTestOpts().expect != 'fail' and \
+                getTestOpts().expect != 'missing-lib':
             framework_fail(name, way, 'bad expected ' + getTestOpts().expect)
 
         try:
@@ -735,11 +737,18 @@ def do_test(name, way, func, args):
                 reason = result['reason']
                 addFailingTestInfo(t.unexpected_failures, getTestOpts().testdir, name, reason, way)
             else:
-                t.n_expected_failures = t.n_expected_failures + 1
-                if name in t.expected_failures:
-                    t.expected_failures[name].append(way)
+                if getTestOpts().expect == 'missing-lib':
+                    t.n_missing_libs = t.n_missing_libs + 1
+                    if name in t.missing_libs:
+                        t.missing_libs[name].append(way)
+                    else:
+                        t.missing_libs[name] = [way]
                 else:
-                    t.expected_failures[name] = [way]
+                    t.n_expected_failures = t.n_expected_failures + 1
+                    if name in t.expected_failures:
+                        t.expected_failures[name].append(way)
+                    else:
+                        t.expected_failures[name] = [way]
         else:
             framework_fail(name, way, 'bad result ' + passFail)
     except:
@@ -1982,6 +1991,8 @@ def summary(t, file):
                + ' were skipped\n\n' \
                + string.rjust(`t.n_expected_passes`, 8)
                + ' expected passes\n' \
+               + string.rjust(`t.n_missing_libs`, 8)
+               + ' had missing libraries\n' \
                + string.rjust(`t.n_expected_failures`, 8) \
                + ' expected failures\n' \
                + string.rjust(`t.n_unexpected_passes`, 8) \