Tests require GNU make, called gmake on FreeBSD
authorEd Maste <emaste@freebsd.org>
Mon, 24 Jun 2013 15:40:27 +0000 (15:40 +0000)
committerEd Maste <emaste@freebsd.org>
Mon, 24 Jun 2013 15:40:27 +0000 (15:40 +0000)
llvm-svn: 184748

lldb/test/plugins/builder_base.py

index 737276d..c6caa40 100644 (file)
@@ -13,6 +13,7 @@ variable.
 """
 
 import os
+import platform
 import lldbtest
 
 def getArchitecture():
@@ -37,6 +38,13 @@ def getArchFlag():
 
     return (" ARCHFLAG=" + archflag) if archflag else ""
 
+def getMake():
+    """Returns the name for GNU make"""
+    if platform.system() == "FreeBSD":
+      return "gmake "
+    else:
+      return "make "
+
 def getArchSpec(architecture):
     """
     Helper function to return the key-value string to specify the architecture
@@ -81,13 +89,14 @@ def buildDefault(sender=None, architecture=None, compiler=None, dictionary=None,
     """Build the binaries the default way."""
     if clean:
         lldbtest.system(["/bin/sh", "-c",
-                         "make clean" + getCmdLine(dictionary) + "; make"
+                         getMake() + "clean" + getCmdLine(dictionary) + ";"
+                         + getMake()
                          + getArchSpec(architecture) + getCCSpec(compiler)
                          + getCmdLine(dictionary)],
                         sender=sender)
     else:
         lldbtest.system(["/bin/sh", "-c",
-                         "make" + getArchSpec(architecture) + getCCSpec(compiler)
+                         getMake() + getArchSpec(architecture) + getCCSpec(compiler)
                          + getCmdLine(dictionary)],
                         sender=sender)
 
@@ -98,14 +107,14 @@ def buildDwarf(sender=None, architecture=None, compiler=None, dictionary=None, c
     """Build the binaries with dwarf debug info."""
     if clean:
         lldbtest.system(["/bin/sh", "-c",
-                         "make clean" + getCmdLine(dictionary)
-                         + "; make MAKE_DSYM=NO"
+                         getMake() + "clean" + getCmdLine(dictionary)
+                         + ";" + getMake() + "MAKE_DSYM=NO"
                          + getArchSpec(architecture) + getCCSpec(compiler)
                          + getCmdLine(dictionary)],
                         sender=sender)
     else:
         lldbtest.system(["/bin/sh", "-c",
-                         "make MAKE_DSYM=NO"
+                         getMake() + "MAKE_DSYM=NO"
                          + getArchSpec(architecture) + getCCSpec(compiler)
                          + getCmdLine(dictionary)],
                         sender=sender)
@@ -118,7 +127,8 @@ def cleanup(sender=None, dictionary=None):
     #import traceback
     #traceback.print_stack()
     if os.path.isfile("Makefile"):
-        lldbtest.system(["/bin/sh", "-c", "make clean"+getCmdLine(dictionary)],
+        lldbtest.system(["/bin/sh", "-c",
+                         getMake() + "clean" + getCmdLine(dictionary)],
                         sender=sender)
 
     # True signifies that we can handle cleanup.