make z80 clearly failing this test
[fw/sdcc] / support / regression / generate-cases.py
index 32f8190e1b0e5b65d9193537531cb409602b4ea7..55839e9130f38c7b762d76755ded34c5e6ff1352 100644 (file)
@@ -5,11 +5,11 @@ import sys, re, tempfile, os
 
 # Globals
 # Directory that the generated files should be placed into
-outdir = 'gen'
+outdir = sys.argv[2]
 
 # Start of the test function table definition
 testfuntableheader = """
-static void (*const _tests[])(void) = {
+static TESTFUNP _tests[] = {
 """
 
 
@@ -20,10 +20,10 @@ testfuntablefooter = """\tNULL
 
 # Code to generate the suite function
 testfunsuite = """
-void **
+TESTFUNP *
 suite(void)
 {
-    return (void **)_tests;
+    return _tests;
 }
 
 const char *
@@ -171,15 +171,15 @@ class InstanceGenerator:
         createdir(outdir)
 
         # Generate
-        self.permute(os.path.join(outdir, self.basename), self.replacements.keys())
+        self.permute(os.path.join(outdir, os.path.basename(self.basename)), self.replacements.keys())
 
         # Remove the temporary file
         os.remove(self.tmpname)
 
 # Check and parse the command line arguments
-if len(sys.argv) < 2:
+if len(sys.argv) < 3:
     # PENDING: How to throw an error?
-    print "usage: generate-cases.py template.c"
+    print "usage: generate-cases.py template.c outdir"
 
 # Input name is the first arg.