From 00d435f726cb7db62ac2901c54466ef1c05adee3 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Sun, 20 Jul 2014 15:19:06 +0400 Subject: [PATCH] fixed typos, added command line arguments check to regresion_read.py --- alloy.py | 11 ++++++++--- regression_read.py | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/alloy.py b/alloy.py index 331ec34f..5bb189b9 100755 --- a/alloy.py +++ b/alloy.py @@ -330,9 +330,13 @@ def build_ispc(version_LLVM, make): if options.debug == True: folder += "dbg" - p = subprocess.Popen("svnversion " + folder, shell=True, \ + p = subprocess.Popen("svn info " + folder, shell=True, \ stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (revision_llvm, err) = p.communicate() + (info_llvm, err) = p.communicate() + info_llvm = re.split('\n', info_llvm) + for i in info_llvm: + if len(i) > 0 and i.startswith("Last Changed Rev: "): + common.ex_state.switch_revision(str(i[len("Last Changed Rev: "):])) try_do_LLVM("recognize LLVM revision", "svn info " + folder, True) try_do_LLVM("build ISPC with LLVM version " + version_LLVM + " ", make_ispc, True) @@ -641,7 +645,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update, attach_mail_file(msg, performance.in_file, "performance.log") attach_mail_file(msg, "." + os.sep + "logs" + os.sep + "perf_build.log", "perf_build.log") # dumping gathered info to the file - commom.ex_state.dump(alloy_folder + "test_table.dump", commom.ex_state.tt) + common.ex_state.dump(alloy_folder + "test_table.dump", common.ex_state.tt) # sending e-mail with results if options.notify != "": fp = open(os.environ["ISPC_HOME"] + os.sep + "notify_log.log", 'rb') @@ -762,6 +766,7 @@ import datetime import copy import multiprocessing import subprocess +import re from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.mime.text import MIMEText diff --git a/regression_read.py b/regression_read.py index 10e69046..9d681172 100755 --- a/regression_read.py +++ b/regression_read.py @@ -52,14 +52,17 @@ if __name__ == '__main__': return self.epilog examples = ("Examples:\n" + - "Load test_table object\n\tregression_read.py -l\n") + "Load test_table object\n\tregression_read.py -l 'test_table.dump'\n") parser = MyParser(usage="Usage: regression_read.py -l [options]", epilog=examples) parser.add_option('-l', '--load-tt', dest='load_tt', - help='load test_table.dump from file', default=None) + help='load TestTable() from file', default=None) (options, args) = parser.parse_args() - + if (options.load_tt == None): + parser.print_help() + exit(0) + tt = read_test_table(options.load_tt) print tt print "\n\n ------------------------\n\n"