run_test_cmd += ' --ignore-failed-imports' if options.dry_run: run_test_cmd += ' --dry-run' if options.out2stdout: print("Executing command '{0}'".format(run_test_cmd)) p = subprocess.Popen(run_test_cmd, shell=True) # no PIPE: print on screen for debugging p.wait() else: p = subprocess.Popen(run_test_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) out, err = p.communicate() # waits for p to finish testsRunLog = open(testRunLogPath, 'w') if out: testsRunLog.write(str(out)) testsRunLog.close() testsRunErr = open(testRunErrPath, 'w') if err: testsRunErr.write(str(err)) testsRunErr.close() if p.returncode != 0: failure(installer) except Exception as exc: scriptfailure(str(exc), installer) except: failure(installer) # Test run completed successfully stop(installer)
log("Running system tests. Log files are: logs/testsRun.log and logs/testsRun.err") try: # Pick the correct Mantid along with the bundled python on windows run_test_cmd = "%s %s/runSystemTests.py --loglevel=%s --mantidpath=%s" % (installer.python_cmd, os.path.dirname(os.path.realpath(__file__)), log_level, mantidPlotDir) if test_regex is not None: run_test_cmd += " -R " + test_regex if out2stdout: p = subprocess.Popen(run_test_cmd, shell=True) # no PIPE: print on screen for debugging p.wait() else: p = subprocess.Popen(run_test_cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True) out,err = p.communicate() # waits for p to finish testsRunLog = open(testRunLogPath,'w') if out: testsRunLog.write(out) testsRunLog.close() testsRunErr = open(testRunErrPath,'w') if err: testsRunErr.write(err) testsRunErr.close() if p.returncode != 0: failure(installer) except Exception, exc: scriptfailure(str(exc),installer) except: failure(installer) # Test run completed successfully stop(installer)