From c9a595d5675b92e37f029548baa3674497df7806 Mon Sep 17 00:00:00 2001 From: borutr Date: Tue, 26 Jun 2007 18:47:44 +0000 Subject: [PATCH 1/1] * support/regression/generate-cases.py: 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 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4861 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 7 +++++-- support/regression/generate-cases.py | 8 ++++---- support/regression/tests/bug-1654060.c | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 422a8700..e235e3a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,10 @@ 2007-06-26 Borut Razem - * 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 diff --git a/support/regression/generate-cases.py b/support/regression/generate-cases.py index 041bac07..e5053cdd 100644 --- a/support/regression/generate-cases.py +++ b/support/regression/generate-cases.py @@ -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.""" diff --git a/support/regression/tests/bug-1654060.c b/support/regression/tests/bug-1654060.c index bc1bb09f..6958139b 100644 --- a/support/regression/tests/bug-1654060.c +++ b/support/regression/tests/bug-1654060.c @@ -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); } -- 2.30.2