aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Boskovits <boskovits@gmail.com>2018-06-24 14:39:17 +0200
committerGábor Boskovits <boskovits@gmail.com>2018-06-24 15:21:17 +0200
commit2ab089b7ba531b0a28e9fe65a44a8a4af4b1d2bf (patch)
treeef38a1f2ff60d08b6af2117009f08b28ccb9aed5
parent78754995e847115e5c9141521497b0b41319fc4b (diff)
downloadpatches-2ab089b7ba531b0a28e9fe65a44a8a4af4b1d2bf.tar
patches-2ab089b7ba531b0a28e9fe65a44a8a4af4b1d2bf.tar.gz
gnu: java-aqute-libg: Enable tests.
* gnu/packages/java.scm (java-aqute-libg)[arguments]: Remove #:source-dir and #:tests?, add #:phases 'chdir and 'create-test-directory. [native-inputs]: Add java-hamcrest-core and java-junit.
-rw-r--r--gnu/packages/java.scm24
1 files changed, 21 insertions, 3 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index aba8119741..a13f6f18d1 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7000,8 +7000,6 @@ it manages project dependencies, gives diffs jars, and much more.")
(name "java-aqute-libg")
(arguments
`(#:jar-name "java-aqute-libg.jar"
- #:source-dir "aQute.libg/src"
- #:tests? #f)); FIXME: tests are in "aQute.libg/test", not in a java directory
;; The build fails when source/target more recent than 1.7. This
;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
;;
@@ -7010,11 +7008,31 @@ it manages project dependencies, gives diffs jars, and much more.")
;; target. It work fine on 1.7, so we use 1.7.
#:make-flags (list "-Dant.build.javac.source=1.7"
"-Dant.build.javac.target=1.7")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'chdir
+ ;; Change to aQute.libg directory, so that the relative
+ ;; paths in the tests aren't broken.
+ (lambda _
+ (chdir "aQute.libg")
+ #t))
+ (add-before 'check 'create-test-directory
+ ;; Copy the test directory to test/java, since that's where
+ ;; ant-build-system's default project in build.xml expects to find
+ ;; the test classes. Leave a copy in the original place to not
+ ;; break paths in tests.
+ (lambda _
+ (mkdir "src/test")
+ (copy-recursively "test" "src/test/java")
+ #t)))))
(inputs
`(("slf4j" ,java-slf4j-api)
("osgi-annot" ,java-osgi-annotation)
("java-osgi-cmpn" ,java-osgi-cmpn)
- ("osgi" ,java-osgi-core)))))
+ ("osgi" ,java-osgi-core)))
+ (native-inputs
+ `(("hamcrest" ,java-hamcrest-core)
+ ("java-junit" ,java-junit)))))
(define java-aqute-libg-bootstrap
(package