diff options
Diffstat (limited to 'test')
43 files changed, 123 insertions, 112 deletions
diff --git a/test/AS/AS.py b/test/AS/AS.py index 380afe3..56a1498 100644 --- a/test/AS/AS.py +++ b/test/AS/AS.py @@ -40,7 +40,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas.py')) +test.file_fixture(['fixture', 'myas.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py index 79fde8c..52f44af 100644 --- a/test/AS/ASFLAGS.py +++ b/test/AS/ASFLAGS.py @@ -35,7 +35,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas_args.py')) +test.file_fixture(['fixture', 'myas_args.py']) o = ' -x' o_c = ' -x -c' diff --git a/test/AS/ASPP.py b/test/AS/ASPP.py index 18c067f..64e1080 100644 --- a/test/AS/ASPP.py +++ b/test/AS/ASPP.py @@ -35,7 +35,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas.py')) +test.file_fixture(['fixture', 'myas.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/AS/ASPPFLAGS.py b/test/AS/ASPPFLAGS.py index 254a458..5dd9a38 100644 --- a/test/AS/ASPPFLAGS.py +++ b/test/AS/ASPPFLAGS.py @@ -35,7 +35,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myas_args.py')) +test.file_fixture(['fixture', 'myas_args.py']) o = ' -x' o_c = ' -x -c' diff --git a/test/CC/CCVERSION.py b/test/CC/CCVERSION.py index 20d8616..7e829f0 100644 --- a/test/CC/CCVERSION.py +++ b/test/CC/CCVERSION.py @@ -37,7 +37,7 @@ if sys.platform == 'win32': test.skip_test('CCVERSION not set with MSVC, skipping test.') test.dir_fixture('CCVERSION-fixture') -test.file_fixture(os.path.join('CC-fixture', 'foo.c')) +test.file_fixture(['CC-fixture', 'foo.c']) test.write('SConstruct', """ cc = Environment().Dictionary('CC') diff --git a/test/Fortran/F03.py b/test/Fortran/F03.py index 61688c3..989d878 100644 --- a/test/Fortran/F03.py +++ b/test/Fortran/F03.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F03FILESUFFIXES.py b/test/Fortran/F03FILESUFFIXES.py index 9f1a031..5620a2d 100644 --- a/test/Fortran/F03FILESUFFIXES.py +++ b/test/Fortran/F03FILESUFFIXES.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test default file suffix: .f90/.F90 for F90 test.write('SConstruct', """ diff --git a/test/Fortran/F03FILESUFFIXES2.py b/test/Fortran/F03FILESUFFIXES2.py index d84b089..6073aab 100644 --- a/test/Fortran/F03FILESUFFIXES2.py +++ b/test/Fortran/F03FILESUFFIXES2.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test non-default file suffix: .f/.F for F03 test.write('SConstruct', """ diff --git a/test/Fortran/F03FLAGS.py b/test/Fortran/F03FLAGS.py index a031005..54b8083 100644 --- a/test/Fortran/F03FLAGS.py +++ b/test/Fortran/F03FLAGS.py @@ -33,7 +33,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F08.py b/test/Fortran/F08.py index 3b08f6e..f60509c 100644 --- a/test/Fortran/F08.py +++ b/test/Fortran/F08.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F08FILESUFFIXES.py b/test/Fortran/F08FILESUFFIXES.py index 5b078b1..989d685 100644 --- a/test/Fortran/F08FILESUFFIXES.py +++ b/test/Fortran/F08FILESUFFIXES.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test default file suffix: .f90/.F90 for F90 test.write('SConstruct', """ diff --git a/test/Fortran/F08FILESUFFIXES2.py b/test/Fortran/F08FILESUFFIXES2.py index 955d64a..0d99225 100644 --- a/test/Fortran/F08FILESUFFIXES2.py +++ b/test/Fortran/F08FILESUFFIXES2.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test non-default file suffix: .f/.F for F08 test.write('SConstruct', """ diff --git a/test/Fortran/F08FLAGS.py b/test/Fortran/F08FLAGS.py index f91765b..015fb0b 100644 --- a/test/Fortran/F08FLAGS.py +++ b/test/Fortran/F08FLAGS.py @@ -33,7 +33,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F77.py b/test/Fortran/F77.py index cea0485..ed5d33f 100644 --- a/test/Fortran/F77.py +++ b/test/Fortran/F77.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F77FILESUFFIXES.py b/test/Fortran/F77FILESUFFIXES.py index 26cf30c..c289e10 100644 --- a/test/Fortran/F77FILESUFFIXES.py +++ b/test/Fortran/F77FILESUFFIXES.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test default file suffix: .f77/.F77 for F77 test.write('SConstruct', """ diff --git a/test/Fortran/F77FILESUFFIXES2.py b/test/Fortran/F77FILESUFFIXES2.py index 7a000fe..1f26012 100644 --- a/test/Fortran/F77FILESUFFIXES2.py +++ b/test/Fortran/F77FILESUFFIXES2.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test non-default file suffix: .f/.F for F77 test.write('SConstruct', """ diff --git a/test/Fortran/F77FLAGS.py b/test/Fortran/F77FLAGS.py index d4e6e8a..caf291d 100644 --- a/test/Fortran/F77FLAGS.py +++ b/test/Fortran/F77FLAGS.py @@ -33,7 +33,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F90.py b/test/Fortran/F90.py index 817a735..d76af07 100644 --- a/test/Fortran/F90.py +++ b/test/Fortran/F90.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F90FILESUFFIXES.py b/test/Fortran/F90FILESUFFIXES.py index a747570..d91c4c8 100644 --- a/test/Fortran/F90FILESUFFIXES.py +++ b/test/Fortran/F90FILESUFFIXES.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test default file suffix: .f90/.F90 for F90 test.write('SConstruct', """ diff --git a/test/Fortran/F90FILESUFFIXES2.py b/test/Fortran/F90FILESUFFIXES2.py index 111c42b..3efc52c 100644 --- a/test/Fortran/F90FILESUFFIXES2.py +++ b/test/Fortran/F90FILESUFFIXES2.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test non-default file suffix: .f/.F for F90 test.write('SConstruct', """ diff --git a/test/Fortran/F90FLAGS.py b/test/Fortran/F90FLAGS.py index 607ef60..f748e5d 100644 --- a/test/Fortran/F90FLAGS.py +++ b/test/Fortran/F90FLAGS.py @@ -34,7 +34,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F95.py b/test/Fortran/F95.py index 07d1dc3..8e6d0b9 100644 --- a/test/Fortran/F95.py +++ b/test/Fortran/F95.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/F95FILESUFFIXES.py b/test/Fortran/F95FILESUFFIXES.py index ac563cc..427c881 100644 --- a/test/Fortran/F95FILESUFFIXES.py +++ b/test/Fortran/F95FILESUFFIXES.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test default file suffix: .f90/.F90 for F90 test.write('SConstruct', """ diff --git a/test/Fortran/F95FILESUFFIXES2.py b/test/Fortran/F95FILESUFFIXES2.py index c6691e8..a0ee1cf 100644 --- a/test/Fortran/F95FILESUFFIXES2.py +++ b/test/Fortran/F95FILESUFFIXES2.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test non-default file suffix: .f/.F for F95 test.write('SConstruct', """ diff --git a/test/Fortran/F95FLAGS.py b/test/Fortran/F95FLAGS.py index dd542f1..203aee1 100644 --- a/test/Fortran/F95FLAGS.py +++ b/test/Fortran/F95FLAGS.py @@ -33,7 +33,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/FORTRAN.py b/test/Fortran/FORTRAN.py index 379dfe9..721d48f 100644 --- a/test/Fortran/FORTRAN.py +++ b/test/Fortran/FORTRAN.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/FORTRANFILESUFFIXES.py b/test/Fortran/FORTRANFILESUFFIXES.py index 5294836..ec659a1 100644 --- a/test/Fortran/FORTRANFILESUFFIXES.py +++ b/test/Fortran/FORTRANFILESUFFIXES.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test default file suffix: .f/.F for FORTRAN test.write('SConstruct', """ diff --git a/test/Fortran/FORTRANFILESUFFIXES2.py b/test/Fortran/FORTRANFILESUFFIXES2.py index 4c3f679..6dda07d 100644 --- a/test/Fortran/FORTRANFILESUFFIXES2.py +++ b/test/Fortran/FORTRANFILESUFFIXES2.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) # Test non default file suffix: .f, .f90 and .f95 for FORTRAN test.write('SConstruct', """ diff --git a/test/Fortran/FORTRANFLAGS.py b/test/Fortran/FORTRANFLAGS.py index 6ef2d72..316f67c 100644 --- a/test/Fortran/FORTRANFLAGS.py +++ b/test/Fortran/FORTRANFLAGS.py @@ -33,7 +33,7 @@ test = TestSCons.TestSCons() _exe = TestSCons._exe test.file_fixture('mylink.py') -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(LINK = r'%(_python_)s mylink.py', diff --git a/test/Fortran/SHF03.py b/test/Fortran/SHF03.py index 5327c4c..0ab2cc9 100644 --- a/test/Fortran/SHF03.py +++ b/test/Fortran/SHF03.py @@ -33,7 +33,7 @@ obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(SHF03 = r'%(_python_)s myfortran.py g03', diff --git a/test/Fortran/SHF08.py b/test/Fortran/SHF08.py index 10f9314..8147b79 100644 --- a/test/Fortran/SHF08.py +++ b/test/Fortran/SHF08.py @@ -33,7 +33,7 @@ obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(SHF08 = r'%(_python_)s myfortran.py g08', diff --git a/test/Fortran/SHF77.py b/test/Fortran/SHF77.py index ba3ac2e..1b0e180 100644 --- a/test/Fortran/SHF77.py +++ b/test/Fortran/SHF77.py @@ -33,7 +33,7 @@ obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(SHF77 = r'%(_python_)s myfortran.py g77', diff --git a/test/Fortran/SHF77FLAGS.py b/test/Fortran/SHF77FLAGS.py index e3f78a8..19d40b6 100644 --- a/test/Fortran/SHF77FLAGS.py +++ b/test/Fortran/SHF77FLAGS.py @@ -33,7 +33,7 @@ _obj = TestSCons._shobj obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(SHF77 = r'%(_python_)s myfortran_flags.py g77') diff --git a/test/Fortran/SHF90.py b/test/Fortran/SHF90.py index c56772e..1524bf3 100644 --- a/test/Fortran/SHF90.py +++ b/test/Fortran/SHF90.py @@ -33,7 +33,7 @@ obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(SHF90 = r'%(_python_)s myfortran.py g90', diff --git a/test/Fortran/SHF90FLAGS.py b/test/Fortran/SHF90FLAGS.py index 6f7ee00..947bf4b 100644 --- a/test/Fortran/SHF90FLAGS.py +++ b/test/Fortran/SHF90FLAGS.py @@ -33,7 +33,7 @@ _obj = TestSCons._shobj obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(SHF90 = r'%(_python_)s myfortran_flags.py g90', diff --git a/test/Fortran/SHF95.py b/test/Fortran/SHF95.py index ff0604b..27d9a76 100644 --- a/test/Fortran/SHF95.py +++ b/test/Fortran/SHF95.py @@ -33,7 +33,7 @@ obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(SHF95 = r'%(_python_)s myfortran.py g95', diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py index 45c37bc..d1fbe3f 100644 --- a/test/Fortran/SHF95FLAGS.py +++ b/test/Fortran/SHF95FLAGS.py @@ -33,7 +33,7 @@ _obj = TestSCons._shobj obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(SHF95 = r'%(_python_)s myfortran_flags.py g95', diff --git a/test/Fortran/SHFORTRAN.py b/test/Fortran/SHFORTRAN.py index 2155736..f4850d7 100644 --- a/test/Fortran/SHFORTRAN.py +++ b/test/Fortran/SHFORTRAN.py @@ -33,7 +33,7 @@ obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran.py')) +test.file_fixture(['fixture', 'myfortran.py']) test.write('SConstruct', """ env = Environment(SHFORTRAN = r'%(_python_)s myfortran.py fortran') diff --git a/test/Fortran/SHFORTRANFLAGS.py b/test/Fortran/SHFORTRANFLAGS.py index 70c353b..ac2abd8 100644 --- a/test/Fortran/SHFORTRANFLAGS.py +++ b/test/Fortran/SHFORTRANFLAGS.py @@ -32,7 +32,7 @@ _obj = TestSCons._shobj obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() -test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) +test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ env = Environment(SHFORTRAN = r'%(_python_)s myfortran_flags.py fortran') diff --git a/test/QT/QTFLAGS.py b/test/QT/QTFLAGS.py index 61a1d87..aa142f5 100644 --- a/test/QT/QTFLAGS.py +++ b/test/QT/QTFLAGS.py @@ -35,28 +35,31 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() -test.subdir( 'qt', ['qt', 'bin'], ['qt', 'include'], ['qt', 'lib'], - 'work1', 'work2') - test.Qt_dummy_installation() +test.subdir('work1', 'work2') -test.run(chdir=test.workpath('qt','lib'), arguments = '.', - stderr=TestSCons.noisy_ar, - match=TestSCons.match_re_dotall) +test.run( + chdir=test.workpath('qt', 'lib'), + arguments='.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall, +) QT = test.workpath('qt') QT_LIB = 'myqt' -QT_MOC = '%s %s' % (_python_, test.workpath('qt','bin','mymoc.py')) -QT_UIC = '%s %s' % (_python_, test.workpath('qt','bin','myuic.py')) - -def createSConstruct(test,place,overrides): - test.write(place, """ -env = Environment(QTDIR = r'%s', - QT_LIB = r'%s', - QT_MOC = r'%s', - QT_UIC = r'%s', - %s - tools=['default','qt']) +QT_MOC = '%s %s' % (_python_, test.workpath('qt', 'bin', 'mymoc.py')) +QT_UIC = '%s %s' % (_python_, test.workpath('qt', 'bin', 'myuic.py')) + +def createSConstruct(test, place, overrides): + test.write(place, """\ +env = Environment( + tools=['default','qt'], + QTDIR = r'%s', + QT_LIB = r'%s', + QT_MOC = r'%s', + QT_UIC = r'%s', + %s # last because 'overrides' may add comma +) if ARGUMENTS.get('variant_dir', 0): if ARGUMENTS.get('chdir', 0): SConscriptChdir(1) @@ -67,7 +70,7 @@ if ARGUMENTS.get('variant_dir', 0): else: sconscript = File('SConscript') Export("env") -SConscript( sconscript ) +SConscript(sconscript) """ % (QT, QT_LIB, QT_MOC, QT_UIC, overrides)) diff --git a/test/packaging/place-files-in-subdirectory.py b/test/packaging/place-files-in-subdirectory.py index 511f27a..838d6b8 100644 --- a/test/packaging/place-files-in-subdirectory.py +++ b/test/packaging/place-files-in-subdirectory.py @@ -29,6 +29,8 @@ Test the requirement to place files in a given subdirectory before archiving. """ import os +import subprocess + import TestSCons python = TestSCons.python @@ -44,68 +46,73 @@ if not tar: # TEST: subdir creation and file copying # test.subdir('src') - test.write('src/main.c', '') -test.write('SConstruct', """ +test.write('SConstruct', """\ env = Environment(tools=['packaging', 'filesystem', 'zip']) -env.Package( NAME = 'libfoo', - PACKAGEROOT = 'libfoo', - PACKAGETYPE = 'src_zip', - VERSION = '1.2.3', - source = [ 'src/main.c', 'SConstruct' ] ) +env.Package( + NAME='libfoo', + PACKAGEROOT='libfoo', + PACKAGETYPE='src_zip', + VERSION='1.2.3', + source=['src/main.c', 'SConstruct'], +) """) -test.run(arguments='libfoo-1.2.3.zip', stderr = None) +test.run(arguments='libfoo-1.2.3.zip', stderr=None) -test.must_exist( 'libfoo' ) -test.must_exist( 'libfoo/SConstruct' ) -test.must_exist( 'libfoo/src/main.c' ) +test.must_exist('libfoo') +test.must_exist('libfoo/SConstruct') +test.must_exist('libfoo/src/main.c') # # TEST: subdir guessing and file copying. # -test.subdir('src') - +#test.subdir('src') # already created above test.write('src/main.c', '') -test.write('SConstruct', """ +test.write('SConstruct', """\ env = Environment(tools=['packaging', 'filesystem', 'zip']) -env.Package( NAME = 'libfoo', - VERSION = '1.2.3', - PACKAGETYPE = 'src_zip', - TARGET = 'src.zip', - source = [ 'src/main.c', 'SConstruct' ] ) +env.Package( + NAME='libfoo', + VERSION='1.2.3', + PACKAGETYPE='src_zip', + TARGET='src.zip', + source=['src/main.c', 'SConstruct'], +) """) -test.run(stderr = None) +test.run(stderr=None) -test.must_exist( 'libfoo-1.2.3' ) -test.must_exist( 'libfoo-1.2.3/SConstruct' ) -test.must_exist( 'libfoo-1.2.3/src/main.c' ) +test.must_exist('libfoo-1.2.3') +test.must_exist('libfoo-1.2.3/SConstruct') +test.must_exist('libfoo-1.2.3/src/main.c') # # TEST: unpacking without the buildir. # -test.subdir('src') +#test.subdir('src') # already created above test.subdir('temp') - test.write('src/main.c', '') -test.write('SConstruct', """ +test.write('SConstruct', """\ env = Environment(tools=['packaging', 'filesystem', 'tar']) -env.Package( NAME = 'libfoo', - VERSION = '1.2.3', - PACKAGETYPE = 'src_targz', - source = [ 'src/main.c', 'SConstruct' ] ) +env.Package( + NAME='libfoo', + VERSION='1.2.3', + PACKAGETYPE='src_targz', + source=['src/main.c', 'SConstruct'], +) """) -test.run(stderr = None) - -with os.popen('%s -tzf %s'%(tar,test.workpath('libfoo-1.2.3.tar.gz'))) as p: - str = p.read() -test.fail_test(str != "libfoo-1.2.3/src/main.c\nlibfoo-1.2.3/SConstruct\n") +test.run(stderr=None) +cp = subprocess.run( + [tar, '-tzf', test.workpath('libfoo-1.2.3.tar.gz')], + stdout=subprocess.PIPE, + universal_newlines=True, +) +test.fail_test(cp.stdout != "libfoo-1.2.3/src/main.c\nlibfoo-1.2.3/SConstruct\n") test.pass_test() # Local Variables: diff --git a/test/packaging/sandbox-test/sandbox-test.py b/test/packaging/sandbox-test/sandbox-test.py index c6d2140..f43a80e 100644 --- a/test/packaging/sandbox-test/sandbox-test.py +++ b/test/packaging/sandbox-test/sandbox-test.py @@ -35,17 +35,16 @@ python = TestSCons.python test = TestSCons.TestSCons() tar = test.detect('TAR', 'tar') - if not tar: test.skip_test('tar not found, skipping test\n') -test.dir_fixture('src','src') +test.dir_fixture('src', dstdir='src') test.file_fixture('SConstruct') test.run(stderr=None) -test.must_exist( 'libfoobar-1.2.3.tar.gz' ) -test.must_exist( 'libfoobar-1.2.3.zip' ) +test.must_exist('libfoobar-1.2.3.tar.gz') +test.must_exist('libfoobar-1.2.3.zip') test.pass_test() diff --git a/test/packaging/use-builddir.py b/test/packaging/use-builddir.py index 86a8219..f6acb5f 100644 --- a/test/packaging/use-builddir.py +++ b/test/packaging/use-builddir.py @@ -51,15 +51,16 @@ test.write("src/main.c", "") test.write("SConstruct", """\ VariantDir('build', 'src') DefaultEnvironment(tools=[]) -env=Environment(tools=['packaging', 'filesystem', 'zip']) -env.Package( NAME = 'libfoo', - PACKAGEROOT = 'build/libfoo', - VERSION = '1.2.3', - PACKAGETYPE = 'src_zip', - target = 'build/libfoo-1.2.3.zip', - source = [ 'src/main.c', 'SConstruct' ] ) -""", +env = Environment(tools=['packaging', 'filesystem', 'zip']) +env.Package( + NAME='libfoo', + PACKAGEROOT='build/libfoo', + VERSION='1.2.3', + PACKAGETYPE='src_zip', + target='build/libfoo-1.2.3.zip', + source=['src/main.c', 'SConstruct'], ) +""") test.run(stderr=None) @@ -68,8 +69,8 @@ test.must_exist("build/libfoo-1.2.3.zip") # TEST: builddir not placed in archive # XXX: VariantDir should be stripped. # -test.subdir("src") -test.subdir("build") +#test.subdir("src") # already created above +#test.subdir("build") # already created above test.subdir("temp") test.write("src/main.c", "") @@ -77,13 +78,14 @@ test.write("src/main.c", "") test.write("SConstruct", """\ DefaultEnvironment(tools=[]) VariantDir('build', 'src') -env=Environment(tools=['packaging', 'filesystem', 'tar']) -env.Package( NAME = 'libfoo', - VERSION = '1.2.3', - PAKCAGETYPE = 'src_targz', - source = [ 'src/main.c', 'SConstruct' ] ) -""", +env = Environment(tools=['packaging', 'filesystem', 'tar']) +env.Package( + NAME='libfoo', + VERSION='1.2.3', + PAKCAGETYPE='src_targz', + source=['src/main.c', 'SConstruct'], ) +""") test.run(stderr=None) |