summaryrefslogtreecommitdiff
path: root/test/YACC
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-10-03 02:08:04 -0400
committerWilliam Blevins <wblevins001@gmail.com>2016-10-03 02:08:04 -0400
commit19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8 (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/YACC
parentfd8260b1ea1ec158bcabc8030d3a47eadf7c1255 (diff)
downloadscons-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_tests1
-rw-r--r--test/YACC/YACCCOM-fixture/myyacc.py7
-rw-r--r--test/YACC/YACCCOM.py10
-rw-r--r--test/YACC/YACCCOMSTR.py10
-rw-r--r--test/YACC/shared-fixture/.exclude_tests1
-rw-r--r--test/YACC/shared-fixture/aaa.y2
-rw-r--r--test/YACC/shared-fixture/bbb.yacc2
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*/