testsuite: Introduce makefile_test
authorBen Gamari <ben@smart-cactus.org>
Mon, 21 Jan 2019 03:54:48 +0000 (22:54 -0500)
committerBen Gamari <ben@smart-cactus.org>
Wed, 30 Jan 2019 15:06:31 +0000 (10:06 -0500)
testsuite/driver/testlib.py
testsuite/tests/plugins/all.T

index 4a87f0a..d29024d 100644 (file)
@@ -1002,6 +1002,13 @@ def badResult(result):
 def run_command( name, way, cmd ):
     return simple_run( name, '', override_options(cmd), '' )
 
+def makefile_test( name, way, target=None ):
+    if target is None:
+        target = name
+
+    cmd = '$MAKE -s --no-print-directory {target}'.format(target=target)
+    return run_command(name, way, cmd)
+
 # -----------------------------------------------------------------------------
 # GHCi tests
 
index 30b8fd6..7a5be65 100644 (file)
@@ -214,4 +214,4 @@ test('T16104',
      [extra_files(['T16104-plugin/']),
       pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}')
      ],
-     run_command, ['$MAKE -s --no-print-directory T16104'])
+     makefile_test, [])