diff options
author | Steven Knight <knight@baldmt.com> | 2005-10-07 10:53:07 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-10-07 10:53:07 (GMT) |
commit | ea890f45633f896cf9cb3459c57e955de9a51231 (patch) | |
tree | 20735b9e7339336d97f60a0c4cccb0c6196a694a /test | |
parent | 401ef15c42e9df4f60103dc52b806b3c8ab259fb (diff) | |
download | SCons-ea890f45633f896cf9cb3459c57e955de9a51231.zip SCons-ea890f45633f896cf9cb3459c57e955de9a51231.tar.gz SCons-ea890f45633f896cf9cb3459c57e955de9a51231.tar.bz2 |
Update MSVS tests with BuildDir logic.
Diffstat (limited to 'test')
-rw-r--r-- | test/MSVS/vs-6.0-files.py | 58 | ||||
-rw-r--r-- | test/MSVS/vs-7.0-files.py | 63 | ||||
-rw-r--r-- | test/MSVS/vs-7.1-files.py | 64 |
3 files changed, 161 insertions, 24 deletions
diff --git a/test/MSVS/vs-6.0-files.py b/test/MSVS/vs-6.0-files.py index fdc8ef2..8792cb0 100644 --- a/test/MSVS/vs-6.0-files.py +++ b/test/MSVS/vs-6.0-files.py @@ -35,7 +35,7 @@ import sys import TestCmd import TestSCons -test = TestSCons.TestSCons(match = TestCmd.match_re) +test = TestSCons.TestSCons() if sys.platform != 'win32': msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform @@ -144,7 +144,7 @@ SOURCE="test.rc" # End Group # Begin Source File -SOURCE="<WORKPATH>\SConstruct" +SOURCE="<SCONSCRIPT>" # End Source File # End Target # End Project @@ -182,9 +182,8 @@ Package=<3> ''' -test.subdir('work1') -test.write(['work1', 'SConstruct'], """\ +SConscript_contents = """\ env=Environment(MSVS_VERSION = '6.0') testsrc = ['test.c'] @@ -201,19 +200,27 @@ env.MSVSProject(target = 'Test.dsp', misc = testmisc, buildtarget = 'Test.exe', variant = 'Release') -""") +""" + + + +test.subdir('work1') + +test.write(['work1', 'SConstruct'], SConscript_contents) test.run(chdir='work1', arguments="Test.dsp") test.must_exist(test.workpath('work1', 'Test.dsp')) dsp = test.read(['work1', 'Test.dsp'], 'r') -expect = test.msvs_substitute(expected_dspfile, '6.0', 'work1') +expect = test.msvs_substitute(expected_dspfile, '6.0', 'work1', + test.workpath('work1', 'SConstruct')) # don't compare the pickled data assert dsp[:len(expect)] == expect, test.diff_substr(expect, dsp) test.must_exist(test.workpath('work1', 'Test.dsw')) dsw = test.read(['work1', 'Test.dsw'], 'r') -expect = test.msvs_substitute(expected_dswfile, '6.0', 'work1') +expect = test.msvs_substitute(expected_dswfile, '6.0', 'work1', + test.workpath('work1', 'SConstruct')) assert dsw == expect, test.diff_substr(expect, dsw) test.run(chdir='work1', arguments='-c .') @@ -233,4 +240,41 @@ test.must_not_exist(test.workpath('work1', 'Test.dsw')) +test.subdir('work2', ['work2', 'src']) + +test.write(['work2', 'SConstruct'], """\ +SConscript('src/SConscript', build_dir='build') +""") + +test.write(['work2', 'src', 'SConscript'], SConscript_contents) + +test.run(chdir='work2', arguments=".") + +test.must_match(['work2', 'build', 'Test.dsp'], """\ +This is just a placeholder file. +The real project file is here: +%s +""" % test.workpath('work2', 'src', 'Test.dsp'), + mode='r') + +dsp = test.read(['work2', 'src', 'Test.dsp'], 'r') +expect = test.msvs_substitute(expected_dspfile, '6.0', 'work2', + test.workpath('work2', 'src', 'SConscript')) +# don't compare the pickled data +assert dsp[:len(expect)] == expect, test.diff_substr(expect, dsp) + +test.must_match(['work2', 'build', 'Test.dsw'], """\ +This is just a placeholder file. +The real workspace file is here: +%s +""" % test.workpath('work2', 'src', 'Test.dsw'), + mode='r') + +test.must_exist(test.workpath('work2', 'src', 'Test.dsw')) +dsw = test.read(['work2', 'src', 'Test.dsw'], 'r') +expect = test.msvs_substitute(expected_dswfile, '6.0', 'work2\\src') +assert dsw == expect, test.diff_substr(expect, dsw) + + + test.pass_test() diff --git a/test/MSVS/vs-7.0-files.py b/test/MSVS/vs-7.0-files.py index c04c112..9144537 100644 --- a/test/MSVS/vs-7.0-files.py +++ b/test/MSVS/vs-7.0-files.py @@ -36,7 +36,7 @@ import sys import TestCmd import TestSCons -test = TestSCons.TestSCons(match = TestCmd.match_re) +test = TestSCons.TestSCons() if sys.platform != 'win32': msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform @@ -129,7 +129,7 @@ expected_vcprojfile = """\ \t\t\t</File> \t\t</Filter> \t\t<File -\t\t\tRelativePath="<WORKPATH>\SConstruct"> +\t\t\tRelativePath="<SCONSCRIPT>"> \t\t</File> \t</Files> \t<Globals> @@ -138,9 +138,8 @@ expected_vcprojfile = """\ """ -test.subdir('work1') -test.write(['work1', 'SConstruct'], """\ +SConscript_contents = """\ env=Environment(MSVS_VERSION = '7.0') testsrc = ['test.cpp'] @@ -158,19 +157,27 @@ env.MSVSProject(target = 'Test.vcproj', misc = testmisc, buildtarget = 'Test.exe', variant = 'Release') -""") +""" + + + +test.subdir('work1') + +test.write(['work1', 'SConstruct'], SConscript_contents) test.run(chdir='work1', arguments="Test.vcproj") test.must_exist(test.workpath('work1', 'Test.vcproj')) vcproj = test.read(['work1', 'Test.vcproj'], 'r') -expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1') +expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1', + test.workpath('work1', 'SConstruct')) # don't compare the pickled data assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) test.must_exist(test.workpath('work1', 'Test.sln')) sln = test.read(['work1', 'Test.sln'], 'r') -expect = test.msvs_substitute(expected_slnfile, '7.0', 'work1') +expect = test.msvs_substitute(expected_slnfile, '7.0', 'work1', + test.workpath('work1', 'SConstruct')) # don't compare the pickled data assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) @@ -201,7 +208,9 @@ python = os.path.join('$(PYTHON_ROOT)', os.path.split(sys.executable)[1]) test.must_exist(test.workpath('work1', 'Test.vcproj')) vcproj = test.read(['work1', 'Test.vcproj'], 'r') -expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1', python=python) +expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1', + test.workpath('work1', 'SConstruct'), + python=python) # don't compare the pickled data assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) @@ -209,4 +218,42 @@ os.environ['PYTHON_ROOT'] = '' +test.subdir('work2', ['work2', 'src']) + +test.write(['work2', 'SConstruct'], """\ +SConscript('src/SConscript', build_dir='build') +""") + +test.write(['work2', 'src', 'SConscript'], SConscript_contents) + +test.run(chdir='work2', arguments=".") + +test.must_match(['work2', 'build', 'Test.vcproj'], """\ +This is just a placeholder file. +The real project file is here: +%s +""" % test.workpath('work2', 'src', 'Test.vcproj'), + mode='r') + +vcproj = test.read(['work2', 'src', 'Test.vcproj'], 'r') +expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work2', + test.workpath('work2', 'src', 'SConscript')) +# don't compare the pickled data +assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) + +test.must_match(['work2', 'build', 'Test.sln'], """\ +This is just a placeholder file. +The real workspace file is here: +%s +""" % test.workpath('work2', 'src', 'Test.sln'), + mode='r') + +test.must_exist(test.workpath('work2', 'src', 'Test.sln')) +sln = test.read(['work2', 'src', 'Test.sln'], 'r') +expect = test.msvs_substitute(expected_slnfile, '7.0', 'work2\\src') +# don't compare the pickled data +assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) + + + test.pass_test() diff --git a/test/MSVS/vs-7.1-files.py b/test/MSVS/vs-7.1-files.py index 71670fa..5b5799b 100644 --- a/test/MSVS/vs-7.1-files.py +++ b/test/MSVS/vs-7.1-files.py @@ -36,7 +36,7 @@ import sys import TestCmd import TestSCons -test = TestSCons.TestSCons(match = TestCmd.match_re) +test = TestSCons.TestSCons() if sys.platform != 'win32': msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform @@ -131,7 +131,7 @@ expected_vcprojfile = """\ \t\t\t</File> \t\t</Filter> \t\t<File -\t\t\tRelativePath="<WORKPATH>\SConstruct"> +\t\t\tRelativePath="<SCONSCRIPT>"> \t\t</File> \t</Files> \t<Globals> @@ -141,9 +141,7 @@ expected_vcprojfile = """\ -test.subdir('work1') - -test.write(['work1', 'SConstruct'], """\ +SConscript_contents = """\ env=Environment(MSVS_VERSION = '7.1') testsrc = ['test.cpp'] @@ -161,19 +159,27 @@ env.MSVSProject(target = 'Test.vcproj', misc = testmisc, buildtarget = 'Test.exe', variant = 'Release') -""") +""" + + + +test.subdir('work1') + +test.write(['work1', 'SConstruct'], SConscript_contents) test.run(chdir='work1', arguments="Test.vcproj") test.must_exist(test.workpath('work1', 'Test.vcproj')) vcproj = test.read(['work1', 'Test.vcproj'], 'r') -expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1') +expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1', + test.workpath('work1', 'SConstruct')) # don't compare the pickled data assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) test.must_exist(test.workpath('work1', 'Test.sln')) sln = test.read(['work1', 'Test.sln'], 'r') -expect = test.msvs_substitute(expected_slnfile, '7.1', 'work1') +expect = test.msvs_substitute(expected_slnfile, '7.1', 'work1', + test.workpath('work1', 'SConstruct')) # don't compare the pickled data assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) @@ -204,7 +210,9 @@ python = os.path.join('$(PYTHON_ROOT)', os.path.split(sys.executable)[1]) test.must_exist(test.workpath('work1', 'Test.vcproj')) vcproj = test.read(['work1', 'Test.vcproj'], 'r') -expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1', python=python) +expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1', + test.workpath('work1', 'SConstruct'), + python=python) # don't compare the pickled data assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) @@ -212,4 +220,42 @@ os.environ['PYTHON_ROOT'] = '' +test.subdir('work2', ['work2', 'src']) + +test.write(['work2', 'SConstruct'], """\ +SConscript('src/SConscript', build_dir='build') +""") + +test.write(['work2', 'src', 'SConscript'], SConscript_contents) + +test.run(chdir='work2', arguments=".") + +test.must_match(['work2', 'build', 'Test.vcproj'], """\ +This is just a placeholder file. +The real project file is here: +%s +""" % test.workpath('work2', 'src', 'Test.vcproj'), + mode='r') + +vcproj = test.read(['work2', 'src', 'Test.vcproj'], 'r') +expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work2', + test.workpath('work2', 'src', 'SConscript')) +# don't compare the pickled data +assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) + +test.must_match(['work2', 'build', 'Test.sln'], """\ +This is just a placeholder file. +The real workspace file is here: +%s +""" % test.workpath('work2', 'src', 'Test.sln'), + mode='r') + +test.must_exist(test.workpath('work2', 'src', 'Test.sln')) +sln = test.read(['work2', 'src', 'Test.sln'], 'r') +expect = test.msvs_substitute(expected_slnfile, '7.0', 'work2\\src') +# don't compare the pickled data +assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) + + + test.pass_test() |