unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: boost: Enable tests.
@ 2016-01-15 20:59 Eric Bavier
  2016-01-17 12:49 ` Andreas Enge
  2016-01-20 22:34 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Bavier @ 2016-01-15 20:59 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 573 bytes --]

This patch turns boost package tests on.  22 of 120 test suites are 
skipped due to know test failures, many of which still fail with the 
upstream development version 
(http://www.boost.org/development/tests/master/developer/summary.html).

Building and running the tests obviously adds to the overall build time, 
but I think most of us here are in agreement that running tests is 
better than not.

It would be nice to get this patch tested on MIPS or ARM, in case there 
are other failing test suites that should be documented and skipped on 
those systems.

-- 
`~Eric

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-boost-Enable-tests.patch --]
[-- Type: text/x-diff; name=0001-gnu-boost-Enable-tests.patch, Size: 7972 bytes --]

From 76322bff6b4de1c0fe810506f451de733c60683a Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Fri, 15 Jan 2016 14:46:26 -0600
Subject: [PATCH] gnu: boost: Enable tests.

* gnu/packages/boost.scm (boost)[arguments]: Replace 'check' phase.
---
 gnu/packages/boost.scm | 122 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 121 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 0a644e8..a69ebc2 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -66,7 +66,11 @@
                     '("--without-context"
                       "--without-coroutine" "--without-coroutine2")
                     '()))))
