From 29604790957ccd8ce2ad2cad9d3b7593dc7e7a13 Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskij Date: Fri, 29 Mar 2013 18:30:23 +0400 Subject: [PATCH 1/2] Issue --- run_tests.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/run_tests.py b/run_tests.py index ea53b432..06ba2c5f 100755 --- a/run_tests.py +++ b/run_tests.py @@ -6,6 +6,7 @@ from optparse import OptionParser import multiprocessing from ctypes import c_int import os +import os.path import sys import glob import re @@ -88,6 +89,20 @@ if options.compiler_exe == None: else: options.compiler_exe = "g++" +# checks the required compiler otherwise prints an error message +PATH_dir = string.split(os.getenv("PATH"), os.pathsep) +compiler_exists = False + +for counter in PATH_dir: + if os.path.exists(counter + os.sep + options.compiler_exe): + compiler_exists = True + break + +if not compiler_exists: + sys.stderr.write("Fatal error: missing the required compiler: %s \n" % + options.compiler_exe) + sys.exit() + def fix_windows_paths(files): ret = [ ] for fn in files: From 9e0425e824ec769672c3e850b4c798996bbfaa5a Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskij Date: Fri, 29 Mar 2013 18:42:02 +0400 Subject: [PATCH 2/2] Checks the required compiler otherwise prints an error message and exits program --- run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.py b/run_tests.py index 06ba2c5f..6f9a682a 100755 --- a/run_tests.py +++ b/run_tests.py @@ -6,7 +6,6 @@ from optparse import OptionParser import multiprocessing from ctypes import c_int import os -import os.path import sys import glob import re @@ -17,6 +16,7 @@ import subprocess import shlex import platform import tempfile +import os.path # disable fancy error/warning printing with ANSI colors, so grepping for error # messages doesn't get confused