You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
os-autoinst/needles-in-dirs.patch

44 lines
1.3 KiB

diff --git a/basetest.pm b/basetest.pm
index 8a05ceb..dac0ef1 100755
--- a/basetest.pm
+++ b/basetest.pm
@@ -106,6 +106,7 @@ sub record_screenmatch {
screenshot => sprintf("%s-%d.png", $testname, $count),
result => 'ok',
properties => [@$properties],
+ json => $h->{json},
};
# When the needle has the workaround property,
@@ -155,9 +156,10 @@ sub _serialize_match {
my $candidates;
my $diffcount = 0;
- my $name = $cand->{needle}->{name};
+ my $name = $cand->{needle}->{name};
+ my $jsonfile = $cand->{needle}->{file};
- my $h = {name => $name, error => $cand->{error}, area => []};
+ my $h = {name => $name, error => $cand->{error}, area => [], json => $jsonfile};
for my $a (@{$cand->{area}}) {
my $na = {};
for my $i (qw/x y w h result/) {
diff --git a/needle.pm b/needle.pm
index e9da38b..fdb8e85 100755
--- a/needle.pm
+++ b/needle.pm
@@ -37,7 +37,7 @@ sub new {
my $json;
if (ref $jsonfile eq 'HASH') {
$json = $jsonfile;
- $jsonfile = join('/', $needledir, $json->{name} . '.json');
+ $jsonfile = $json->{file} || join('/', $needledir, $json->{name} . '.json');
}
else {
local $/;
@@ -238,4 +238,3 @@ sub all {
1;
# vim: set sw=4 et:
-