gnu: netsurf: Enable tests.

* gnu/packages/patches/netsurf-longer-test-timeout.patch,
gnu/packages/patches/netsurf-y2038-tests.patch: New patches.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/web.scm (netsurf)[source]: Use them.
[native-inputs]: Add libidn, check.
[inputs]: Add miscfiles.
[arguments]: Remove #:tests?, add #:test-target.  Add 'patch-check phase.
This commit is contained in:
Eric Bavier 2017-02-12 19:51:43 -06:00
parent 710806b57b
commit 4fc282b32a
No known key found for this signature in database
GPG Key ID: 1EBBD204781F962C
4 changed files with 63 additions and 3 deletions

View File

@ -773,6 +773,8 @@ dist_patch_DATA = \
%D%/packages/patches/netcdf-date-time.patch \ %D%/packages/patches/netcdf-date-time.patch \
%D%/packages/patches/netcdf-tst_h_par.patch \ %D%/packages/patches/netcdf-tst_h_par.patch \
%D%/packages/patches/netsurf-system-utf8proc.patch \ %D%/packages/patches/netsurf-system-utf8proc.patch \
%D%/packages/patches/netsurf-y2038-tests.patch \
%D%/packages/patches/netsurf-longer-test-timeout.patch \
%D%/packages/patches/ngircd-handle-zombies.patch \ %D%/packages/patches/ngircd-handle-zombies.patch \
%D%/packages/patches/ngircd-no-dns-in-tests.patch \ %D%/packages/patches/ngircd-no-dns-in-tests.patch \
%D%/packages/patches/ninja-tests.patch \ %D%/packages/patches/ninja-tests.patch \

View File

@ -0,0 +1,20 @@
Increase the timeout on dictionary tests to accommodate slower machines.
--- netsurf-3.6/test/hashtable.c
+++ netsurf-3.6/test/hashtable.c
@@ -286,6 +286,7 @@
tcase_add_checked_fixture(tc_dict_s,
dicts_hashtable_create,
dict_hashtable_teardown);
+ tcase_set_timeout(tc_dict_s, 30);
tcase_add_test(tc_dict_s, hashtable_dict_test);
@@ -297,6 +298,7 @@
tcase_add_checked_fixture(tc_dict_l,
dictl_hashtable_create,
dict_hashtable_teardown);
+ tcase_set_timeout(tc_dict_l, 30);
tcase_add_test(tc_dict_l, hashtable_dict_test);

View File

@ -0,0 +1,25 @@
These two test cases fail for us on i686.
See https://en.wikipedia.org/wiki/Year_2038_problem
--- netsurf-3.6/test/time.c
+++ netsurf-3.6/test/time.c
@@ -77,18 +77,10 @@
.expected = "Tue, 12 Jun 2001 12:12:12 GMT"
},
{
- .test = "Thu, 16 Jul 2207 12:45:12 GMT",
- .expected = "Thu, 16 Jul 2207 12:45:12 GMT"
- },
- {
.test = "Thu, 16 Aug 2007 19:45:12 GMT",
.expected = "Thu, 16 Aug 2007 19:45:12 GMT"
},
{
- .test = "Tue, 16 Sep 3456 00:45:12 GMT",
- .expected = "Tue, 16 Sep 3456 00:45:12 GMT"
- },
- {
.test = "Sun, 16 Oct 1988 19:45:59 GMT",
.expected = "Sun, 16 Oct 1988 19:45:59 GMT"
},

View File

@ -65,11 +65,13 @@
#:use-module (gnu packages gettext) #:use-module (gnu packages gettext)
#:use-module (gnu packages glib) #:use-module (gnu packages glib)
#:use-module (gnu packages gnome) #:use-module (gnu packages gnome)
#:use-module (gnu packages gnu-doc)
#:use-module (gnu packages gnupg) #:use-module (gnu packages gnupg)
#:use-module (gnu packages gperf) #:use-module (gnu packages gperf)
#:use-module (gnu packages gtk) #:use-module (gnu packages gtk)
#:use-module (gnu packages icu4c) #:use-module (gnu packages icu4c)
#:use-module (gnu packages image) #:use-module (gnu packages image)
#:use-module (gnu packages libidn)
#:use-module (gnu packages lua) #:use-module (gnu packages lua)
#:use-module (gnu packages ncurses) #:use-module (gnu packages ncurses)
#:use-module (gnu packages base) #:use-module (gnu packages base)
@ -4076,11 +4078,15 @@ w3c webidl files and a binding configuration file.")
(sha256 (sha256
(base32 (base32
"174sjx0566agckwmlj4w2cip5qbxdiafyhlp185a1qprxx84pbjr")) "174sjx0566agckwmlj4w2cip5qbxdiafyhlp185a1qprxx84pbjr"))
(patches (search-patches "netsurf-system-utf8proc.patch")))) (patches (search-patches "netsurf-system-utf8proc.patch"
"netsurf-y2038-tests.patch"
"netsurf-longer-test-timeout.patch"))))
(build-system glib-or-gtk-build-system) (build-system glib-or-gtk-build-system)
(native-inputs (native-inputs
`(("netsurf-buildsystem" ,netsurf-buildsystem) `(("netsurf-buildsystem" ,netsurf-buildsystem)
("nsgenbind" ,nsgenbind) ("nsgenbind" ,nsgenbind)
("libidn" ,libidn) ;only for tests
("check" ,check)
("perl" ,perl) ("perl" ,perl)
("perl-html-parser" ,perl-html-parser) ("perl-html-parser" ,perl-html-parser)
("pkg-config" ,pkg-config))) ("pkg-config" ,pkg-config)))
@ -4097,7 +4103,8 @@ w3c webidl files and a binding configuration file.")
("libnsgif" ,libnsgif) ("libnsgif" ,libnsgif)
("libnspsl" ,libnspsl) ("libnspsl" ,libnspsl)
("libnsutils" ,libnsutils) ("libnsutils" ,libnsutils)
("libsvgtiny" ,libsvgtiny))) ("libsvgtiny" ,libsvgtiny)
("miscfiles" ,miscfiles)))
(arguments (arguments
`(#:make-flags `("CC=gcc" "BUILD_CC=gcc" `(#:make-flags `("CC=gcc" "BUILD_CC=gcc"
,(string-append "PREFIX=" %output) ,(string-append "PREFIX=" %output)
@ -4105,7 +4112,7 @@ w3c webidl files and a binding configuration file.")
(assoc-ref %build-inputs (assoc-ref %build-inputs
"netsurf-buildsystem") "netsurf-buildsystem")
"/share/netsurf-buildsystem")) "/share/netsurf-buildsystem"))
#:tests? #f #:test-target "test"
#:modules ((ice-9 rdelim) #:modules ((ice-9 rdelim)
(ice-9 match) (ice-9 match)
(srfi srfi-1) (srfi srfi-1)
@ -4144,6 +4151,12 @@ w3c webidl files and a binding configuration file.")
(x x))) (x x)))
out))) out)))
#t)) #t))
(add-before 'check 'patch-check
(lambda* (#:key inputs #:allow-other-keys)
(substitute* '("test/bloom.c" "test/hashtable.c")
(("/usr/share/dict/words")
(string-append (assoc-ref inputs "miscfiles") "/share/web2")))
#t))
(add-after 'install 'install-more (add-after 'install 'install-more
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))