Improved run_CI_tests.py and include the compile_all call directly in the python script.
If compile_all tool supports -keep ... let's use it. (recent addition)
This commit is contained in:
@@ -43,17 +43,18 @@ def report_failure(msg, a_code=2):
|
|||||||
def eval_cmd(cmd):
|
def eval_cmd(cmd):
|
||||||
# print cmd
|
# print cmd
|
||||||
res = subprocess.call (cmd, shell=True)
|
res = subprocess.call (cmd, shell=True)
|
||||||
if res < 0:
|
if res != 0:
|
||||||
report_failure ("Failed running: %s" % (cmd), 2)
|
report_failure ("Failed running: %s (returncode=%s)" % (cmd, res), 2)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def eval_cmd_output(cmd):
|
def eval_cmd_output(cmd, ignore_error=False):
|
||||||
# print cmd
|
# print cmd
|
||||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
if p:
|
if p:
|
||||||
return p.communicate()[0]
|
return p.communicate()[0]
|
||||||
else:
|
else:
|
||||||
report_failure ("Failed running: %s" % (cmd), 2)
|
if not ignore_error:
|
||||||
|
report_failure ("Failed running: %s" % (cmd), 2)
|
||||||
|
|
||||||
def rm_dir(d):
|
def rm_dir(d):
|
||||||
if os.path.isdir(d):
|
if os.path.isdir(d):
|
||||||
@@ -65,7 +66,17 @@ def runTestForProject(where):
|
|||||||
|
|
||||||
os.chdir(where)
|
os.chdir(where)
|
||||||
# First we have to remove old compilation
|
# First we have to remove old compilation
|
||||||
clobber = (len(sys.argv) >= 2 and sys.argv[1] == "-clobber") or (last_build_had_failure())
|
clobber = last_build_had_failure()
|
||||||
|
keep_all = True
|
||||||
|
for a in sys.argv:
|
||||||
|
if a == "-clobber":
|
||||||
|
clobber = True
|
||||||
|
if a == "-keep":
|
||||||
|
keep_all = True
|
||||||
|
if a == "-forget":
|
||||||
|
keep_all = False
|
||||||
|
|
||||||
|
# clobber = (len(sys.argv) >= 2 and sys.argv[1] == "-clobber") or (last_build_had_failure())
|
||||||
if clobber:
|
if clobber:
|
||||||
reset_last_run_CI_tests_failed()
|
reset_last_run_CI_tests_failed()
|
||||||
print "## Cleaning previous tests"
|
print "## Cleaning previous tests"
|
||||||
@@ -78,11 +89,17 @@ def runTestForProject(where):
|
|||||||
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
print "# Launch check_compilations"
|
print "# check compile_all tests"
|
||||||
if sys.platform == 'win32':
|
if not os.path.exists(os.path.join ("tests", "temp")):
|
||||||
cmd = "tests\\check_compilations.bat"
|
os.makedirs (os.path.join ("tests", "temp"))
|
||||||
else:
|
|
||||||
cmd = "tests//check_compilations.sh"
|
|
||||||
|
cmd = "compile_all -ecb -melt -eifgen %s -ignore %s " % (os.path.join ("tests", "temp"), os.path.join ("tests", "compile_all.ini"))
|
||||||
|
if keep_all:
|
||||||
|
res_output = eval_cmd_output("compile_all -l NoWhereJustToTestUsage -keep", True)
|
||||||
|
if res_output.find("Unreconized switch '-keep'") == -1:
|
||||||
|
cmd = "%s -keep passed" % (cmd) # forget about failed one .. we'll try again next time
|
||||||
|
|
||||||
if clobber:
|
if clobber:
|
||||||
cmd = "%s -clean" % (cmd)
|
cmd = "%s -clean" % (cmd)
|
||||||
res_output = eval_cmd_output(cmd)
|
res_output = eval_cmd_output(cmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user