backport: allow needles to be in nested directories (jskladan)

f38
Adam Williamson 9 years ago
parent 218c0d73f8
commit d9603ff7aa

@ -0,0 +1,43 @@
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:
-

@ -31,7 +31,7 @@
Name: os-autoinst Name: os-autoinst
Version: %{github_version} Version: %{github_version}
Release: 5%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} Release: 6%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
Summary: OS-level test automation Summary: OS-level test automation
License: GPLv2+ License: GPLv2+
Group: Development/System Group: Development/System
@ -40,6 +40,13 @@ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{gith
# Fix 'format not a literal' warnings in snd2png # Fix 'format not a literal' warnings in snd2png
# https://github.com/os-autoinst/os-autoinst/pull/386 # https://github.com/os-autoinst/os-autoinst/pull/386
Patch0: 0001-use-fputs-rather-than-fprintf-to-avoid-format-not-a-.patch Patch0: 0001-use-fputs-rather-than-fprintf-to-avoid-format-not-a-.patch
# Backport: allow needles to be in nested directories
# NOTE: rebased to 4.3 (by jskladan)
# https://github.com/os-autoinst/os-autoinst/commit/e703c755c80a244949f3dcb213d7646b28b25992
# https://github.com/os-autoinst/os-autoinst/commit/1e4296de4c9d96ec65bbc30bb2677df7803470fe
# https://github.com/os-autoinst/os-autoinst/commit/3b8e9fe7dbcb4bdf15d9c5d291875393db190067
Patch1: needles-in-dirs.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -187,6 +194,9 @@ make check VERBOSE=1
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf
%changelog %changelog
* Thu Mar 31 2016 Adam Williamson <awilliam@redhat.com> - 4.3-6
- backport: allow needles to be in nested directories (jskladan)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.3-5 * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

Loading…
Cancel
Save