Remove (lots) more unnecessary imports.
[scons.git] / test / Configure / clean.py
index 5b8e43d0022677f99c1ec258a9aea242c21462f0..a48029db7deb2769d28ba957196b55957614c93d 100644 (file)
@@ -29,8 +29,6 @@ Verify that we don't perform Configure context actions when the
 -c or --clean options have been specified.
 """
 
-import string
-
 import TestSCons
 
 test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
@@ -39,7 +37,7 @@ test.write('SConstruct', """\
 env = Environment()
 import os
 env.AppendENVPath('PATH', os.environ['PATH'])
-conf = Configure(env)
+conf = Configure(env, clean=int(ARGUMENTS['clean']))
 r1 = conf.CheckCHeader( 'math.h' )
 r2 = conf.CheckCHeader( 'no_std_c_header.h' ) # leads to compile error
 env = conf.Finish()
@@ -65,32 +63,16 @@ lines = [
     "Checking for C header file no_std_c_header.h... "
 ]
 
-unexpected = []
-
-test.run(arguments = '-c')
-
-for line in lines:
-    if string.find(test.stdout(), line) != -1:
-        unexpected.append(line)
-
-if unexpected:
-    print "Unexpected lines in standard output:"
-    print string.join(unexpected, '\n')
-    print "STDOUT ============================================================"
-    print test.stdout()
-    test.fail_test()
+test.run(arguments = '-c clean=0')
+test.must_not_contain_any_line(test.stdout(), lines)
 
-test.run(arguments = '--clean')
+test.run(arguments = '-c clean=1')
+test.must_contain_all_lines(test.stdout(), lines)
 
-for line in lines:
-    if string.find(test.stdout(), line) != -1:
-        unexpected.append(line)
+test.run(arguments = '--clean clean=0')
+test.must_not_contain_any_line(test.stdout(), lines)
 
-if unexpected:
-    print "Unexpected lines in standard output:"
-    print string.join(unexpected, '\n')
-    print "STDOUT ============================================================"
-    print test.stdout()
-    test.fail_test()
+test.run(arguments = '--clean clean=1')
+test.must_contain_all_lines(test.stdout(), lines)
 
 test.pass_test()