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()

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',"""
from SCons.Tool.MSVCCommon import FindMSVSBatFile, ParseBatFile, MergeMSVSBatFile, query_versions
#env = Environment(tools = ['mingw'])
DefaultEnvironment(tools = [])
#for v in [9, 8, 7.1, 7]:
#    print " ==== Testing for version %s ==== " % str(v)
#    bat = FindMSVSBatFile(v)
#    print bat
#    if bat:
#        d = ParseBatFile(bat)
#        for k, v in d.items():
#            print k, v
#MergeMSVSBatFile(env, 9.0)
#print env['ENV']['PATH']
print query_versions()
""")

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

Update our fake test for debugging purpose.
Update our fake test for debugging purpose.


  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
+ from SCons.Tool.MSVCCommon import FindMSVSBatFile, ParseBatFile, MergeMSVSBatFile, query_versions
- env = Environment(tools = ['MSVCCommon'])
+ #env = Environment(tools = ['mingw'])
+ DefaultEnvironment(tools = [])
+ #for v in [9, 8, 7.1, 7]:
+ #    print " ==== Testing for version %s ==== " % str(v)
+ #    bat = FindMSVSBatFile(v)
+ #    print bat
+ #    if bat:
+ #        d = ParseBatFile(bat)
+ #        for k, v in d.items():
+ #            print k, v
+ #MergeMSVSBatFile(env, 9.0)
+ #print env['ENV']['PATH']
+ print query_versions()
  """)
  
  test.run(stderr = None)
  test.pass_test()
  
Update our fake test for debugging purpose.
## Code Before:
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()

## Instruction:
Update our fake test for debugging purpose.
## Code After:
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',"""
from SCons.Tool.MSVCCommon import FindMSVSBatFile, ParseBatFile, MergeMSVSBatFile, query_versions
#env = Environment(tools = ['mingw'])
DefaultEnvironment(tools = [])
#for v in [9, 8, 7.1, 7]:
#    print " ==== Testing for version %s ==== " % str(v)
#    bat = FindMSVSBatFile(v)
#    print bat
#    if bat:
#        d = ParseBatFile(bat)
#        for k, v in d.items():
#            print k, v
#MergeMSVSBatFile(env, 9.0)
#print env['ENV']['PATH']
print query_versions()
""")

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