-       `(#:tests? #f
+       `(#:modules ((ice-9 rdelim)
+                    (ice-9 regex)
+                    (srfi srfi-1)
+                    (guix build gnu-build-system)
+                    (guix build utils))
          #:phases
          (modify-phases %standard-phases
            (replace
@@ -92,6 +96,122 @@
             (lambda* (#:key outputs #:allow-other-keys)
               (zero? (system* "./b2" ,@build-flags))))
            (replace
+            'check
+            ;; The provided method for running all tests (executing b2 in the
+            ;; "status" directory) requires a large amount of disk space
+            ;; (>20G) because it does not clean up build artifacts after
+            ;; successfully running a test suite.  So instead we run each test
+            ;; individually, which only requires ~7.7G.
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((b2 (string-append (getcwd) "/b2"))
+                    (test-dirs
+                     ;; The instructions at
+                     ;; http://www.boost.org/development/running_regression_tests.html
+                     ;; to run b2 in each libs/<library>/test is not entirely
+                     ;; accurate.  Some tests are in subdirectories and others
+                     ;; in top-level directories.  So instead we read the list
+                     ;; of test directories from status/Jamfile.v2
+                     (let ((port (open-input-file "status/Jamfile.v2"))
+                           (start-rx (make-regexp "^run-tests libs :"))
+                           (end-rx (make-regexp "^[[:space:]]*;"))
+                           (dir-rx (make-regexp "^[[:space:]]*([a-z0-9/_]+)")))
+                       (let loop ((collecting #f)
+                                  (dirs '()))
+                         (let* ((line (read-line port))
+                                (start (regexp-exec start-rx line))
+                                (end (regexp-exec end-rx line)))
+                           (cond
+                            (start (loop #t dirs))
+                            ((and collecting end)
+                             (begin
+                               (close-port port)
+                               (reverse! dirs)))
+                            (collecting
+                             (loop #t (cons (match:substring
+                                             (regexp-exec dir-rx line)
+                                             1)
+                                            dirs)))
+                            (else (loop #f dirs)))))))
+                    ;; Several libraries have known-failing test cases, so
+                    ;; skip those.
+                    (skip '(;; Some tests have not been updated for changes in
+                            ;; Boost.Random,
+                            ;; e.g. weighted_p_square_cumul_dist.cpp
+                            "accumulators"
+                            ;; Some tests fail with 'Network is unreachable'
+                            "asio"
+                            ;; ptr_list_inserter fails with 'check
+                            ;; typeid(*--a_set.end()) == typeid(FooBar) has
+                            ;; failed'
+                            "assign"
+                            ;; stl_concept_covering: error: no match for
+                            ;; 'operator=='
+                            "concept_check"
+                            ;; bench_alloc.test: error: 'assert' was not
+                            ;; declared in this scope.
+                            "container/bench"
+                            ;; Compilation failures: member_ccs,
+                            ;; member_ccs_exact, nonmember_ccs,
+                            ;; nonmember_ccs_exact.
+                            "function_types"
+                            ;; 10 compilation failures: adj_matrix_cc,
+                            ;; adjacency_matrix_test,
+                            ;; boykob_kolmahorov_max_flow_test,
+                            ;; bundled_properties, csr_graph_test,
+                            ;; cycle_ratio_tests, floy_warshall_test,
+                            ;; matching_test, metric_tsp_approx, and
+                            ;; test_graphs.
+                            "graph"
+                            ;; Compilation failure in concept_tests
+                            "iterator"
+                            ;; Compilation errors when boost is built with
+                            ;; both shared and static libraries?
+                            "lockfree"
+                            ;; Loss of precision in test
+                            ;; test_cpp_bin_float_io_1
+                            "multiprecision"
+                            ;; Compilation issues
+                            "proto"
+                            ;; error: 'BOOST_MESSAGE' was not declared in this
+                            ;; scope.
+                            "ptr_container"
+                            ;; Compilation failures, e.g. voidptr - "error:
+                            ;; no matching call to 'registry_lookup2'"
+                            "python"
+                            ;; error: expected initializer before ‘namespace’
+                            "rational"
+                            ;; error "lambda functions required"
+                            "scope_exit"
+                            ;; Compilation failures: karma_repo_subrule and
+                            ;; qi_repo_subrule
+                            "spirit/repository"
+                            ;; error: inappropriate use of sizeof on
+                            ;; incomplete type.
+                            "statechart"
+                            ;; fails Boost Inspection Report test
+                            "timer"
+                            ;; fail: run_random
+                            "tr1"
+                            ;; Executation fail: compressed_pair_test
+                            "utility"
+                            ;; Execution failures: "no variadic macro support
+                            ;; in function ..."
+                            "vmd"
+                            ;; testwave test t_9_024.cpp fails
+                            "wave")))
+                (every                  ;stop immediately if any test fails
+                 (lambda (dir)
+                   (with-directory-excursion (string-append "libs/" dir)
+                     (and (zero? (system* b2 ,@build-flags)) ;run tests
+                          ;; Clean each test directory after successful run in
+                          ;; order to minimize disk space requirements.
+                          (zero? (system* b2 ,@build-flags "clean")))))
+                 (remove (lambda (d)
+                           (any (lambda (s)
+                                  (string-prefix? s d))
+                                skip))
+                         test-dirs)))))
+           (replace
             'install
             (lambda* (#:key outputs #:allow-other-keys)
               (zero? (system* "./b2" "install" ,@build-flags))))))))
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: boost: Enable tests.
  2016-01-15 20:59 [PATCH] gnu: boost: Enable tests Eric Bavier
@ 2016-01-17 12:49 ` Andreas Enge
  2016-01-20 22:34 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Enge @ 2016-01-17 12:49 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

Hello,

On Fri, Jan 15, 2016 at 02:59:04PM -0600, Eric Bavier wrote:
> It would be nice to get this patch tested on MIPS or ARM, in case there are
> other failing test suites that should be documented and skipped on those
> systems.

on arm, it fails with the following message:
**passed** ../../../bin.v2/libs/date_time/test/testtime_serialize.test/gcc-4.9.3/debug/threading-multi/testtime_serialize.test
...failed updating 1 target...
...skipped 1 target...
...updated 656 targets...
phase `check' failed after 6469.4 seconds

At a casual glance I did not find the place where the error occurs, so
I am attaching the full build log.

Andreas


[-- Attachment #2: n7946zdac9lvk07yw81lmlq7l30lgw-boost-1.60.0.drv.bz2 --]
[-- Type: application/octet-stream, Size: 280904 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: boost: Enable tests.
  2016-01-15 20:59 [PATCH] gnu: boost: Enable tests Eric Bavier
  2016-01-17 12:49 ` Andreas Enge
@ 2016-01-20 22:34 ` Ludovic Courtès
  2016-01-21  0:01   ` Eric Bavier
  1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2016-01-20 22:34 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

Eric Bavier <ericbavier@openmailbox.org> skribis:

> This patch turns boost package tests on.  22 of 120 test suites are
> skipped due to know test failures, many of which still fail with the
> upstream development version
> (http://www.boost.org/development/tests/master/developer/summary.html).
>
> Building and running the tests obviously adds to the overall build
> time, but I think most of us here are in agreement that running tests
> is better than not.

Definitely!  Especially for a widely-used library.

> It would be nice to get this patch tested on MIPS or ARM, in case
> there are other failing test suites that should be documented and
> skipped on those systems.

Yeah.

I think we’ll have to create a branch anyway, so when we do, we can wait
and see what Hydra reports.

> From 76322bff6b4de1c0fe810506f451de733c60683a Mon Sep 17 00:00:00 2001
> From: Eric Bavier <bavier@member.fsf.org>
> Date: Fri, 15 Jan 2016 14:46:26 -0600
> Subject: [PATCH] gnu: boost: Enable tests.
>
> * gnu/packages/boost.scm (boost)[arguments]: Replace 'check' phase.

[...]

> +            ;; The provided method for running all tests (executing b2 in the
> +            ;; "status" directory) requires a large amount of disk space
> +            ;; (>20G) because it does not clean up build artifacts after
> +            ;; successfully running a test suite.  So instead we run each test
> +            ;; individually, which only requires ~7.7G.

This is still a lot of disk space.  Can you make sure that everything is
built with -g0?  It makes a significant difference for C++ code.  I did
that notably for GCC and Inkscape.

> +            (lambda* (#:key outputs #:allow-other-keys)
> +              (let ((b2 (string-append (getcwd) "/b2"))
> +                    (test-dirs
> +                     ;; The instructions at
> +                     ;; http://www.boost.org/development/running_regression_tests.html
> +                     ;; to run b2 in each libs/<library>/test is not entirely
> +                     ;; accurate.  Some tests are in subdirectories and others
> +                     ;; in top-level directories.  So instead we read the list
> +                     ;; of test directories from status/Jamfile.v2
> +                     (let ((port (open-input-file "status/Jamfile.v2"))
> +                           (start-rx (make-regexp "^run-tests libs :"))
> +                           (end-rx (make-regexp "^[[:space:]]*;"))
> +                           (dir-rx (make-regexp "^[[:space:]]*([a-z0-9/_]+)")))

I think it would be nicer to make it a procedure and move it to a
‘define’ at the top of the lambda.

> +                               (reverse! dirs)))

‘reverse’ is enough.  :-)

Otherwise LGTM.

I think we should wait until ‘core-updates’ is merged, and then you can
push an updated patch to, say, ‘wip-boost-tests’ based on ‘master’.

WDYT?

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: boost: Enable tests.
  2016-01-20 22:34 ` Ludovic Courtès
@ 2016-01-21  0:01   ` Eric Bavier
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Bavier @ 2016-01-21  0:01 UTC (permalink / raw)
  To: ludo; +Cc: Guix-devel

On 2016-01-20 16:34, ludo@gnu.org wrote:
> Eric Bavier <ericbavier@openmailbox.org> skribis:
> 
>> This patch turns boost package tests on.  22 of 120 test suites are
>> skipped due to know test failures, many of which still fail with the
>> upstream development version
>> (http://www.boost.org/development/tests/master/developer/summary.html).
[...]
>> It would be nice to get this patch tested on MIPS or ARM, in case
>> there are other failing test suites that should be documented and
>> skipped on those systems.
> 
> Yeah.
> 
> I think we’ll have to create a branch anyway, so when we do, we can 
> wait
> and see what Hydra reports.

Andreas was kind enough to test the patch on ARM, and it seems there's 
at
least one additional test-suite to skip on that architecture.  A branch
would be nice.

>> From 76322bff6b4de1c0fe810506f451de733c60683a Mon Sep 17 00:00:00 2001
>> From: Eric Bavier <bavier@member.fsf.org>
>> Date: Fri, 15 Jan 2016 14:46:26 -0600
>> Subject: [PATCH] gnu: boost: Enable tests.
>> 
>> * gnu/packages/boost.scm (boost)[arguments]: Replace 'check' phase.
> 
> [...]
> 
>> +            ;; The provided method for running all tests (executing 
>> b2 in the
>> +            ;; "status" directory) requires a large amount of disk 
>> space
>> +            ;; (>20G) because it does not clean up build artifacts 
>> after
>> +            ;; successfully running a test suite.  So instead we run 
>> each test
>> +            ;; individually, which only requires ~7.7G.
> 
> This is still a lot of disk space.  Can you make sure that everything 
> is
> built with -g0?  It makes a significant difference for C++ code.  I did
> that notably for GCC and Inkscape.

I'll give that a try and see if it changes things.  Thanks for the 
pointer.

> 
>> +            (lambda* (#:key outputs #:allow-other-keys)
>> +              (let ((b2 (string-append (getcwd) "/b2"))
>> +                    (test-dirs
>> +                     ;; The instructions at
>> +                     ;; 
>> http://www.boost.org/development/running_regression_tests.html
>> +                     ;; to run b2 in each libs/<library>/test is not 
>> entirely
>> +                     ;; accurate.  Some tests are in subdirectories 
>> and others
>> +                     ;; in top-level directories.  So instead we read 
>> the list
>> +                     ;; of test directories from status/Jamfile.v2
>> +                     (let ((port (open-input-file 
>> "status/Jamfile.v2"))
>> +                           (start-rx (make-regexp "^run-tests libs 
>> :"))
>> +                           (end-rx (make-regexp "^[[:space:]]*;"))
>> +                           (dir-rx (make-regexp 
>> "^[[:space:]]*([a-z0-9/_]+)")))
> 
> I think it would be nicer to make it a procedure and move it to a
> ‘define’ at the top of the lambda.

Will do.

>> +                               (reverse! dirs)))
> 
> ‘reverse’ is enough.  :-)

OK.

> Otherwise LGTM.

Great

> I think we should wait until ‘core-updates’ is merged, and then you can
> push an updated patch to, say, ‘wip-boost-tests’ based on ‘master’.
> 
> WDYT?

That's fine with me.

Thanks for the review!

-- 
`~Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-21  0:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 20:59 [PATCH] gnu: boost: Enable tests Eric Bavier
2016-01-17 12:49 ` Andreas Enge
2016-01-20 22:34 ` Ludovic Courtès
2016-01-21  0:01   ` Eric Bavier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).