httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jchamp...@apache.org
Subject svn commit: r1796203 - in /httpd/httpd/branches/httpdunit: Makefile.in build/httpdunit_gen_cases.pl
Date Thu, 25 May 2017 21:18:34 GMT
Author: jchampion
Date: Thu May 25 21:18:33 2017
New Revision: 1796203

URL: http://svn.apache.org/viewvc?rev=1796203&view=rev
Log:
httpdunit_gen_cases: separate declarations from calls

This gets around strict compiler warnings.

Modified:
    httpd/httpd/branches/httpdunit/Makefile.in
    httpd/httpd/branches/httpdunit/build/httpdunit_gen_cases.pl

Modified: httpd/httpd/branches/httpdunit/Makefile.in
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpdunit/Makefile.in?rev=1796203&r1=1796202&r2=1796203&view=diff
==============================================================================
--- httpd/httpd/branches/httpdunit/Makefile.in (original)
+++ httpd/httpd/branches/httpdunit/Makefile.in Thu May 25 21:18:33 2017
@@ -456,8 +456,11 @@ $(testcase_STUBS): %.tests: %.c
 
 test/httpdunit.cases: $(testcase_SOURCES) | unittest-objdir
 	for t in $^; do \
-	    $(top_srcdir)/build/httpdunit_gen_cases.pl < "$$t"; \
+	    $(top_srcdir)/build/httpdunit_gen_cases.pl --declaration < "$$t"; \
 	done > $@
+	for t in $^; do \
+	    $(top_srcdir)/build/httpdunit_gen_cases.pl < "$$t"; \
+	done >> $@
 
 test/httpdunit.lo: test/httpdunit.c test/httpdunit.cases | unittest-objdir
 

Modified: httpd/httpd/branches/httpdunit/build/httpdunit_gen_cases.pl
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpdunit/build/httpdunit_gen_cases.pl?rev=1796203&r1=1796202&r2=1796203&view=diff
==============================================================================
--- httpd/httpd/branches/httpdunit/build/httpdunit_gen_cases.pl (original)
+++ httpd/httpd/branches/httpdunit/build/httpdunit_gen_cases.pl Thu May 25 21:18:33 2017
@@ -14,10 +14,21 @@
 use strict;
 use warnings;
 
+use Getopt::Long;
+
+my $print_declaration = 0;
+
+GetOptions("declaration" => \$print_declaration)
+    or die("unknown option");
+
 while (my $line = <>) {
     if ($line =~ /^HTTPD_BEGIN_TEST_CASE(?:\w+)?\((\w+)/) {
         my $name = "$1_test_case";
-        print "TCase *$name(void); ";
-        print "suite_add_tcase(suite, $name());\n";
+
+        if ($print_declaration) {
+            print "TCase *$name(void);\n";
+        } else {
+            print "suite_add_tcase(suite, $name());\n";
+        }
     }
 }



Mime
View raw message