make tests build in their own classpath

This commit is contained in:
Terence Parr 2014-07-16 10:20:54 -07:00
parent 7865142f9e
commit 1f797853bb
1 changed files with 2 additions and 1 deletions

View File

@ -118,13 +118,14 @@ def tests():
junit_jar, hamcrest_jar = load_junitjars()
cp = uniformpath("dist/antlr-"+VERSION+"-complete.jar")+os.pathsep+ \
uniformpath("out/test/Java")+os.pathsep+ \
string.join([uniformpath(TARGETS[t]+"/tool/test") for t in TARGETS],os.pathsep)+os.pathsep+ \
junit_jar+os.pathsep+hamcrest_jar
properties = ["-D%s=%s" % (p, test_properties[p]) for p in test_properties]
args = ["-Xlint", "-Xlint:-serial", "-g"]
javac("tool/test", "out/test/Java", version="1.6", cp=cp, args=args) # all targets can use org.antlr.v4.test.*
for t in TARGETS:
print "Test %7s --------------" % t
# Prefix CLASSPATH with individual target tests
cp = uniformpath(TARGETS[t]+"/tool/test") + os.pathsep + cp
javac(TARGETS[t]+"/tool/test", "out/test/"+t, version="1.6", cp=cp, args=args)
junit("out/test/"+t, cp=cp, verbose=False, args=properties)