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.

Bug 102810 - Build test dependencies automatically
Summary: Build test dependencies automatically
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: pzajac
Depends on:
Reported: 2007-04-27 18:51 UTC by Jesse Glick
Modified: 2007-05-25 18:28 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

patch with implementation (26.02 KB, text/plain)
2007-05-11 09:36 UTC, pzajac

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-04-27 18:51:20 UTC
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.
Comment 1 pzajac 2007-04-30 10:39:14 UTC
I promised to implement it long time ago. A lot of our developers want  this 
Comment 2 pzajac 2007-05-11 09:36:27 UTC
Created attachment 42305 [details]
patch with implementation
Comment 3 pzajac 2007-05-11 09:46:19 UTC
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 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>   
Comment 4 pzajac 2007-05-22 12:22:22 UTC

Checking in antsrc/org/netbeans/nbbuild/;
/cvs/nbbuild/antsrc/org/netbeans/nbbuild/,v  <--
new revision: 1.40; previous revision: 1.39
Checking in antsrc/org/netbeans/nbbuild/;
/cvs/nbbuild/antsrc/org/netbeans/nbbuild/,v  <--
new revision: 1.56; previous revision: 1.55
Checking in templates/common.xml;
/cvs/nbbuild/templates/common.xml,v  <--  common.xml
new revision: 1.65; previous revision: 1.64
Checking in templates/projectized.xml;
/cvs/nbbuild/templates/projectized.xml,v  <--  projectized.xml
new revision: 1.97; previous revision: 1.96
Checking in test/unit/src/org/netbeans/nbbuild/;
/cvs/nbbuild/test/unit/src/org/netbeans/nbbuild/,v  <--
new revision: 1.14; previous revision: 1.13
Checking in test/unit/src/org/netbeans/nbbuild/;
new revision: 1.7; previous revision: 1.6
Comment 5 Jesse Glick 2007-05-22 22:42:06 UTC
If it only works for modules I would recommend moving it from common.xml
to projectized.xml, unless you are sure it is harmless for external modules.
Comment 6 Jesse Glick 2007-05-25 18:28:26 UTC
Fixing NPE thrown under some circumstances:

Checking in;
new revision: 1.57; previous revision: 1.56