diff options
author | William Blevins <wblevins001@gmail.com> | 2016-10-03 02:08:04 -0400 |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-10-03 02:08:04 -0400 |
commit | 19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8 (patch) | |
tree | 22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/fixture | |
parent | fd8260b1ea1ec158bcabc8030d3a47eadf7c1255 (diff) | |
download | scons-19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8.tar.gz |
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/fixture')
-rw-r--r-- | test/fixture/mycompile.py | 8 | ||||
-rw-r--r-- | test/fixture/myrewrite.py | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/fixture/mycompile.py b/test/fixture/mycompile.py new file mode 100644 index 00000000..555c2c8f --- /dev/null +++ b/test/fixture/mycompile.py @@ -0,0 +1,8 @@ +import sys +line = ('/*' + sys.argv[1] + '*/\n').encode() +outfile = open(sys.argv[2], 'wb') +for f in sys.argv[3:]: + infile = open(f, 'rb') + for l in [l for l in infile.readlines() if l != line]: + outfile.write(l) +sys.exit(0) diff --git a/test/fixture/myrewrite.py b/test/fixture/myrewrite.py new file mode 100644 index 00000000..40bf830c --- /dev/null +++ b/test/fixture/myrewrite.py @@ -0,0 +1,7 @@ +import sys +line = ('/*' + sys.argv[1] + '*/\n').encode() +lines = open(sys.argv[2], 'rb').readlines() +outfile = open(sys.argv[2], 'wb') +for l in [l for l in lines if l != line]: + outfile.write(l) +sys.exit(0) |