From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzJIC-00041p-6Y for guix-patches@gnu.org; Tue, 03 Oct 2017 05:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzJI8-0006WU-6h for guix-patches@gnu.org; Tue, 03 Oct 2017 05:15:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36488) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzJI8-0006U3-0q for guix-patches@gnu.org; Tue, 03 Oct 2017 05:15:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dzJI6-0000Ro-M5 for guix-patches@gnu.org; Tue, 03 Oct 2017 05:15:03 -0400 Subject: [bug#28663] [PATCH 02/22] guix: ant-build-system: Add #:test-include and #:test-exclude arguments. Resent-Message-ID: References: <20171001194418.67936d4e@lepiller.eu> <20171001175334.2694-1-julien@lepiller.eu> <20171001175334.2694-2-julien@lepiller.eu> From: Ricardo Wurmus In-reply-to: <20171001175334.2694-2-julien@lepiller.eu> Date: Tue, 03 Oct 2017 11:14:34 +0200 Message-ID: <87d1644mpx.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain 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: julien@lepiller.eu Cc: 28663@debbugs.gnu.org julien@lepiller.eu writes: > From: Julien Lepiller > > * guix/build-system/ant.scm: Add #:test-include and #:test-exclude > arguments. > * guix/build/ant-build-system.scm: Generate test list from arguments. > --- > guix/build-system/ant.scm | 4 ++++ > guix/build/ant-build-system.scm | 17 +++++++++++++---- > 2 files changed, 17 insertions(+), 4 deletions(-) > > diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm > index a700230ec..b5626bd42 100644 > --- a/guix/build-system/ant.scm > +++ b/guix/build-system/ant.scm > @@ -100,6 +100,8 @@ > (build-target "jar") > (jar-name #f) > (main-class #f) > + (test-include (list "**/*Test.java")) > + (test-exclude (list "**/Abstract*.java")) > (source-dir "src") > (test-dir "src/test") > (phases '(@ (guix build ant-build-system) > @@ -132,6 +134,8 @@ > #:build-target ,build-target > #:jar-name ,jar-name > #:main-class ,main-class > + #:test-include (list ,@test-include) > + #:test-exclude (list ,@test-exclude) > #:source-dir ,source-dir > #:test-dir ,test-dir > #:phases ,phases > diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm > index 727d3a3b2..a440daf05 100644 > --- a/guix/build/ant-build-system.scm > +++ b/guix/build/ant-build-system.scm > @@ -36,7 +36,9 @@ > ;; Code: > > (define* (default-build.xml jar-name prefix #:optional > - (source-dir ".") (test-dir "./test") (main-class #f)) > + (source-dir ".") (test-dir "./test") (main-class #f) > + (test-include '("**/*Test.java")) > + (test-exclude '("**/Abstract*Test.java"))) > "Create a simple build.xml with standard targets for Ant." > (call-with-output-file "build.xml" > (lambda (port) > @@ -109,7 +111,12 @@ > (batchtest (@ (fork "yes") > (todir "${test.home}/test-reports")) > (fileset (@ (dir "${test.home}/java")) > - (include (@ (name "**/*Test.java" ))))))) > + ,@(map (lambda (file) > + `(include (@ (name ,file)))) > + test-include) > + ,@(map (lambda (file) > + `(exclude (@ (name ,file)))) > + test-exclude))))) > > (target (@ (name "jar") > (depends "compile, manifest")) > @@ -150,12 +157,14 @@ to the default GNU unpack strategy." > (define* (configure #:key inputs outputs (jar-name #f) > (source-dir "src") > (test-dir "src/test") > - (main-class #f) #:allow-other-keys) > + (main-class #f) > + (test-include '("**/*Test.java")) > + (test-exclude '("**/Abstract*.java")) #:allow-other-keys) > (when jar-name > (default-build.xml jar-name > (string-append (assoc-ref outputs "out") > "/share/java") > - source-dir test-dir main-class)) > + source-dir test-dir main-class test-include test-exclude)) > (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) > (setenv "CLASSPATH" (generate-classpath inputs))) Excellent! This probably is enough to fix the tests of java-cglib. Please also quickly mention it in the documentation of the ant-build-system. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net