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)
commit3a9ac1951af770bda262a192a76fa427e291678a (patch)
treefb5b88871dd97131d6d02e29e2b26422d5d0e4ee /test
parent79c393d899d7cc8cacac9d8de4aa2689b4f8a9d9 (diff)
downloadSCons-3a9ac1951af770bda262a192a76fa427e291678a.zip
SCons-3a9ac1951af770bda262a192a76fa427e291678a.tar.gz
SCons-3a9ac1951af770bda262a192a76fa427e291678a.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")