You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2001/04/02 20:36:31 UTC
cvs commit: modperl-2.0/t/filter reverse.t
dougm 01/04/02 11:36:31
Modified: Apache-Test/lib/Apache TestConfig.pm TestConfigPerl.pm
TestServer.pm
Added: t/filter reverse.t
Log:
put a warning inside files that are generated
Revision Changes Path
1.2 +17 -5 modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestConfig.pm 2001/04/02 08:58:08 1.1
+++ TestConfig.pm 2001/04/02 18:36:23 1.2
@@ -364,13 +364,25 @@
}
#generate files and directories
+
+sub genwarning {
+ my($self, $type) = @_;
+ return unless $type;
+ return "#WARNING: this file is generated, do not edit\n";
+}
+
sub genfile {
- my($self, $file) = @_;
+ my($self, $file, $warn) = @_;
my $name = abs2rel $file, $self->{vars}->{t_dir};
$self->trace("generating $name");
open my $fh, '>', $file or die "open $file: $!";
+
+ if (my $msg = $self->genwarning($warn)) {
+ print $fh $msg, "\n";
+ }
+
$self->{clean}->{files}->{$file} = 1;
return $fh;
@@ -450,7 +462,7 @@
unless ($self->{inherit_config}->{TypesConfig}) {
my $types = catfile $self->{vars}->{t_conf}, 'mime.types';
unless (-e $types) {
- my $fh = $self->genfile($types);
+ my $fh = $self->genfile($types, 1);
print $fh $self->types_config_template;
close $fh;
}
@@ -478,7 +490,7 @@
my $extra_conf_in = join '.', $extra_conf, 'in';
open(my $in, $extra_conf_in) or return;
- my $out = $self->genfile($extra_conf);
+ my $out = $self->genfile($extra_conf, 1);
$self->replace_vars($in, $out);
close $in;
@@ -507,7 +519,7 @@
my $in = $self->httpd_conf_template($conf_file_in);
- my $out = $self->genfile($conf_file);
+ my $out = $self->genfile($conf_file, 1);
$self->preamble_run($out);
@@ -610,7 +622,7 @@
my $name = 'apache_test_config';
my $file = catfile $self->{vars}->{t_conf}, "$name.pm";
- my $fh = $self->genfile($file);
+ my $fh = $self->genfile($file, 1);
$self->trace("saving config data to $name.pm");
1.2 +3 -3 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm
Index: TestConfigPerl.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestConfigPerl.pm 2001/04/02 08:57:34 1.1
+++ TestConfigPerl.pm 2001/04/02 18:36:24 1.2
@@ -61,7 +61,7 @@
return if -e $t;
$self->gendir($dir);
- my $fh = $self->genfile($t);
+ my $fh = $self->genfile($t, 1);
print $fh <<EOF;
use Apache::TestConfig ();
@@ -93,7 +93,7 @@
#but this will work for both 2.0 and 1.xx
if (my $inc = $self->{inc}) {
my $include_pl = catfile $self->{vars}->{t_conf}, 'modperl_inc.pl';
- my $fh = $self->genfile($include_pl);
+ my $fh = $self->genfile($include_pl, 1);
for (@$inc) {
print $fh "use lib '$_';\n";
}
@@ -107,7 +107,7 @@
my $startup_pl = catfile $self->{vars}->{t_conf}, 'modperl_startup.pl';
unless (-e $startup_pl) {
- my $fh = $self->genfile($startup_pl);
+ my $fh = $self->genfile($startup_pl, 1);
print $fh $self->startup_pl_code;
close $fh;
}
1.2 +1 -1 modperl-2.0/Apache-Test/lib/Apache/TestServer.pm
Index: TestServer.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestServer.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestServer.pm 2001/04/02 08:58:38 1.1
+++ TestServer.pm 2001/04/02 18:36:25 1.2
@@ -78,7 +78,7 @@
my $one_process = $self->version_of(\%one_process);
my $file = catfile $config->{vars}->{serverroot}, '.gdb-test-start';
- my $fh = $config->genfile($file);
+ my $fh = $config->genfile($file, 1);
print $fh "run $one_process $args";
close $fh;
1.1 modperl-2.0/t/filter/reverse.t
Index: reverse.t
===================================================================
#WARNING: this file is generated, do not edit
use Apache::TestConfig ();
print Apache::TestConfig->thaw->http_raw_get("/TestFilter::reverse");