]> git.cworth.org Git - apitrace-tests/commitdiff
trim_stress: Only look at files matching [0-9]*.png when counting references
authorCarl Worth <cworth@cworth.org>
Mon, 28 Jan 2013 12:05:26 +0000 (23:05 +1100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 6 Feb 2013 15:47:54 +0000 (15:47 +0000)
If there are any differences from a previous run, there will be
several additional image files left around, (.thumb.png, etc.). And we
don't want to count those.

trim_stress_driver.py

index 0feead391d888ee2bd08dff62594f622982e8812..048062a1f9d92d48cf4f25dfeb3c6eb3ce87b4e2 100644 (file)
@@ -24,7 +24,7 @@
 
 '''Stress test driver for apitrace trim.'''
 
-import os, errno, shutil, subprocess
+import os, errno, re, shutil, subprocess
 
 from base_driver import *
 
@@ -69,6 +69,9 @@ class TrimStressDriver(Driver):
             # Don't descend into any sub-directories (not that there
             # should be any)
             del dirs[:]
+            pattern = re.compile("[0-9]*\.png")
+            def f(x): return re.match(pattern, x)
+            files = filter(f, files)
             frames = len(files)
 
         for frame in range(frames):