File: executable-path-in-tests.patch

package info (click to toggle)
libapp-wdq-perl 0.4.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 336 kB
  • sloc: perl: 929; makefile: 4
file content (119 lines) | stat: -rw-r--r-- 3,401 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Description: Using $PATH-based executables in order to reuse same upstream
 test suite for build tests and autopkgtest.
Author: Andrius Merkys <merkys@debian.org>
Forwarded: not-needed
--- a/t/bin.t
+++ b/t/bin.t
@@ -3,7 +3,7 @@
 use Test::Output;
 
 my $exit;
-sub wdq { system($^X, 'script/wdq', @_); $exit = $? >> 8 }
+sub wdq { system('wdq', @_); $exit = $? >> 8 }
 sub slurp { local (@ARGV,$/) = shift; <> }
 
 foreach my $opt (qw(--help -h -?)) {
--- a/t/format.t
+++ b/t/format.t
@@ -3,7 +3,7 @@
 use Test::Output;
 
 my $exit;
-sub wdq { system($^X, qw(script/wdq --response t/examples/response.json), @_) }
+sub wdq { system(qw(wdq --response t/examples/response.json), @_) }
 
 stdout_is { wdq qw(-q t/examples/query.query -fjson -i) } <<'OUT', 'json';
 {
--- a/t/format-text.t
+++ b/t/format-text.t
@@ -3,7 +3,7 @@
 use Test::Output;
 
 sub wdq {
-    system( $^X, qw(script/wdq search --res t/examples/search.json), @_ );
+    system( qw(wdq search --res t/examples/search.json), @_ );
 }
 
 my $text = <<TEXT;
--- a/t/lookup.t
+++ b/t/lookup.t
@@ -17,7 +17,7 @@
 }
 SPARQL
 
-stdout_is { system("$^X script/wdq lookup -gfr -n < t/examples/lookup") }
+stdout_is { system("wdq lookup -gfr -n < t/examples/lookup") }
     $sparql x 8, 'lookup given qid from STDIN';
 
 my @sitelinks = (
@@ -25,16 +25,16 @@
     "\thttps://de.wikipedia.org/wiki/Erd%C5%91s-Zahl\n",
 );
 
-output_is { system($^X, 'script/wdq', '-N', 'lookup', @sitelinks) }
+output_is { system('wdq', '-N', 'lookup', @sitelinks) }
     "", "MediaWiki API disabled\n", "--no-mediawiki --no-execute";
 
 SKIP: {
     skip 'release test requiring network', 1 unless $ENV{RELEASE_TESTING};
     
-    output_is { system($^X, 'script/wdq', '-gfr', '-n', @sitelinks) }
+    output_is { system('wdq', '-gfr', '-n', @sitelinks) }
         $sparql x 2, "", "N: lookup Wikidata id via MediaWiki API";
 
-    my $cmd = "echo $sitelinks[0] | $^X script/wdq -gen lookup -f csv -Hi";
+    my $cmd = "echo $sitelinks[0] | wdq -gen lookup -f csv -Hi";
     stdout_like { system($cmd) }
         qr{^Q243972,Erdős}, "N: lookup via MediaWiki API and SPARQL (STDIN)";
 }
@@ -44,7 +44,7 @@
     $sparql =~ s/"fr"/"es,en-simple"/m;
 
     my $cmd = join ' ', 
-        "$^X script/wdq --language es,en-simple -n",
+        "wdq --language es,en-simple -n",
         'http://www.wikidata.org/wiki/Property:P7', 
         'Property:P7', ' P7', 'p7 ';
 
--- a/t/options.t
+++ b/t/options.t
@@ -2,7 +2,7 @@
 use Test::More;
 use Test::Output;
 
-my $wdq = "$^X script/wdq";
+my $wdq = "wdq";
 my $res = "--response t/examples";
 
 # enumerate (-e), identifier (-i)
--- a/t/query.t
+++ b/t/query.t
@@ -2,7 +2,7 @@
 use Test::More;
 use Test::Output;
 
-sub wdq { system( $^X, 'script/wdq', '-n', @_ ) }
+sub wdq { system( 'wdq', '-n', @_ ) }
 sub slurp { local (@ARGV,$/) = shift; <> }
 
 my $sparql = <<SPARQL;
@@ -40,7 +40,7 @@
 }
 SPARQL
 
-stdout_is { system( $^X, 'script/wdq', '-cx', '?x wdt:P31 wd:Q5633421', 
+stdout_is { system( 'wdq', '-cx', '?x wdt:P31 wd:Q5633421', 
                          '--response', 't/examples/count.json', '-ftext' ) }
     "63107\n", 'text format for count';
 
--- a/t/search.t
+++ b/t/search.t
@@ -3,7 +3,7 @@
 use Test::Output;
 
 sub wdq {
-    my $c = join ' ', $^X, qw(script/wdq -gde --res t/examples/search.json), @_;
+    my $c = join ' ', qw(wdq -gde --res t/examples/search.json), @_;
     `$c`;
 }