From 1e72c64886c71ece2ffbda80d3863d12965cc01b Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 29 Sep 2017 10:31:05 -0400 Subject: More futzing with the build em all script [ci skip] --- src/scripts/build_tests.py | 67 +++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 31 deletions(-) (limited to 'src/scripts/build_tests.py') diff --git a/src/scripts/build_tests.py b/src/scripts/build_tests.py index 875b3d111..c83eb7cdd 100755 --- a/src/scripts/build_tests.py +++ b/src/scripts/build_tests.py @@ -36,42 +36,40 @@ def get_concurrency(): except ImportError: return def_concurrency -def run_test_build(configure_py, modules, include): - cmdline = [configure_py] +def try_to_run(cmdline): + print("Running %s ... " % (' '.join(cmdline))) + cmd = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdout, stderr) = cmd.communicate() + + if cmd.returncode != 0: + print("FAILURE") + print(stdout.decode('ascii')) + print(stderr.decode('ascii')) + + sys.stdout.flush() + + return (cmd.returncode == 0) + +def run_test_build(configure_py, modules, include, run_tests = False): + config = [configure_py] if include: - cmdline.append('--minimized') + config.append('--minimized') if modules: - cmdline.append('--enable-modules=' + ','.join(modules)) + config.append('--enable-modules=' + ','.join(modules)) else: - cmdline.append('--disable-modules=' + ','.join(modules)) + config.append('--disable-modules=' + ','.join(modules)) - print("Testing", cmdline) - configure = subprocess.Popen(cmdline, stdout=subprocess.PIPE) - configure.communicate() + if try_to_run(config) is False: + return False - if configure.returncode != 0: - raise Exception("Running %s failed" % (' '.join(cmdline))) + if try_to_run(['make', '-j', str(get_concurrency())]) is False: + return False - make = subprocess.Popen(['make', '-j', str(get_concurrency())], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (stdout, stderr) = make.communicate() + if run_tests is False: + return True - if make.returncode != 0: - print("Build failed:") - print(stdout.decode('ascii')) - print(stderr.decode('ascii')) - - tests = subprocess.Popen(['./botan-test'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - (stdout, stderr) = tests.communicate() - if tests.returncode != 0: - print("Tests failed:") - print(stdout.decode('ascii')) - print(stderr.decode('ascii')) - - sys.stdout.flush() + return try_to_run(['./botan-test']) def main(args): @@ -80,15 +78,22 @@ def main(args): configure_py = './configure.py' modules = get_module_list(configure_py) + cant_disable = ['block', 'hash', 'hex', 'mac', 'modes', 'rng', 'stream', 'utils'] + always_include = ['sha2_32', 'sha2_64', 'aes'] + for module in sorted(modules): - extra = ['sha2_32', 'sha2_64', 'aes'] - if module in extra: + continue + if module in always_include or module in cant_disable: continue # already testing it + + extra = [] if module == 'auto_rng': extra.append('dev_random') - run_test_build(configure_py, [module] + extra, True) + run_test_build(configure_py, [module] + always_include + extra, True) for module in sorted(modules): + if module in cant_disable or module in always_include: + continue run_test_build(configure_py, [module], False) -- cgit v1.2.3