Running eoc test also executes tests from the EO standard library (string, while, tuple, seq, ss.list, etc.), not just tests belonging to the user's own EO programs.
Root cause
Transpiling.javaGenerated calls JavaPlaced.exec(clazz, transpileTests) for every XMIR object returned by scopedTojos().withXmir(), which includes both the user's own programs and all objects pulled from the EO runtime into .eoc/2-pull/. When a pulled object contains +tests methods, JavaPlaced.placeJavaTests writes a *Test.java into .eoc/generated-test-sources, which Maven Surefire then picks up and runs.
The eo-foreign.json catalog already distinguishes pulled objects from the user's own via the discovered-at attribute. TjsForeign.dependencies() also identifies them as objects with a version but no jar.
Steps to reproduce
- Clone eo3-programs.
- Run
make.
- Observe that
org.eolang.EOstringTest, org.eolang.EOwhileTest, org.eolang.EOtupleTest, and ~30 more EO runtime test classes are compiled and executed.
Expected behaviour
Only tests for the user's own EO objects should be compiled and executed.
Relevant classes to investigate: Transpiling.java (javaGenerated, ~line 333), JavaPlaced.java (placeJavaTests), TjsForeign.java (withXmir() vs dependencies()).
Running
eoc testalso executes tests from the EO standard library (string,while,tuple,seq,ss.list, etc.), not just tests belonging to the user's own EO programs.Root cause
Transpiling.javaGeneratedcallsJavaPlaced.exec(clazz, transpileTests)for every XMIR object returned byscopedTojos().withXmir(), which includes both the user's own programs and all objects pulled from the EO runtime into.eoc/2-pull/. When a pulled object contains+testsmethods,JavaPlaced.placeJavaTestswrites a*Test.javainto.eoc/generated-test-sources, which Maven Surefire then picks up and runs.The
eo-foreign.jsoncatalog already distinguishes pulled objects from the user's own via thediscovered-atattribute.TjsForeign.dependencies()also identifies them as objects with aversionbut nojar.Steps to reproduce
make.org.eolang.EOstringTest,org.eolang.EOwhileTest,org.eolang.EOtupleTest, and ~30 more EO runtime test classes are compiled and executed.Expected behaviour
Only tests for the user's own EO objects should be compiled and executed.
Relevant classes to investigate:
Transpiling.java(javaGenerated, ~line 333),JavaPlaced.java(placeJavaTests),TjsForeign.java(withXmir()vsdependencies()).