* support/regression/generate-cases.py: implemented more flexible rule
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 26 Jun 2007 18:47:44 +0000 (18:47 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 26 Jun 2007 18:47:44 +0000 (18:47 +0000)
  for detection of testing functions, allowing return type 'void' in
  the same line as the function name in the function definition
* support/regression/tests/bug-1654060.c: corrected test

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4861 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/regression/generate-cases.py
support/regression/tests/bug-1654060.c

index 422a8700d332f9017093e3edaec9fb781929cf54..e235e3a5d3522959d9df3ef5ec4be6c52e1c4bb9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,10 @@
 2007-06-26 Borut Razem <borut.razem AT siol.net>
 
-       * support/regression/generate-cases.py: display warning if function list
-         is empty
+       * support/regression/generate-cases.py: display warning if function
+         list is empty; implemented more flexible rule for detection of
+         testing functions, allowing return type 'void' in the same line as
+         the function name in the function definition
+       * support/regression/tests/bug-1654060.c: corrected test
 
 2007-06-25 Jesus Calvino-Fraga <jesusc at ece.ubc.ca>
 
index 041bac0705a0e9e24bc6f03255262505d884aad9..e5053cddb586eb977f82d3cfbb53bc202ab7b012 100644 (file)
@@ -107,8 +107,7 @@ class InstanceGenerator:
 
         n = 0;
         for fun in self.functions:
-            # Turn the function definition into a pointer
-            fun = re.sub(r'\(\w+\)', '', fun)
+            # Turn the function definition into a function call
             fout.write("  __prints(\"Running " + fun + "\\n\");\n");
             fout.write('  ' + fun + "();\n")
             n += 1;
@@ -157,8 +156,9 @@ class InstanceGenerator:
                     None
             else:
                 # Pull out any test function names
-                if re.search(r'^\W*test\w*\W*\(\W*void\W*\)', line) != None:
-                    self.functions.append(line)
+                m = re.match(r'^(?:\W*void\W+)?\W*(test\w*)\W*\(\W*void\W*\)', line)
+                if m != None:
+                    self.functions.append(m.group(1))
 
     def generate(self):
         """Main function.  Generates all of the instances."""
index bc1bb09f93032a82ea72a62164419882021545b5..6958139bb3214399bc2ac94011261c031b9d518f 100644 (file)
@@ -21,6 +21,6 @@ void testTypedef(void)
 
   ASSERT(c1 == 'A');
   ASSERT(i1 == 12345);
-  ASSERT(c1 == 'B');
-  ASSERT(i1 == 21435);
+  ASSERT(c2 == 'B');
+  ASSERT(i2 == 21435);
 }