regen_test in bild.py works now

This commit is contained in:
Terence Parr 2015-06-02 17:24:06 -07:00
parent 1323e30fa9
commit 29db15736d
2 changed files with 11 additions and 7 deletions

15
bild.py
View File

@ -254,16 +254,21 @@ def python_sdist():
def regen_tests(): def regen_tests():
require(_mkjar) # first compile runtime-testsuite; only needs ST and junit
junit_jar, hamcrest_jar = load_junitjars() junit_jar, hamcrest_jar = load_junitjars()
cp = uniformpath("dist/antlr4-" + VERSION + "-complete.jar") \ download("http://www.stringtemplate.org/download/ST-4.0.8.jar", JARCACHE)
+ os.pathsep + uniformpath("out/test") \ cp = os.path.join(JARCACHE, "ST-4.0.8.jar") \
+ os.pathsep + junit_jar \ + os.pathsep + junit_jar \
+ os.pathsep + hamcrest_jar + os.pathsep + hamcrest_jar
args = ["-nowarn", "-Xlint", "-Xlint:-serial", "-g"] args = ["-nowarn", "-Xlint", "-Xlint:-serial", "-g"]
#javac("tool/test", "out/test", version="1.6", cp=cp, args=args) # all targets can use org.antlr.v4.test.* javac("runtime-testsuite/src", "out/testsuite", version="1.6", cp=cp, args=args)
# now use TestGenerator to generate Test*.java for each target using
# runtime templates and test templates themselves:
# runtime-testsuite/resources/org/antlr/v4/test/runtime/templates
# generate into gen/test/Java, gen/test/CSharp, ...
for targetName in RUNTIME_TEST_TEMPLATES: for targetName in RUNTIME_TEST_TEMPLATES:
java(classname="org.antlr.v4.testgen.TestGenerator", cp="out/test:dist/antlr4-"+VERSION+"-complete.jar", java(classname="org.antlr.v4.testgen.TestGenerator", cp="out/testsuite:"+cp,
progargs=['-o', 'gen/test/'+targetName, '-templates', RUNTIME_TEST_TEMPLATES[targetName]]) progargs=['-o', 'gen/test/'+targetName, '-templates', RUNTIME_TEST_TEMPLATES[targetName]])
#javac("gen/test", "out/test", version="1.6", cp=cp, args=args) # compile generated runtime tests #javac("gen/test", "out/test", version="1.6", cp=cp, args=args) # compile generated runtime tests
print_and_log("test generation complete") print_and_log("test generation complete")

View File

@ -2,7 +2,7 @@
<module type="JAVA_MODULE" version="4"> <module type="JAVA_MODULE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="Python" name="Python"> <facet type="Python" name="Python">
<configuration sdkName="Python 2.7.6 (/usr/bin/python)" /> <configuration sdkName="" />
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" inherit-compiler-output="true">
@ -44,7 +44,6 @@
<orderEntry type="library" name="maven-plugin-annotations-3.4" level="application" /> <orderEntry type="library" name="maven-plugin-annotations-3.4" level="application" />
<orderEntry type="library" name="plexus-compiler-api-1.5.3" level="application" /> <orderEntry type="library" name="plexus-compiler-api-1.5.3" level="application" />
<orderEntry type="library" name="plexus-build-api-0.0.7" level="application" /> <orderEntry type="library" name="plexus-build-api-0.0.7" level="application" />
<orderEntry type="library" name="Python 2.7.6 (/usr/bin/python) interpreter library" level="application" />
</component> </component>
<component name="PluginUploader.PluginUploadConfigurable"> <component name="PluginUploader.PluginUploadConfigurable">
<option name="ARCHIVE_PATH" /> <option name="ARCHIVE_PATH" />