summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-10-22 22:22:44 (GMT)
committerSteven Knight <knight@baldmt.com>2004-10-22 22:22:44 (GMT)
commitbde4f62650d3c44231830da55e1b4a348df2df0e (patch)
treefb5b88871dd97131d6d02e29e2b26422d5d0e4ee /test
parentd995ba35925c7814cbb87d84d94aa608088b0839 (diff)
downloadSCons-bde4f62650d3c44231830da55e1b4a348df2df0e.zip
SCons-bde4f62650d3c44231830da55e1b4a348df2df0e.tar.gz
SCons-bde4f62650d3c44231830da55e1b4a348df2df0e.tar.bz2
Support .lex and .yacc file suffixes. (Matthew Doar)
Diffstat (limited to 'test')
-rw-r--r--test/LEX.py15
-rw-r--r--test/YACC.py15
2 files changed, 28 insertions, 2 deletions
diff --git a/test/LEX.py b/test/LEX.py
index 90549bd..3f596fb 100644
--- a/test/LEX.py
+++ b/test/LEX.py
@@ -51,6 +51,7 @@ sys.exit(0)
test.write('SConstruct', """
env = Environment(LEX = r'%s mylex.py', tools=['default', 'lex'])
env.Program(target = 'aaa', source = 'aaa.l')
+env.Program(target = 'bbb', source = 'bbb.lex')
""" % python)
test.write('aaa.l', r"""
@@ -64,9 +65,21 @@ main(int argc, char *argv[])
}
""")
-test.run(arguments = 'aaa' + _exe, stderr = None)
+test.write('bbb.lex', r"""
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("LEX\n");
+ printf("bbb.lex\n");
+ exit (0);
+}
+""")
+
+test.run(arguments = '.', stderr = None)
test.run(program = test.workpath('aaa' + _exe), stdout = "mylex.py\naaa.l\n")
+test.run(program = test.workpath('bbb' + _exe), stdout = "mylex.py\nbbb.lex\n")
diff --git a/test/YACC.py b/test/YACC.py
index 13203ff..062e4bc 100644
--- a/test/YACC.py
+++ b/test/YACC.py
@@ -66,6 +66,7 @@ sys.exit(0)
test.write('SConstruct', """
env = Environment(YACC = r'%s myyacc.py', tools=['default', 'yacc'])
env.Program(target = 'aaa', source = 'aaa.y')
+env.Program(target = 'bbb', source = 'bbb.yacc')
""" % python)
test.write('aaa.y', r"""
@@ -79,9 +80,21 @@ main(int argc, char *argv[])
}
""")
-test.run(arguments = 'aaa' + _exe, stderr = None)
+test.write('bbb.yacc', r"""
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("YACC\n");
+ printf("bbb.yacc\n");
+ exit (0);
+}
+""")
+
+test.run(arguments = '.', stderr = None)
test.run(program = test.workpath('aaa' + _exe), stdout = "myyacc.py\naaa.y\n")
+test.run(program = test.workpath('bbb' + _exe), stdout = "myyacc.py\nbbb.yacc\n")