Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test source cannot be moved from default location #614

Open
efirestone opened this issue Apr 13, 2016 · 0 comments
Open

Test source cannot be moved from default location #614

efirestone opened this issue Apr 13, 2016 · 0 comments

Comments

@efirestone
Copy link

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:

  1. Taking the path relative to the Gradle project root
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant