buildcraft/test.py

28 lines
736 B
Python
Raw Normal View History

import xml.etree.ElementTree as et
import re
import os
import sys
import shutil
forgeRoot = sys.argv [1]
root = et.parse (forgeRoot + ".classpath")
classpath = forgeRoot + "bin"
for e in root.findall (".//classpathentry"):
path = e.attrib ["path"]
classpath = classpath + ";" + path
testRoot = "testsuite"
testDir = testRoot + "/" + sys.argv [2]
os.chdir (testDir)
shutil.rmtree ("world", True)
shutil.copytree ("../base/world", "world")
shutil.copy ("../base/server.properties", "server.properties")
command = "java -Xincgc -Xmx1024M -Xms1024M -classpath \"" + classpath + "\" cpw.mods.fml.relauncher.ServerLaunchWrapper --nogui --world world --test test.seq "
print command
os.system (command)