diff options
author | William Blevins <wblevins001@gmail.com> | 2016-10-03 06:08:04 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-10-03 06:08:04 (GMT) |
commit | 5587089a661a520a32c353ea886939cd63a0636a (patch) | |
tree | 22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/CC | |
parent | 6dd3fd8b838d18d65edd6e7adabf3a363437f8a9 (diff) | |
download | SCons-5587089a661a520a32c353ea886939cd63a0636a.zip SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.gz SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.bz2 |
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/CC')
-rw-r--r-- | test/CC/CCCOM.py | 9 | ||||
-rw-r--r-- | test/CC/CCCOMSTR.py | 9 | ||||
-rw-r--r-- | test/CC/SHCCCOM.py | 8 | ||||
-rw-r--r-- | test/CC/SHCCCOMSTR.py | 7 | ||||
-rw-r--r-- | test/CC/shared-fixture/.exclude_tests | 1 | ||||
-rw-r--r-- | test/CC/shared-fixture/mycc.py | 6 | ||||
-rw-r--r-- | test/CC/shared-fixture/test1.c | 2 |
7 files changed, 16 insertions, 26 deletions
diff --git a/test/CC/CCCOM.py b/test/CC/CCCOM.py index f930ecd..291dad8 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 0be9971..9977243 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 689b6e7..5326c01 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 0983a67..75f3aad 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 3f2bc0f..0000000 --- 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 b96c31c..0000000 --- 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 9c281d7..0000000 --- a/test/CC/shared-fixture/test1.c +++ /dev/null @@ -1,2 +0,0 @@ -test1.c -/*cc*/ |