Two pass rc refactoring.
[aom.git] / all_builds.py
blob765086528ec97081072f89f932c61e0386cbbf41
1 #!/usr/bin/python
3 import subprocess
4 import sys
6 def RunCommand(command):
7 run = subprocess.Popen(command, shell=True)
8 output = run.communicate()
9 if run.returncode:
10 print "Non-zero return code: " + str(run.returncode) + " => exiting!"
11 sys.exit(1)
13 def list_of_experiments():
14 experiments = []
15 configure_file = open("configure")
16 list_start = False
17 for line in configure_file.read().split("\n"):
18 if line == 'EXPERIMENT_LIST="':
19 list_start = True
20 elif line == '"':
21 list_start = False
22 elif list_start:
23 currently_broken = ["csm"]
24 experiment = line[4:]
25 if experiment not in currently_broken:
26 experiments.append(experiment)
27 return experiments
29 def main():
30 base_command = "./configure --enable-internal-stats"
31 test_build(base_command)
32 for experiment_name in list_of_experiments():
33 test_build("%s --enable-experimental --enable-%s" % (base_command,
34 experiment_name))
36 def test_build(configure_command):
37 print "\033[34m\033[47mTesting %s\033[0m" % (configure_command)
38 RunCommand(configure_command)
39 RunCommand("make clean")
40 RunCommand("make")
42 if __name__ == "__main__":
43 main()