import sys

import TestSCons

test = TestSCons.TestSCons(match = TestSCons.match_re)

if sys.platform != 'win32':
    msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
    test.skip_test(msg)

#####
# Test the basics

test.write('SConstruct',"""
import os
env = Environment(tools = ['MSVCCommon'])
""")

test.run(stderr = None)
test.pass_test()

@@ -274,18 +274,107 @@
 %22%22%22%0A
-import o
+from SCons.Tool.MSVCCommon import FindMSVSBatFile, ParseBatFile, MergeMSVSBatFile, query_version
 s%0A
+#
 env 
@@ -401,20 +401,351 @@
 = %5B'
-MSVCCommon'%5D
+mingw'%5D)%0ADefaultEnvironment(tools = %5B%5D)%0A#for v in %5B9, 8, 7.1, 7%5D:%0A#    print %22 ==== Testing for version %25s ==== %22 %25 str(v)%0A#    bat = FindMSVSBatFile(v)%0A#    print bat%0A#    if bat:%0A#        d = ParseBatFile(bat)%0A#        for k, v in d.items():%0A#            print k, v%0A#MergeMSVSBatFile(env, 9.0)%0A#print env%5B'ENV'%5D%5B'PATH'%5D%0Aprint query_versions(
 )%0A%22%22

Update our fake test for debugging purpose.