summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-03-24 19:42:09 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2018-03-24 19:42:09 (GMT)
commit0458fbeaddae9f4bb1e977ccd642a201c7b46c5f (patch)
treee4d0c329700b243fa8d1b64e0c9a587a30e17f7e /test
parente7b15e2288afa13cab09943bb2a5fa723cfa789e (diff)
downloadSCons-0458fbeaddae9f4bb1e977ccd642a201c7b46c5f.zip
SCons-0458fbeaddae9f4bb1e977ccd642a201c7b46c5f.tar.gz
SCons-0458fbeaddae9f4bb1e977ccd642a201c7b46c5f.tar.bz2
fix #3106 MSVC handling MSVC_BATCH with targetdir which requires escaping.
Diffstat (limited to 'test')
-rw-r--r--test/MSVC/MSVC_BATCH-spaces-targetdir.py11
-rw-r--r--test/MSVC/MSVC_BATCH-spaces-targetdir/SConstruct8
-rw-r--r--test/MSVC/MSVC_BATCH-spaces-targetdir/src/a.c15
-rw-r--r--test/MSVC/MSVC_BATCH-spaces-targetdir/src/b.c5
-rw-r--r--test/MSVC/MSVC_BATCH-spaces-targetdir/src/c.c5
-rw-r--r--test/MSVC/batch.py7
6 files changed, 48 insertions, 3 deletions
diff --git a/test/MSVC/MSVC_BATCH-spaces-targetdir.py b/test/MSVC/MSVC_BATCH-spaces-targetdir.py
new file mode 100644
index 0000000..298e10e
--- /dev/null
+++ b/test/MSVC/MSVC_BATCH-spaces-targetdir.py
@@ -0,0 +1,11 @@
+import TestSCons
+
+
+
+test = TestSCons.TestSCons()
+
+test.skip_if_not_msvc()
+
+
+test.dir_fixture('MSVC_BATCH-spaces-targetdir')
+test.run() \ No newline at end of file
diff --git a/test/MSVC/MSVC_BATCH-spaces-targetdir/SConstruct b/test/MSVC/MSVC_BATCH-spaces-targetdir/SConstruct
new file mode 100644
index 0000000..da8002b
--- /dev/null
+++ b/test/MSVC/MSVC_BATCH-spaces-targetdir/SConstruct
@@ -0,0 +1,8 @@
+import os.path
+
+env=Environment(MSVC_BATCH=True)
+
+td='tar ge tdir'
+VariantDir(td,'src')
+env.Program(os.path.join(td,'test_program'),
+ [os.path.join(td,a) for a in ['a.c','b.c','c.c']])
diff --git a/test/MSVC/MSVC_BATCH-spaces-targetdir/src/a.c b/test/MSVC/MSVC_BATCH-spaces-targetdir/src/a.c
new file mode 100644
index 0000000..1741de8
--- /dev/null
+++ b/test/MSVC/MSVC_BATCH-spaces-targetdir/src/a.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+extern void myfuncb();
+extern void myfuncc();
+
+
+void myfunca() {
+ printf("myfunca\n");
+}
+
+int main(int argc, char *argv[]) {
+ myfunca();
+ myfuncb();
+ myfuncc();
+} \ No newline at end of file
diff --git a/test/MSVC/MSVC_BATCH-spaces-targetdir/src/b.c b/test/MSVC/MSVC_BATCH-spaces-targetdir/src/b.c
new file mode 100644
index 0000000..e03c5d0
--- /dev/null
+++ b/test/MSVC/MSVC_BATCH-spaces-targetdir/src/b.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void myfuncb() {
+ printf("myfuncb\n");
+} \ No newline at end of file
diff --git a/test/MSVC/MSVC_BATCH-spaces-targetdir/src/c.c b/test/MSVC/MSVC_BATCH-spaces-targetdir/src/c.c
new file mode 100644
index 0000000..1c262d3
--- /dev/null
+++ b/test/MSVC/MSVC_BATCH-spaces-targetdir/src/c.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void myfuncc() {
+ printf("myfuncc\n");
+} \ No newline at end of file
diff --git a/test/MSVC/batch.py b/test/MSVC/batch.py
index 8b7945b..af5b43e 100644
--- a/test/MSVC/batch.py
+++ b/test/MSVC/batch.py
@@ -72,6 +72,7 @@ for infile in sys.argv[2:]:
""")
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
cccom = r'%(_python_)s fake_cl.py $_MSVC_OUTPUT_FLAG $CHANGED_SOURCES'
linkcom = r'%(_python_)s fake_link.py ${TARGET.windows} $SOURCES'
env = Environment(tools=['msvc', 'mslink'],
@@ -96,7 +97,7 @@ test.run(arguments = 'MSVC_BATCH=1 .')
test.must_match('prog.exe', "prog.c\nf1.c\nf2.c\n", mode='r')
test.must_match('fake_cl.log', """\
-/Fo. prog.c f1.c f2.c
+/Fo.\\ prog.c f1.c f2.c
""", mode='r')
test.up_to_date(options = 'MSVC_BATCH=1', arguments = '.')
@@ -109,8 +110,8 @@ test.run(arguments = 'MSVC_BATCH=1 .')
test.must_match('prog.exe', "prog.c\nf1.c 2\nf2.c\n", mode='r')
test.must_match('fake_cl.log', """\
-/Fo. prog.c f1.c f2.c
-/Fo. f1.c
+/Fo.\\ prog.c f1.c f2.c
+/Fo.\\ f1.c
""", mode='r')
test.up_to_date(options = 'MSVC_BATCH=1', arguments = '.')