Thanks lingocoder for your answer.
I do not get the same result as you but it’s most likely because of an Eclipse/Buildship bug on Mac Osx. I guess the problem is associated with the OS because I have exactly the same problem with the same eclipse version as you (2019-06) but on Mac Osx :
Task :test
Caching disabled for task ':test' because:
Build cache is disabled
Task ':test' is not up-to-date because:
Task.upToDateWhen is false.
Finished generating test XML results (0.0 secs) into: /Users/.../TestGradleTest/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.041 secs) into: /Users/.../TestGradleTest/build/reports/tests/test
:test (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 0.122 secs.
FAILURE: Build failed with an exception.
* What went wrong:
No matching tests found in any candidate test task.
Requested tests:
Test class TestGradleTest.LibraryTest
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 905ms
3 actionable tasks: 1 executed, 2 up-to-date
When I run the test with command line, everything works perfectly :
Task :test
Caching disabled for task ':test' because:
Build cache is disabled
Task ':test' is not up-to-date because:
Value of input property 'filter.failOnNoMatchingTests' has changed for task ':test'
Value of input property 'filter.includePatterns' has changed for task ':test'
Starting process 'Gradle Test Executor 4'. Working directory: /Users/.../TestGradleTest Command: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/java -Dorg.gradle.native=false @/private/var/folders/4t/wfx1sb3d2b7d82x56zmr3l1h0000gn/T/gradle-worker-classpath1860032888025482123txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=FR -Duser.language=fr -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'
Successfully started process 'Gradle Test Executor 4'
Finished generating test XML results (0.001 secs) into: /Users/.../TestGradleTest/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.001 secs) into: /Users/.../TestGradleTest/build/reports/tests/test
:test (Thread[Execution worker for ':',5,main]) completed. Took 0.378 secs.
BUILD SUCCESSFUL in 883ms
3 actionable tasks: 1 executed, 2 up-to-date
So I can not test your solution. I will create a ticket to Eclipse/Buildship.
However, my question was not yet at this level. It is based on the fact that when the “Project and external dependencies” container is at the “Modulepath” level (in “Java build path/Libraries”), the test classes are not recognized by the Eclipse editor:
Does your solution solve this problem too?