mirror of
https://github.com/apache/httpd.git
synced 2025-07-23 00:50:44 +00:00

Add a unit test suite based on Check: https://libcheck.github.io/check/ The suite depends on the build system to automatically generate the code stubs that call every test case. httpdunit is automatically enabled in the build if configure is able to find Check via pkg-config. At the moment pkg-config is the only official (non-deprecated) way to build and link against Check with an autoconf system, since platforms may distribute Check as a static library. Note that Check is an LGPL'd library, so we can't distribute test objects and binaries. Building and running the suite remains optional and is not required to run the server. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpdunit@1796202 13f79535-47bb-0310-9956-ffa450edef68
23 lines
677 B
Perl
Executable File
23 lines
677 B
Perl
Executable File
#! /usr/bin/env perl
|
|
|
|
#
|
|
# Generates a code stub that adds unit tests to a Check test case.
|
|
#
|
|
# Supply the test case's source file contents on stdin; the resulting code will
|
|
# be printed to stdout. This code is designed to be included as part of the
|
|
# boilerplate at the end of each test case.
|
|
#
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
while (my $line = <>) {
|
|
# FIXME: this does not correctly handle macro invocations that are split
|
|
# over multiple lines.
|
|
if ($line =~ /^HTTPD_START_LOOP_TEST\((\w+),(.*)\)/) {
|
|
print "tcase_add_loop_test(testcase, $1, 0, ($2));\n";
|
|
} elsif ($line =~ /^START_TEST\((\w+)\)/) {
|
|
print "tcase_add_test(testcase, $1);\n"
|
|
}
|
|
}
|