remind test.py how to build on unix and limit build scope when posible
authorCraig Dowell <craigdo@ee.washington.edu>
Fri, 30 Oct 2009 10:23:40 -0700
changeset 5470 d3aabb63dd12
parent 5469 3d1c26170e5c
child 5471 61831e265e20
remind test.py how to build on unix and limit build scope when posible
test.py
--- a/test.py	Thu Oct 29 15:39:41 2009 +0300
+++ b/test.py	Fri Oct 30 10:23:40 2009 -0700
@@ -804,11 +804,33 @@
         # For example, if the user only wants to run BVT tests, we only have
         # to build the test-runner and can ignore all of the examples.
         #
+        # If the user only wants to run a single example, then we can just build
+        # that example.
+        #
+        # If there is no constraint, then we have to build everything since the
+        # user wants to run everything.
+        #
         if options.kinds or options.list or (len(options.constrain) and options.constrain in core_kinds):
-            proc = subprocess.Popen("waf --target=test-runner", shell = True)
+            if sys.platform == "win32":
+                waf_cmd = "waf --target=test-runner"
+            else:
+                waf_cmd = "./waf --target=test-runner"
+        elif len(options.example):
+            if sys.platform == "win32":
+                waf_cmd = "waf --target=%s" % os.path.basename(options.example)
+            else:
+                waf_cmd = "./waf --target=%s" % os.path.basename(options.example)
+
         else:
-            proc = subprocess.Popen("waf", shell = True)
+            if sys.platform == "win32":
+                waf_cmd = "waf"
+            else:
+                waf_cmd = "./waf"
 
+        if options.verbose:
+            print "Building: %s" % waf_cmd
+
+        proc = subprocess.Popen(waf_cmd, shell = True)
         proc.communicate()
 
     #