From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlvpN-0002pI-TV for guix-patches@gnu.org; Sun, 27 Aug 2017 07:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlvpK-00045w-J5 for guix-patches@gnu.org; Sun, 27 Aug 2017 07:34:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlvpK-00045r-FX for guix-patches@gnu.org; Sun, 27 Aug 2017 07:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dlvpK-0003FU-6R for guix-patches@gnu.org; Sun, 27 Aug 2017 07:34:02 -0400 Subject: [bug#28250] slf4j-api: enable tests Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlvoG-0002cd-35 for guix-patches@gnu.org; Sun, 27 Aug 2017 07:32:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlvoC-0003bS-Vd for guix-patches@gnu.org; Sun, 27 Aug 2017 07:32:56 -0400 Received: from lepiller.eu ([89.234.186.109]:39226 helo=localhost) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlvoC-0003a1-L6 for guix-patches@gnu.org; Sun, 27 Aug 2017 07:32:52 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by localhost (OpenSMTPD) with ESMTPSA id 39b294d5 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sun, 27 Aug 2017 11:32:49 +0000 (UTC) Date: Sun, 27 Aug 2017 13:31:42 +0200 From: Julien Lepiller Message-ID: <20170827133142.6a7b6482@lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/8+QIuMroZam2d3LF6wG4+5L" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28250@debbugs.gnu.org --MP_/8+QIuMroZam2d3LF6wG4+5L Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I found what prevented the tests to pass in slf4j-api. In slf4j-api/pom.xml, the jar file is created with all classes, except those in impl/. I did the same with a new pase where I delete the impl/ directory and regenerate the jar file. Maybe I should fix teh build.xml file instead? Then, tests pass except for one file. This file is an abstract class meant to be extended by other test cases, but it's not a test case in itself, hence the failure. This time, I implemented another phase where I fix the build.xml file to exclude this file from testing. I'm working on other packages, and it's not the first time I see some tests I need to disable because they shouldn't be run. Maybe I could add arguments to the ant build system, such as #:test-include and #:test-exclude, defaulting to '("**/*.java") and '() respectively? Thank you :) --MP_/8+QIuMroZam2d3LF6wG4+5L Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-java-slf4j-api-Fix-tests.patch >From 2a9b0420c249b4b896f5980a55be8ae5595bd96b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sun, 27 Aug 2017 13:19:31 +0200 Subject: [PATCH] gnu: java-slf4j-api: Fix tests. * gnu/packages/java.scm (java-slf4j-api)[arguments]: Enable tests Adjust the jar content to prevent a test failure. --- gnu/packages/java.scm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index da68487b0..caa76f335 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -4170,12 +4170,26 @@ more efficient storage-wise than an uncompressed bitmap (as implemented in the #t)))) (build-system ant-build-system) (arguments - ;; FIXME: org.slf4j.NoBindingTest fails with the ominous "This code - ;; should have never made it into slf4j-api.jar". - `(#:tests? #f - #:jar-name "slf4j-api.jar" + `(#:jar-name "slf4j-api.jar" #:source-dir "slf4j-api/src/main" - #:test-dir "slf4j-api/src/test")) + #:test-dir "slf4j-api/src/test" + #:phases + (modify-phases %standard-phases + (add-after 'build 'regenerate-jar + (lambda _ + ;; pom.xml ignores these files in the jar creation process. If we don't, + ;; we get the error "This code should have never made it into slf4j-api.jar" + (delete-file-recursively "build/classes/org/slf4j/impl") + (zero? (system* "jar" "-cf" "build/jar/slf4j-api.jar" "-C" + "build/classes" ".")))) + (add-before 'check 'dont-test-abstract-classes + (lambda _ + ;; abstract classes are not meant to be run with junit + (substitute* "build.xml" + (("") + (string-append "" + "")))))))) (inputs `(("java-junit" ,java-junit) ("java-hamcrest-core" ,java-hamcrest-core))) -- 2.14.1 --MP_/8+QIuMroZam2d3LF6wG4+5L--