summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-01-21 16:57:15 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-01-21 17:14:25 +0200
commit5353f19c8110ded6608b2450d359dab26d63dbf3 (patch)
tree4618d761b4e21b5bef64a8c494191b5f7235467c
parent46a4bcd3035126a51a341d88612f971bd2efa079 (diff)
downloadacpp-5353f19c8110ded6608b2450d359dab26d63dbf3.tar.gz
acpp-5353f19c8110ded6608b2450d359dab26d63dbf3.tar.bz2
locus testsuite: fix synclines comparison
The fix introduced in 928cd662 didn't work quite well on mswin, because Cwd::abs_path in many places inserts literal '/', instead of os-specific directory separators (see e.g. Cwd.pm:652, for version 3.40). This commit replaces os-specific separators with '/' when formatting synclines. * t/TestPreproc.pm (new): Revert 928cd662. (dump_reformat_synclines_worker): When formatting synclines, replace each occurrence of directory separator with /. * t/06locus00.t: Revert 928cd662. * t/06locus01.t: Likewise. * t/06locus02.t: Likewise. * t/06locus03.t: Likewise. * t/06locus04.t: Likewise. * t/06locus05.t: Likewise. * t/06locus06.t: Likewise.
-rw-r--r--t/06locus00.t8
-rw-r--r--t/06locus01.t16
-rw-r--r--t/06locus02.t34
-rw-r--r--t/06locus03.t20
-rw-r--r--t/06locus04.t8
-rw-r--r--t/06locus05.t10
-rw-r--r--t/06locus06.t22
-rw-r--r--t/TestPreproc.pm5
8 files changed, 62 insertions, 61 deletions
diff --git a/t/06locus00.t b/t/06locus00.t
index d311e96..543760d 100644
--- a/t/06locus00.t
+++ b/t/06locus00.t
@@ -19,17 +19,17 @@ __DATA__
# End of file
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
# Start of file
# $server_root/httpd.conf:2
-# {{$server_root/httpd.conf}}:3-5
+# $server_root/httpd.conf:3-5
# Comment 1
# Comment 2
# Comment 3
-# {{$server_root/httpd.conf}}:6-7
+# $server_root/httpd.conf:6-7
-# {{$server_root/httpd.conf}}:8
+# $server_root/httpd.conf:8
# End of file
!$
diff --git a/t/06locus01.t b/t/06locus01.t
index f1010b2..407e2a6 100644
--- a/t/06locus01.t
+++ b/t/06locus01.t
@@ -21,20 +21,20 @@ __DATA__
# End of file
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
# Start of file
-# {{$server_root/httpd.conf}}:2
+# $server_root/httpd.conf:2
-# {{$server_root/httpd.conf}}:3
+# $server_root/httpd.conf:3
# Comment 1
-# {{$server_root/httpd.conf}}:4
+# $server_root/httpd.conf:4
# Comment 2
-# {{$server_root/httpd.conf}}:5
+# $server_root/httpd.conf:5
# Comment 3
-# {{$server_root/httpd.conf}}:6
+# $server_root/httpd.conf:6
-# {{$server_root/httpd.conf}}:7
+# $server_root/httpd.conf:7
-# {{$server_root/httpd.conf}}:8
+# $server_root/httpd.conf:8
# End of file
!$
diff --git a/t/06locus02.t b/t/06locus02.t
index f4c749d..8a09987 100644
--- a/t/06locus02.t
+++ b/t/06locus02.t
@@ -31,41 +31,41 @@ ServerAdmin foo@example.net
# End of file
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
# Start of file
-# {{$server_root/httpd.conf}}:2
+# $server_root/httpd.conf:2
ServerName localhost
-# {{$server_root/httpd.conf}}:3
+# $server_root/httpd.conf:3
-# {{$server_root/httpd.conf}}:4
+# $server_root/httpd.conf:4
ServerAdmin foo@example.net
-# {{$server_root/httpd.conf}}:5
+# $server_root/httpd.conf:5
-# {{$server_root/httpd.conf}}:6-13
+# $server_root/httpd.conf:6-13
<VirtualHost *:80>
-# {{$server_root/httpd.conf}}:7
+# $server_root/httpd.conf:7
ServerName foo
-# {{$server_root/httpd.conf}}:8
+# $server_root/httpd.conf:8
DocumentRoot a
-# {{$server_root/httpd.conf}}:9-12
+# $server_root/httpd.conf:9-12
<Directory a>
-# {{$server_root/httpd.conf}}:10
+# $server_root/httpd.conf:10
AllowOverride none
-# {{$server_root/httpd.conf}}:11
+# $server_root/httpd.conf:11
Require all granted
</Directory>
</VirtualHost>
-# {{$server_root/httpd.conf}}:14
+# $server_root/httpd.conf:14
-# {{$server_root/httpd.conf}}:15-18
+# $server_root/httpd.conf:15-18
<VirtualHost *:80>
-# {{$server_root/httpd.conf}}:16
+# $server_root/httpd.conf:16
ServerName bar
-# {{$server_root/httpd.conf}}:17
+# $server_root/httpd.conf:17
DocumentRoot b
</VirtualHost>
-# {{$server_root/httpd.conf}}:19
+# $server_root/httpd.conf:19
-# {{$server_root/httpd.conf}}:20
+# $server_root/httpd.conf:20
# End of file
!$
diff --git a/t/06locus03.t b/t/06locus03.t
index bedf3a3..37b4c1f 100644
--- a/t/06locus03.t
+++ b/t/06locus03.t
@@ -27,26 +27,26 @@ PidFile logs/httpd.pid
DocumentRoot b
</VirtualHost>
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
# Start of file
-# {{$server_root/httpd.conf}}:2
+# $server_root/httpd.conf:2
ServerRoot "$server_root"
-# {{$server_root/httpd.conf}}:3
+# $server_root/httpd.conf:3
ServerAdmin foo@example.net
-# {{$server_root/vhost1.conf}}:1-4
+# $server_root/vhost1.conf:1-4
<VirtualHost *:80>
-# {{$server_root/vhost1.conf}}:2
+# $server_root/vhost1.conf:2
ServerName foo
-# {{$server_root/vhost1.conf}}:3
+# $server_root/vhost1.conf:3
DocumentRoot a
</VirtualHost>
-# {{$server_root/vhost2.conf}}:1-4
+# $server_root/vhost2.conf:1-4
<VirtualHost *:80>
-# {{$server_root/vhost2.conf}}:2
+# $server_root/vhost2.conf:2
ServerName bar
-# {{$server_root/vhost2.conf}}:3
+# $server_root/vhost2.conf:3
DocumentRoot b
</VirtualHost>
-# {{$server_root/httpd.conf}}:6
+# $server_root/httpd.conf:6
PidFile logs/httpd.pid
!$
diff --git a/t/06locus04.t b/t/06locus04.t
index 6e1ced4..3d173c9 100644
--- a/t/06locus04.t
+++ b/t/06locus04.t
@@ -18,13 +18,13 @@ ServerRoot "$server_root"
EndStatement true
Use X bar
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
# Start of file
-# {{$server_root/httpd.conf}}:2
+# $server_root/httpd.conf:2
ServerRoot "$server_root"
-# {{$server_root/httpd.conf}}:6
+# $server_root/httpd.conf:6
EndStatement true
-# {{$server_root/httpd.conf}}:4
+# $server_root/httpd.conf:4
Foo bar
!$
diff --git a/t/06locus05.t b/t/06locus05.t
index ea82674..9d04aee 100644
--- a/t/06locus05.t
+++ b/t/06locus05.t
@@ -22,7 +22,7 @@ ServerAdmin foo
ServerName localhost
</IfDefine>
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
ServerAdmin foo
!$
__END__
@@ -32,9 +32,9 @@ ServerAdmin foo
ServerName localhost
</IfDefine>
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
ServerAdmin foo
-# {{$server_root/httpd.conf}}:3
+# $server_root/httpd.conf:3
ServerName localhost
!$
__END__
@@ -44,8 +44,8 @@ ServerAdmin foo
ServerName localhost
</IfDefine>
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
ServerAdmin foo
-# {{$server_root/httpd.conf}}:3
+# $server_root/httpd.conf:3
ServerName localhost
!$
diff --git a/t/06locus06.t b/t/06locus06.t
index bf58bb5..fa55839 100644
--- a/t/06locus06.t
+++ b/t/06locus06.t
@@ -61,26 +61,26 @@ LoadModule unixd_module lib/httpd/modules/mod_unixd.so
MaxRequestsPerChild 0
</IfModule>
!=
-# {{$server_root/httpd.conf}}:1
+# $server_root/httpd.conf:1
LoadModule mpm_prefork_module lib/httpd/modules/mod_mpm_prefork.so
-# {{$server_root/httpd.conf}}:2
+# $server_root/httpd.conf:2
LoadModule unixd_module lib/httpd/modules/mod_unixd.so
-# {{$server_root/httpd.conf}}:3
+# $server_root/httpd.conf:3
-# {{$server_root/httpd.conf}}:5
+# $server_root/httpd.conf:5
PidFile "/var/run/httpd.pid"
-# {{$server_root/httpd.conf}}:8
+# $server_root/httpd.conf:8
StartServers 1
-# {{$server_root/httpd.conf}}:9
+# $server_root/httpd.conf:9
MinSpareServers 1
-# {{$server_root/httpd.conf}}:10
+# $server_root/httpd.conf:10
MaxSpareServers 1
-# {{$server_root/httpd.conf}}:11
+# $server_root/httpd.conf:11
MaxClients 10
-# {{$server_root/httpd.conf}}:12
+# $server_root/httpd.conf:12
MaxRequestsPerChild 0
-# {{$server_root/httpd.conf}}:43
+# $server_root/httpd.conf:43
User apache
-# {{$server_root/httpd.conf}}:44
+# $server_root/httpd.conf:44
Group apache
!$
diff --git a/t/TestPreproc.pm b/t/TestPreproc.pm
index d4d8a58..d8e518c 100644
--- a/t/TestPreproc.pm
+++ b/t/TestPreproc.pm
@@ -48,8 +48,6 @@ sub new {
$fd = undef;
} elsif ($fd) {
s/\$server_root/$dir/;
- s/{{(.+)}}
- /File::Spec->catfile(split m{\/}, $1)/gex;
print $fd $_;
}
}
@@ -79,8 +77,11 @@ sub dump_reformat_synclines {
sub dump_reformat_synclines_worker {
my ($tree, $dir) = @_;
+ my $sep = qr(File::Spec->catfile('',''));
+
join('', map {
(my $l = $_->locus->format) =~ s{$dir/}{}g;
+ $l =~ s{$sep}{/}g;
"# $l\n" .
do {
if ($_->type eq 'section') {

Return to:

Send suggestions and report system problems to the System administrator.