diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildgen/build-cleaner.py | 11 | ||||
-rwxr-xr-x | tools/buildgen/generate_projects.sh | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tools/buildgen/build-cleaner.py b/tools/buildgen/build-cleaner.py index 00821cc9cc..f9307360c3 100755 --- a/tools/buildgen/build-cleaner.py +++ b/tools/buildgen/build-cleaner.py @@ -6,6 +6,8 @@ import json import os import sys +TEST = (os.environ.get('TEST', 'false') == 'true') + _TOP_LEVEL_KEYS = ['settings', 'filegroups', 'libs', 'targets'] _VERSION_KEYS = ['major', 'minor', 'micro', 'build'] _ELEM_KEYS = [ @@ -51,6 +53,11 @@ for filename in sys.argv[1:]: lines = [] for line in output.splitlines(): lines.append(line.rstrip() + '\n') - with open(filename, 'w') as f: - f.write(''.join(lines)) + output = ''.join(lines) + if TEST: + with open(filename) as f: + assert f.read() == output + else: + with open(filename, 'w') as f: + f.write(output) diff --git a/tools/buildgen/generate_projects.sh b/tools/buildgen/generate_projects.sh index c2e88f7793..2e0636fcbe 100755 --- a/tools/buildgen/generate_projects.sh +++ b/tools/buildgen/generate_projects.sh @@ -32,7 +32,7 @@ for dir in . ; do data=`for i in $json_files; do echo -n "-d $i "; done` if [ $TEST == true ] ; then actual_out=$out - out=`mktemp` + out=`mktemp /tmp/gentXXXXXX` fi $mako_renderer $plugins $data -o $out $file if [ $TEST == true ] ; then |