From 37a5acc3a31215c52d368aaf13d06b21e3814507 Mon Sep 17 00:00:00 2001 From: rurban Date: Mon, 6 Sep 2004 08:30:44 +0000 Subject: [PATCH] configurable baseurl git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3927 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- tests/maketest.pl | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/maketest.pl b/tests/maketest.pl index 14c914ed6..3d648d4e9 100644 --- a/tests/maketest.pl +++ b/tests/maketest.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: maketest.pl,v 1.3 2002-01-29 22:10:24 wainstead Exp $ +# $Id: maketest.pl,v 1.4 2004-09-06 08:30:44 rurban Exp $ # read in a file, generate Java code to run a test. # Steve Wainstead, March 2001. @@ -9,20 +9,26 @@ # but a fairly cut and dry script relying on "if" clauses to parse the input # files. It was the shortest route to the answer for now, though certainly not # the best one. - -use constant BASEURL => 'http://127.0.0.1/~swain/projects/phpwiki-1.3.x/'; +# die <<"EOLN" unless $ARGV[0]; -Usage: $0 [ ... ] +Usage: $0 [-b baseurl] [ ... ] where 'inputfile' is the name of a configuration file that specifies the form fields and values. The name of the file should be similar to ClassName.inputs, and this script will produce a Java file called ClassName.java. EOLN -#print "passed in: ", join(" ", @ARGV), "\n"; +#use constant BASEURL => 'http://127.0.0.1/~swain/projects/phpwiki-1.3.x/'; +my $baseurl = 'http://127.0.0.1/~swain/projects/phpwiki-1.3.x/'; +my (%opts); +use Getopt::Std; +getopt('b', \%opts); +# TODO: Get the BASEURL from config.ini +$baseurl = $opts{b} if $opts{b}; +#print "passed in: ", join(" ", @ARGV), "\n"; my ($start_of_file, $end_of_file); # read in the skeleton file from this script below the END tag @@ -111,7 +117,7 @@ EOLN sub starting_page { my $block = shift; $block =~ m/start_url:\s*(http.*?)$/m; - my $start_url = BASEURL . $1; + my $start_url = $baseurl . $1; my $assertions = &get_assertions($block); print OUTFILE <<"EOLN" -- 2.45.0