The build.xml has a test and a build target. The test target obviously depends on the build target.
How can I run the test target on
A well written build target will not need to rebuild anything if the code hasn't changed. So the fact that the test target depends on it should be largely irrelevant. If you run the build target twice in a row and it tries to rebuild something the second time, you might want to investigate why it is doing that.
The simple way to avoid executing the target is to set the "unless" attribute of the target to the name of some property. If you then set this property on the command line when running Ant, it will bypass that target.