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/YACC | |
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/YACC')
-rw-r--r-- | test/YACC/YACCCOM-fixture/.exclude_tests | 1 | ||||
-rw-r--r-- | test/YACC/YACCCOM-fixture/myyacc.py | 7 | ||||
-rw-r--r-- | test/YACC/YACCCOM.py | 10 | ||||
-rw-r--r-- | test/YACC/YACCCOMSTR.py | 10 | ||||
-rw-r--r-- | test/YACC/shared-fixture/.exclude_tests | 1 | ||||
-rw-r--r-- | test/YACC/shared-fixture/aaa.y | 2 | ||||
-rw-r--r-- | test/YACC/shared-fixture/bbb.yacc | 2 |
7 files changed, 10 insertions, 23 deletions
diff --git a/test/YACC/YACCCOM-fixture/.exclude_tests b/test/YACC/YACCCOM-fixture/.exclude_tests deleted file mode 100644 index f12c4d0a..00000000 --- a/test/YACC/YACCCOM-fixture/.exclude_tests +++ /dev/null @@ -1 +0,0 @@ -myyacc.py diff --git a/test/YACC/YACCCOM-fixture/myyacc.py b/test/YACC/YACCCOM-fixture/myyacc.py deleted file mode 100644 index 15028007..00000000 --- a/test/YACC/YACCCOM-fixture/myyacc.py +++ /dev/null @@ -1,7 +0,0 @@ -import sys -outfile = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != b'/*yacc*/\n']: - outfile.write(l) -sys.exit(0) diff --git a/test/YACC/YACCCOM.py b/test/YACC/YACCCOM.py index 70ffa72b..e9fb47fb 100644 --- a/test/YACC/YACCCOM.py +++ b/test/YACC/YACCCOM.py @@ -34,23 +34,23 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.dir_fixture('shared-fixture') -test.dir_fixture('YACCCOM-fixture') +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(tools=['default', 'yacc'], - YACCCOM = r'%(_python_)s myyacc.py $TARGET $SOURCES') + YACCCOM = r'%(_python_)s mycompile.py yacc $TARGET $SOURCES') env.CFile(target = 'aaa', source = 'aaa.y') env.CFile(target = 'bbb', source = 'bbb.yacc') """ % locals()) +test.write('aaa.y', 'aaa.y\n/*yacc*/\n') +test.write('bbb.yacc', 'bbb.yacc\n/*yacc*/\n') + test.run(arguments = '.') test.must_match('aaa.c', "aaa.y\n") test.must_match('bbb.c', "bbb.yacc\n") - - test.pass_test() # Local Variables: diff --git a/test/YACC/YACCCOMSTR.py b/test/YACC/YACCCOMSTR.py index 344b7154..bded5600 100644 --- a/test/YACC/YACCCOMSTR.py +++ b/test/YACC/YACCCOMSTR.py @@ -35,17 +35,19 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.dir_fixture('shared-fixture') -test.dir_fixture('YACCCOM-fixture') +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(tools=['default', 'yacc'], - YACCCOM = r'%(_python_)s myyacc.py $TARGET $SOURCES', + YACCCOM = r'%(_python_)s mycompile.py yacc $TARGET $SOURCES', YACCCOMSTR = 'Yaccing $TARGET from $SOURCE') env.CFile(target = 'aaa', source = 'aaa.y') env.CFile(target = 'bbb', source = 'bbb.yacc') """ % locals()) +test.write('aaa.y', 'aaa.y\n/*yacc*/\n') +test.write('bbb.yacc', 'bbb.yacc\n/*yacc*/\n') + test.run(stdout = test.wrap_stdout("""\ Yaccing aaa.c from aaa.y Yaccing bbb.c from bbb.yacc @@ -54,8 +56,6 @@ Yaccing bbb.c from bbb.yacc test.must_match('aaa.c', "aaa.y\n") test.must_match('bbb.c', "bbb.yacc\n") - - test.pass_test() # Local Variables: diff --git a/test/YACC/shared-fixture/.exclude_tests b/test/YACC/shared-fixture/.exclude_tests deleted file mode 100644 index f12c4d0a..00000000 --- a/test/YACC/shared-fixture/.exclude_tests +++ /dev/null @@ -1 +0,0 @@ -myyacc.py diff --git a/test/YACC/shared-fixture/aaa.y b/test/YACC/shared-fixture/aaa.y deleted file mode 100644 index f7f4cc79..00000000 --- a/test/YACC/shared-fixture/aaa.y +++ /dev/null @@ -1,2 +0,0 @@ -aaa.y -/*yacc*/ diff --git a/test/YACC/shared-fixture/bbb.yacc b/test/YACC/shared-fixture/bbb.yacc deleted file mode 100644 index b3c856fd..00000000 --- a/test/YACC/shared-fixture/bbb.yacc +++ /dev/null @@ -1,2 +0,0 @@ -bbb.yacc -/*yacc*/ |