summaryrefslogtreecommitdiff
path: root/test/CC
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/CC
parentfd8260b1ea1ec158bcabc8030d3a47eadf7c1255 (diff)
downloadscons-19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8.tar.gz
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/CC')
-rw-r--r--test/CC/CCCOM.py9
-rw-r--r--test/CC/CCCOMSTR.py9
-rw-r--r--test/CC/SHCCCOM.py8
-rw-r--r--test/CC/SHCCCOMSTR.py7
-rw-r--r--test/CC/shared-fixture/.exclude_tests1
-rw-r--r--test/CC/shared-fixture/mycc.py6
-rw-r--r--test/CC/shared-fixture/test1.c2
7 files changed, 16 insertions, 26 deletions
diff --git a/test/CC/CCCOM.py b/test/CC/CCCOM.py
index f930ecda..291dad86 100644
--- a/test/CC/CCCOM.py
+++ b/test/CC/CCCOM.py
@@ -33,11 +33,10 @@ import os
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-test.dir_fixture('shared-fixture')
+test.file_fixture('mycompile.py')
if os.path.normcase('.c') == os.path.normcase('.C'):
alt_c_suffix = '.C'
@@ -45,12 +44,14 @@ else:
alt_c_suffix = '.c'
test.write('SConstruct', """
-env = Environment(CCCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(CCCOM = r'%(_python_)s mycompile.py cc $TARGET $SOURCE',
OBJSUFFIX='.obj')
env.Object(target = 'test1', source = 'test1.c')
env.Object(target = 'test2', source = 'test2%(alt_c_suffix)s')
""" % locals())
+test.write('test1.c', 'test1.c\n/*cc*/\n')
+
test.write('test2'+alt_c_suffix, """\
test2.C
/*cc*/
@@ -61,8 +62,6 @@ test.run()
test.must_match('test1.obj', "test1.c\n")
test.must_match('test2.obj', "test2.C\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/CC/CCCOMSTR.py b/test/CC/CCCOMSTR.py
index 0be9971b..99772438 100644
--- a/test/CC/CCCOMSTR.py
+++ b/test/CC/CCCOMSTR.py
@@ -34,11 +34,10 @@ import os
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-test.dir_fixture('shared-fixture')
+test.file_fixture('mycompile.py')
if os.path.normcase('.c') == os.path.normcase('.C'):
alt_c_suffix = '.C'
@@ -46,13 +45,15 @@ else:
alt_c_suffix = '.c'
test.write('SConstruct', """
-env = Environment(CCCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(CCCOM = r'%(_python_)s mycompile.py cc $TARGET $SOURCE',
CCCOMSTR = 'Building $TARGET from $SOURCE',
OBJSUFFIX='.obj')
env.Object(target = 'test1', source = 'test1.c')
env.Object(target = 'test2', source = 'test2%(alt_c_suffix)s')
""" % locals())
+test.write('test1.c', 'test1.c\n/*cc*/\n')
+
test.write('test2'+alt_c_suffix, """\
test2.C
/*cc*/
@@ -66,8 +67,6 @@ Building test2.obj from test2%(alt_c_suffix)s
test.must_match('test1.obj', "test1.c\n")
test.must_match('test2.obj', "test2.C\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/CC/SHCCCOM.py b/test/CC/SHCCCOM.py
index 689b6e77..5326c01e 100644
--- a/test/CC/SHCCCOM.py
+++ b/test/CC/SHCCCOM.py
@@ -36,7 +36,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-test.dir_fixture('shared-fixture')
+test.file_fixture('mycompile.py')
if os.path.normcase('.c') == os.path.normcase('.C'):
alt_c_suffix = '.C'
@@ -44,13 +44,15 @@ else:
alt_c_suffix = '.c'
test.write('SConstruct', """
-env = Environment(SHCCCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(SHCCCOM = r'%(_python_)s mycompile.py cc $TARGET $SOURCE',
SHOBJPREFIX='',
SHOBJSUFFIX='.obj')
env.SharedObject(target = 'test1', source = 'test1.c')
env.SharedObject(target = 'test2', source = 'test2%(alt_c_suffix)s')
""" % locals())
+test.write('test1.c', 'test1.c\n/*cc*/\n')
+
test.write('test2'+alt_c_suffix, """\
test2.C
/*cc*/
@@ -61,8 +63,6 @@ test.run()
test.must_match('test1.obj', "test1.c\n")
test.must_match('test2.obj', "test2.C\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/CC/SHCCCOMSTR.py b/test/CC/SHCCCOMSTR.py
index 0983a67d..75f3aadc 100644
--- a/test/CC/SHCCCOMSTR.py
+++ b/test/CC/SHCCCOMSTR.py
@@ -34,11 +34,10 @@ import os
import TestSCons
_python_ = TestSCons._python_
-_exe = TestSCons._exe
test = TestSCons.TestSCons()
-test.dir_fixture('shared-fixture')
+test.file_fixture('mycompile.py')
if os.path.normcase('.c') == os.path.normcase('.C'):
alt_c_suffix = '.C'
@@ -46,7 +45,7 @@ else:
alt_c_suffix = '.c'
test.write('SConstruct', """
-env = Environment(SHCCCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+env = Environment(SHCCCOM = r'%(_python_)s mycompile.py cc $TARGET $SOURCE',
SHCCCOMSTR = 'Building $TARGET from $SOURCE',
SHOBJPREFIX='',
SHOBJSUFFIX='.obj')
@@ -54,6 +53,8 @@ env.SharedObject(target = 'test1', source = 'test1.c')
env.SharedObject(target = 'test2', source = 'test2%(alt_c_suffix)s')
""" % locals())
+test.write('test1.c', 'test1.c\n/*cc*/\n')
+
test.write('test2'+alt_c_suffix, """\
test2.C
/*cc*/
diff --git a/test/CC/shared-fixture/.exclude_tests b/test/CC/shared-fixture/.exclude_tests
deleted file mode 100644
index 3f2bc0f0..00000000
--- a/test/CC/shared-fixture/.exclude_tests
+++ /dev/null
@@ -1 +0,0 @@
-mycc.py
diff --git a/test/CC/shared-fixture/mycc.py b/test/CC/shared-fixture/mycc.py
deleted file mode 100644
index b96c31c6..00000000
--- a/test/CC/shared-fixture/mycc.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l[:6] != b'/*cc*/']:
- outfile.write(l)
-sys.exit(0)
diff --git a/test/CC/shared-fixture/test1.c b/test/CC/shared-fixture/test1.c
deleted file mode 100644
index 9c281d7a..00000000
--- a/test/CC/shared-fixture/test1.c
+++ /dev/null
@@ -1,2 +0,0 @@
-test1.c
-/*cc*/