param: rename iminreceivefile -> min_receivefile_size
[Samba.git] / script / compare_cc_results.py
blobb8ed3994c040dd2d3786e386f5808fb70497d609
1 #!/usr/bin/env python
4 # Compare the results of native and cross-compiled configure tests
7 import sys
8 import difflib
10 exceptions = ['BUILD_DIRECTORY', 'CROSS_COMPILE', 'CROSS_ANSWERS',
11 'CROSS_EXECUTE', 'SELFTEST_PREFIX']
13 base_lines = list()
14 base_fname = ''
16 found_diff = False
18 for fname in sys.argv[1:]:
19 lines = list()
20 f = open(fname, 'r')
21 for line in f:
22 if len(line.split('=', 1)) == 2:
23 key = line.split('=', 1)[0].strip()
24 if key in exceptions:
25 continue
26 lines.append(line)
27 f.close()
28 if base_fname:
29 diff = list(difflib.unified_diff(base_lines,lines,base_fname,fname))
30 if diff:
31 print 'configuration files %s and %s do not match' % (base_fname, fname)
32 for l in diff:
33 sys.stdout.write(l)
34 found_diff = True
35 else:
36 base_fname = fname
37 base_lines = lines
39 if found_diff:
40 sys.exit(1)