From: Carl Worth Date: Mon, 28 Jan 2013 12:05:26 +0000 (+1100) Subject: trim_stress: Only look at files matching [0-9]*.png when counting references X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=commitdiff_plain;h=2c00a00c867378bdc047f5951edbbe1be61d2295;hp=dd5c2d8d4e482339fcf790f02e05f461d63e7e7c trim_stress: Only look at files matching [0-9]*.png when counting references 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. --- diff --git a/trim_stress_driver.py b/trim_stress_driver.py index 0feead3..048062a 100644 --- a/trim_stress_driver.py +++ b/trim_stress_driver.py @@ -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):