Commits

Gary Oberbrunner committed 4c336fc

MSVC: show valid $TARGET_ARCH values when invalid arch passed in.

Comments (0)

Files changed (3)

 
 RELEASE 2.X.X - 
 
+  From Gary Oberbrunner:
+    - Show valid Visual Studio architectures in error message
+       when user passes invalid arch.
+
   From Alexey Petruchik:
     - Support for Microsoft Visual Studio 11 (both using it
       and generating MSVS11 solution files).

src/engine/SCons/Tool/MSCommon/vc.py

     try:
         target = _ARCH_TO_CANONICAL[target_platform.lower()]
     except KeyError, e:
-        raise ValueError("Unrecognized target architecture %s" % target_platform)
+        all_archs = str(_ARCH_TO_CANONICAL.keys())
+        raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs))
 
     return (host, target,req_target_platform)
 

test/MSVC/TARGET_ARCH.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 """
-Test the ability to configure the $PCHCOM construction variable.
+Test the ability to configure the $TARGET_ARCH construction variable.
 """
 
 import TestSCons
 
 test.run(arguments = ".")
 
+# test.pass_test()
+
+test.write('SConstruct', """
+env_xx = Environment(tools=['default', 'msvc'],
+                  TARGET_ARCH = 'nosucharch')
+""" % locals())
+
+test.run(arguments = ".", status=2, stderr=None)
+test.must_contain_any_line(test.stderr(), "Unrecognized target architecture")
+test.must_contain_any_line(test.stderr(), "Valid architectures")
+
 test.pass_test()
 
 # Local Variables:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.