diff options
author | Jack Lloyd <[email protected]> | 2017-09-29 10:31:05 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-29 10:31:05 -0400 |
commit | 1e72c64886c71ece2ffbda80d3863d12965cc01b (patch) | |
tree | a9017d9a74864d628f34d79a750ae35c6b043ea0 /src/scripts/build_tests.py | |
parent | 2860028d21d93bbbf33966e7e511a9e19da770ca (diff) |
More futzing with the build em all script
[ci skip]
Diffstat (limited to 'src/scripts/build_tests.py')
-rwxr-xr-x | src/scripts/build_tests.py | 67 |
1 files changed, 36 insertions, 31 deletions
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) |