Source

SCons / test / sconsign / script / dblite.py

Diff from to

test/sconsign/script/dblite.py

 
 test = TestSConsign.TestSConsign(match = TestSConsign.match_re)
 
+_exe = TestSConsign._exe
+_obj = TestSConsign._obj
+
 CC = test.detect('CC', norm=1)
 LINK = test.detect('LINK', norm=1)
 if LINK is None: LINK = CC
 # canonicalized to use / as the separator.
 
 sub1_hello_c    = 'sub1/hello.c'
-sub1_hello_obj  = 'sub1/hello.obj'
+sub1_hello_obj  = 'sub1/hello%s' % _obj
 
 test.write('SConstruct', """
 SConsignFile('my_sconsign')
 Decider('timestamp-newer')
-env1 = Environment(PROGSUFFIX = '.exe', OBJSUFFIX = '.obj')
+env1 = Environment()
 env1.Program('sub1/hello.c')
 env2 = env1.Clone(CPPPATH = ['sub2'])
 env2.Program('sub2/hello.c')
 date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d'
 
 if sys.platform == 'win32':
-    manifest = r"""
+    import SCons.Tool.MSCommon as msc
+    if msc.msvc_exists():
+        manifest = r"""
 embedManifestExeCheck\(target, source, env\)"""
+    else:
+        manifest = ''
 else:
     manifest = ''
 
 expect = r"""=== sub1:
-hello.exe: %(sig_re)s \d+ \d+
+hello%(_exe)s: %(sig_re)s \d+ \d+
         %(sub1_hello_obj)s: %(sig_re)s \d+ \d+
         %(LINK)s: None \d+ \d+
         %(sig_re)s \[.*%(manifest)s\]
-hello.obj: %(sig_re)s \d+ \d+
+hello%(_obj)s: %(sig_re)s \d+ \d+
         %(sub1_hello_c)s: None \d+ \d+
         %(CC)s: None \d+ \d+
         %(sig_re)s \[.*\]
 """ % locals()
 
 expect_r = """=== sub1:
-hello.exe: %(sig_re)s '%(date_re)s' \d+
+hello%(_exe)s: %(sig_re)s '%(date_re)s' \d+
         %(sub1_hello_obj)s: %(sig_re)s '%(date_re)s' \d+
         %(LINK)s: None '%(date_re)s' \d+
         %(sig_re)s \[.*%(manifest)s\]
-hello.obj: %(sig_re)s '%(date_re)s' \d+
+hello%(_obj)s: %(sig_re)s '%(date_re)s' \d+
         %(sub1_hello_c)s: None '%(date_re)s' \d+
         %(CC)s: None '%(date_re)s' \d+
         %(sig_re)s \[.*\]
 """ % locals()
 
-common_flags = '-e hello.exe -e hello.obj -d sub1'
+common_flags = '-e hello%(_exe)s -e hello%(_obj)s -d sub1' % locals()
 
 test.run_sconsign(arguments = "%s my_sconsign" % common_flags,
                   stdout = expect)