This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I thought this was already filed somewhere, but I can't find it. If module B has a test dependency on module A, then B/build.xml#test-build should automatically invoke A/build.xml#test-build.
I promised to implement it long time ago. A lot of our developers want this feature.
Created attachment 42305 [details] patch with implementation
I added to ParseProjectProjectXml/TestType nested element CompileDep. To value of CompileDep property will be added list of project locations (relative to ${nb_all}). The list contains compilable dependencies. Already compiled tests are automatically excluded from the list. The solution works only for nb.org modules. Have I move the "test-dep-build" target from common.xml to projectized.xml? + <target name="test-dep-build" if="test.unit.testdep"> + <pathconvert property="test.modules.fullpath" > + <path> + <dirset dir="${nb_all}" includes="${test.unit.testdep}" /> + </path> + <mapper type="identity" /> + </pathconvert> + <sortsuitemodules unsortedmodules="${test.modules.fullpath}" sortedmodulesproperty="modules.sorted" sorttests="true"/> + <subant buildpath="${modules.sorted}" target="do-test-build" /> + </target>
Integrated. Checking in antsrc/org/netbeans/nbbuild/ModuleListParser.java; /cvs/nbbuild/antsrc/org/netbeans/nbbuild/ModuleListParser.java,v <-- ModuleListParser.java new revision: 1.40; previous revision: 1.39 done Checking in antsrc/org/netbeans/nbbuild/ParseProjectXml.java; /cvs/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java,v <-- ParseProjectXml.java new revision: 1.56; previous revision: 1.55 done Checking in templates/common.xml; /cvs/nbbuild/templates/common.xml,v <-- common.xml new revision: 1.65; previous revision: 1.64 done Checking in templates/projectized.xml; /cvs/nbbuild/templates/projectized.xml,v <-- projectized.xml new revision: 1.97; previous revision: 1.96 done Checking in test/unit/src/org/netbeans/nbbuild/ModuleListParserTest.java; /cvs/nbbuild/test/unit/src/org/netbeans/nbbuild/ModuleListParserTest.java,v <-- ModuleListParserTest.java new revision: 1.14; previous revision: 1.13 done Checking in test/unit/src/org/netbeans/nbbuild/FixTestDependenciesTest.java; /cvs/nbbuild/test/unit/src/org/netbeans/nbbuild/FixTestDependenciesTest.java,v <-- FixTestDependenciesTest.java new revision: 1.7; previous revision: 1.6 done
If it only works for nb.org modules I would recommend moving it from common.xml to projectized.xml, unless you are sure it is harmless for external modules.
Fixing NPE thrown under some circumstances: Checking in ParseProjectXml.java; /shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java,v <-- ParseProjectXml.java new revision: 1.57; previous revision: 1.56 done