If you try to move your Java test files out of src/test/java then running testJ2objc will fail because the packages on the tested class names will be wrong.
For example, if I move my test class from the normal location of src/test/java/my/package/Test.java to something like tests/my/package/Test.java and set the source set to look at that directory (sourceSets.test.java.srcDirs = [file('tests')]), the resulting testJ2ObjC command that gets run looks something like testJ2Objc tests.my.package.Test. Note that the tests directory is considered part of the package name.
The issue here looks to be that the test package is determined by:
- Taking the path relative to the Gradle project root
- Removing the (hardcoded) standard directory
This means that non-standard directories are not handled. In my mind the expected behavior would be that the package is determined from the root of the test source directory (tests/ in my example). This would work for both the existing case since the default test source directory is src/tests/java/, as well as for custom directories.
If you try to move your Java test files out of
src/test/javathen runningtestJ2objcwill fail because the packages on the tested class names will be wrong.For example, if I move my test class from the normal location of
src/test/java/my/package/Test.javato something liketests/my/package/Test.javaand set the source set to look at that directory (sourceSets.test.java.srcDirs = [file('tests')]), the resultingtestJ2ObjCcommand that gets run looks something liketestJ2Objc tests.my.package.Test. Note that thetestsdirectory is considered part of the package name.The issue here looks to be that the test package is determined by:
This means that non-standard directories are not handled. In my mind the expected behavior would be that the package is determined from the root of the test source directory (
tests/in my example). This would work for both the existing case since the default test source directory issrc/tests/java/, as well as for custom directories.