From 0a037d35540bad74fc05101ad2bd4a556f1adf93 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sun, 17 Jan 2016 13:06:12 -0800 Subject: [PATCH] [test suite] minor file existence check --- test/coverage_diff.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/coverage_diff.py b/test/coverage_diff.py index 538a84c6..6c3869ed 100755 --- a/test/coverage_diff.py +++ b/test/coverage_diff.py @@ -7,6 +7,7 @@ import re import argparse +import os def main(): @@ -25,6 +26,14 @@ def main(): if args.new_lcov_dir: new_lcov_file = args.new_lcov_dir + "/" + final_lcov_file + if not os.path.exists(old_lcov_file): + print "[*] old coverage file does not exist: %s" % old_lcov_file + return 1 + + if not os.path.exists(new_lcov_file): + print "[*] new coverage file does not exist: %s" % new_lcov_file + return 1 + old_zero_coverage = extract_zero_coverage(old_lcov_file) new_zero_coverage = extract_zero_coverage(new_lcov_file)