]> git.lizzy.rs Git - rust.git/commitdiff
Update test run summary
authorDerek Guenther <dguenther9@gmail.com>
Thu, 16 Jan 2014 15:35:47 +0000 (09:35 -0600)
committerDerek Guenther <dguenther9@gmail.com>
Thu, 16 Jan 2014 15:36:34 +0000 (09:36 -0600)
src/etc/check-summary.py
src/libextra/test.rs

index 272bbc6fbbd6c05b964dcaefb7d804fb65202bdd..de777c997299d1d8b82efba5d91d573a9ed5655a 100755 (executable)
@@ -7,13 +7,20 @@ if __name__ == '__main__':
     summaries = []
     def summarise(fname):
         summary = {}
-        fd = open(fname)
-        for line in fd:
-            status, test = line.strip().split(' ', 1)
-            if not summary.has_key(status):
-                summary[status] = []
-            summary[status].append(test)
-        summaries.append((fname, summary))
+        with open(fname) as fd:
+            for line in fd:
+                splitline = line.strip().split(' ')
+                if len(splitline) == 1:
+                    continue
+                status = splitline[0]
+                test = splitline[-1]
+                # track bench runs
+                if splitline[1] == 'ns/iter':
+                    status = 'bench'
+                if not summary.has_key(status):
+                    summary[status] = []
+                summary[status].append(test)
+            summaries.append((fname, summary))
     def count(t):
         return sum(map(lambda (f, s): len(s.get(t, [])), summaries))
     logfiles = sys.argv[1:]
@@ -21,8 +28,9 @@ if __name__ == '__main__':
     ok = count('ok')
     failed = count('failed')
     ignored = count('ignored')
-    print "summary of %d test runs: %d passed; %d failed; %d ignored" % \
-            (len(logfiles), ok, failed, ignored)
+    measured = count('bench')
+    print "summary of %d test runs: %d passed; %d failed; %d ignored; %d measured" % \
+            (len(logfiles), ok, failed, ignored, measured)
     print ""
     if failed > 0:
         print "failed tests:"
index 8d4c4471c89ffb7fa96a830ffd35b6d9e2762c65..1e302781c4a817c1f23f70a9e6d369f0192447ad 100644 (file)
@@ -474,7 +474,7 @@ pub fn write_log(&mut self, test: &TestDesc, result: &TestResult) {
         match self.log_out {
             None => (),
             Some(ref mut o) => {
-                let s = format!("{} {}", match *result {
+                let s = format!("{} {}\n", match *result {
                         TrOk => ~"ok",
                         TrFailed => ~"failed",
                         TrIgnored => ~"ignored",