http://scons.tigris.org/issues/show_bug.cgi?id=2345
[scons.git] / test / no-arguments.py
index 602ef802a2ea62abc8e34324301d4cf70d0a630a..e447ff692f1481cd655f83e1b5c7d83873a00491 100644 (file)
@@ -26,8 +26,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 """
 Verify that we use a default target of the current directory when there
-are no command-line arguments (and, implicitly, no Default() in the
-SConstruct).
+is no Default() in the SConstruct file and there are no command-line
+arguments, or a null command-line argument.
 """
 
 import os.path
@@ -39,7 +39,7 @@ test = TestSCons.TestSCons()
 test.write('SConstruct', r"""
 def cat(env, source, target):
     target = str(target[0])
-    source = map(str, source)
+    source = list(map(str, source))
     print 'cat(%s) > %s' % (source, target)
     f = open(target, "wb")
     for src in source:
@@ -52,10 +52,27 @@ env.Build('aaa.out', 'aaa.in')
 
 test.write('aaa.in', "aaa.in\n")
 
+up_to_date = test.wrap_stdout("scons: `.' is up to date.\n")
+
 #
 test.run()
+test.must_match('aaa.out', "aaa.in\n")
+test.run(stdout=up_to_date)
 
-test.fail_test(test.read('aaa.out') != "aaa.in\n")
+#
+test.unlink('aaa.out')
+test.must_not_exist('aaa.out')
+
+#
+test.run([''])
+test.must_match('aaa.out', "aaa.in\n")
+test.run([''], stdout=up_to_date)
 
 #
 test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: