Issue 2505: fix use of pre-compiled headers when the source .cpp
[scons.git] / test / no-global-dependencies.py
index 3cdea1b3195e9a6aea5383f455b49e01d853821c..18b674c971917add2667d48fc647151bb109497a 100644 (file)
@@ -25,7 +25,7 @@
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 """
-Test that files are correctly located in the build directory even when
+Test that files are correctly located in the variant directory even when
 Scons does not have a global view of all targets.
 
 Sometimes, it might be interesting to not tell scons about every
@@ -35,8 +35,6 @@ done to speed-up a partial rebuild when the developer knows that only
 a subset of the targets need to be rebuilt.
 """
 
-import string
-
 import TestSCons
 
 test = TestSCons.TestSCons()
@@ -45,16 +43,16 @@ test.subdir('dir1')
 test.subdir('dir2')
 
 test.write('SConstruct', """\
-opts = Options()
-opts.AddOptions(
-    BoolOption('view_all_dependencies', 'View all dependencies', True),
-    BoolOption('duplicate', 'Duplicate sources to build dir', True)
+opts = Variables()
+opts.AddVariables(
+    BoolVariable('view_all_dependencies', 'View all dependencies', True),
+    BoolVariable('duplicate', 'Duplicate sources to variant dir', True)
 )
 
 env = Environment(options=opts)
 Export('env')
 
-SConscript(dirs='.', build_dir='build', duplicate=env['duplicate'])
+SConscript(dirs='.', variant_dir='build', duplicate=env['duplicate'])
 """ % locals())
 
 
@@ -92,12 +90,12 @@ test.must_not_exist('build/dir1/x.cpp')
 # Build everything first.
 test.run(arguments = 'duplicate=False view_all_dependencies=True .')
 test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
 
 # Double check that targets are not rebuilt.
 test.run(arguments = 'duplicate=False view_all_dependencies=True .')
 test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
 
 # Clean-up only the object file
 test.run(arguments = 'duplicate=False view_all_dependencies=False -c .')
@@ -106,17 +104,17 @@ test.must_exist('build/dir1/x.cpp')
 # Rebuild the only object file without seeing all the dependencies.
 test.run(arguments = 'duplicate=False view_all_dependencies=False .')
 test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
 
 # Double check that targets are not rebuilt without and with all the
 # dependencies.
 test.run(arguments = 'duplicate=False view_all_dependencies=False .')
 test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
 
 test.run(arguments = 'duplicate=False view_all_dependencies=True .')
 test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
 
 # Clean-up everything.
 test.run(arguments = 'duplicate=False view_all_dependencies=True -c .')
@@ -136,12 +134,12 @@ test.must_not_exist('build/dir1/x.cpp')
 # # Build everything first.
 # test.run(arguments = 'duplicate=True view_all_dependencies=True .')
 # test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+# test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
 
 # # Double check that targets are not rebuilt.
 # test.run(arguments = 'duplicate=True view_all_dependencies=True .')
 # test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+# test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
 
 # # Clean-up only the object file
 # test.run(arguments = 'duplicate=True view_all_dependencies=False -c .')
@@ -150,17 +148,17 @@ test.must_not_exist('build/dir1/x.cpp')
 # # Rebuild the only object file without seeing all the dependencies.
 # test.run(arguments = 'duplicate=True view_all_dependencies=False .')
 # test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+# test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
 
 # # Double check that targets are not rebuilt without and with all the
 # # dependencies.
 # test.run(arguments = 'duplicate=True view_all_dependencies=False .')
 # test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+# test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
 
 # test.run(arguments = 'duplicate=True view_all_dependencies=True .')
 # test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+# test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
 
 # # Clean-up everything.
 # test.run(arguments = 'duplicate=True view_all_dependencies=True -c .')
@@ -168,3 +166,9 @@ test.must_not_exist('build/dir1/x.cpp')
 
 
 test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: