From d97b8341077d6e5c9dc7312ae098f1a59b41731d Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 27 Oct 2015 18:16:24 +0100 Subject: [tests] Fix empty testfile check --- test/RegressTests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/RegressTests.py') diff --git a/test/RegressTests.py b/test/RegressTests.py index 0fef2127..a5bab42d 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -57,9 +57,6 @@ class RegressFile(object): in_error = False line = self.fd.readline() - if not line: - print >>sys.stderr, "WARNING: Empty testfile detected: %s" % (self.filename) - return False #print "line =", line while line: if line.startswith("test "): @@ -167,6 +164,10 @@ class RegressFile(object): harness.failure(os.path.basename(self.filename)) def run_tests(self): + if os.path.getsize(self.filename) == 0: + print >>sys.stderr, "WARNING: Empty testfile detected: %s" % (self.filename) + harness.failure(os.path.basename(self.filename)) + return False test = self.read_test() while test: self.run_test(test) -- cgit v1.2.3