[Git][java-team/scala-parser-combinators-2.12][debian/latest] Run the upstream test suite at build time and in autopkgtest

Juan Manuel Méndez Rey (@mendezr) gitlab at salsa.debian.org
Thu Oct 29 13:02:07 GMT 2026



Juan Manuel Méndez Rey pushed to branch debian/latest at Debian Java Maintainers / scala-parser-combinators-2.12


Commits:
2882f62d by Juan Manuel Méndez Rey at 2026-10-28T11:08:29+01:00
Run the upstream test suite at build time and in autopkgtest

Compile the JUnit tests under shared/ and jvm/ against the built
classes and run them with JUnitCore, skipped under nocheck. The
autopkgtest runs the same tests against the installed jar.

- - - - -


5 changed files:

- debian/changelog
- debian/control
- debian/rules
- + debian/tests/control
- + debian/tests/junit


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+scala-parser-combinators-2.12 (1.0.7+ds-2) UNRELEASED; urgency=medium
+
+  * Run the upstream test suite at build time.
+  * Add an autopkgtest that runs it against the installed jar.
+
+ -- Juan Manuel Méndez Rey <juan.mendezr at proton.me>  Wed, 28 Oct 2026 11:07:11 +0100
+
 scala-parser-combinators-2.12 (1.0.7+ds-1) unstable; urgency=medium
 
   * Initial release. org.scala-lang.modules:scala-parser-


=====================================
debian/control
=====================================
@@ -7,6 +7,7 @@ Build-Depends:
  debhelper-compat (= 14),
  default-jdk-headless,
  javahelper,
+ junit4 <!nocheck>,
  maven-repo-helper,
  scala (>= 2.12~),
  scala-asm (>= 9.9.0)


=====================================
debian/rules
=====================================
@@ -26,6 +26,15 @@ override_dh_auto_build:
 	jar cf scala-parser-combinators_2.12-$(VERSION).jar -C target/classes .
 
 override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	# Upstream JUnit tests; the runner gets every class with a @Test method.
+	mkdir -p target/test-classes
+	$(SCALAC) -cp target/classes:$(SCALA)/junit4.jar -d target/test-classes \
+	  $$(find shared/src/test/scala jvm/src/test/scala -name '*.scala')
+	java -cp target/classes:target/test-classes:$(SCALA)/junit4.jar:$(SCALA)/scala-library-2.12.jar \
+	  org.junit.runner.JUnitCore $$(cd target/test-classes && grep -rl 'Lorg/junit/Test;' . \
+	  | grep -v '\$$' | sed 's,^\./,,;s,\.class$$,,;s,/,.,g')
+endif
 
 override_dh_auto_clean:
 	rm -rf target scala-parser-combinators_2.12-$(VERSION).jar


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,2 @@
+Tests: junit
+Depends: @, junit4, scala (>= 2.12~)


=====================================
debian/tests/junit
=====================================
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Run the upstream JUnit tests against the installed jar.
+set -e
+J=/usr/share/java
+CP=$J/scala-parser-combinators_2.12.jar:$J/junit4.jar
+scalac-2.12 -nowarn -cp $CP -d "$AUTOPKGTEST_TMP" \
+  $(find shared/src/test/scala jvm/src/test/scala -name '*.scala')
+cd "$AUTOPKGTEST_TMP"
+java -cp $CP:$J/scala-library-2.12.jar:. org.junit.runner.JUnitCore \
+  $(grep -rl 'Lorg/junit/Test;' . | grep -v '\$' | sed 's,^\./,,;s,\.class$,,;s,/,.,g')



View it on GitLab: https://salsa.debian.org/java-team/scala-parser-combinators-2.12/-/commit/2882f62dd34c45e5b013efbb009cc426cf6f992f

-- 
View it on GitLab: https://salsa.debian.org/java-team/scala-parser-combinators-2.12/-/commit/2882f62dd34c45e5b013efbb009cc426cf6f992f
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261029/8dfc8559/attachment.htm>


More information about the pkg-java-commits mailing list