This is an ebuild repository for prototyping, development, and testing of JUnit 5 support for Gentoo packages. Right now, it contains:
- An experimental eclass
java-pkg-junit-5.eclass, which allows an ebuild to run a Java package's tests using JUnit 5. - Some ebuilds that need JUnit 5 for running tests and therefore use
java-pkg-junit-5.eclass. These ebuilds also act as test cases forjava-pkg-junit-5.eclass.
This ebuild repository should be considered to be in the alpha stage. Packages may be removed, and incompatible eclass changes may occur at any time.
- Add JUnit 5 to the Gentoo repository (https://bugs.gentoo.org/839687)
- Add JUnit 5 support to eclasses (https://bugs.gentoo.org/839681)
- Determine keys for JUnit Jupiter in
JAVA_TESTING_FRAMEWORKS-
junit-jupiterorjunit-5? - Support for
junit-vintageas a substitute ofjunit-4? (Issue)
-
- Determine keys for JUnit Jupiter in
- Enable test for ebuilds that need JUnit 5 for running tests (https://bugs.gentoo.org/829072)
To use JUnit 5 from an ebuild that inherits java-pkg-simple.eclass, please
make the following modifications to the ebuild:
-
If the ebuild is not using EAPI 8, make sure it does so.
-EAPI=7 +EAPI=8
-
If the ebuild does not include the
testUSE flag in theJAVA_PKG_IUSEvariable, make sure it does so. In addition, ensure theJAVA_TESTING_FRAMEWORKSvariable's value is not empty (it needs not contain any special value likejunit-jupiterorjunit-5).-JAVA_PKG_IUSE="doc source" +JAVA_PKG_IUSE="doc source test" +JAVA_TESTING_FRAMEWORKS="foo" inherit java-pkg-2 java-pkg-simple
-
Inherit the eclass without removing inheritance of any other eclass.
-inherit java-pkg-2 java-pkg-simple +inherit java-pkg-2 java-pkg-simple java-pkg-junit-5
-
If the ebuild overrides
pkg_setup, ensure that itspkg_setupcallsjava-pkg-junit-5_pkg_setup. Note thatjava-pkg-junit-5_pkg_setupmay replace any occurrence ofjava-pkg-2_pkg_setup.pkg_setup() { - java-pkg-2_pkg_setup + java-pkg-junit-5_pkg_setup } -
If the ebuild makes any calls to
java-pkg-simple_src_test, replace them withjava-pkg-junit-5_src_test.- java-pkg-simple_src_test + java-pkg-junit-5_src_test