Make compiler optional
This commit is contained in:
@@ -8,6 +8,14 @@ public class AllTests {
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("Test for org.luaj");
|
||||
|
||||
// debug tests
|
||||
TestSuite vm = new TestSuite("VM");
|
||||
vm.addTestSuite(org.luaj.vm.LoadStateTest.class);
|
||||
vm.addTestSuite(org.luaj.vm.LStringTest.class);
|
||||
vm.addTestSuite(org.luaj.vm.LTableTest.class);
|
||||
vm.addTestSuite(org.luaj.vm.LuaJTest.class);
|
||||
suite.addTest(vm);
|
||||
|
||||
// compiler tests
|
||||
TestSuite compiler = new TestSuite("Compiler");
|
||||
compiler.addTestSuite(org.luaj.compiler.SimpleTests.class);
|
||||
@@ -28,14 +36,6 @@ public class AllTests {
|
||||
debug.addTestSuite(org.luaj.debug.j2se.LuaJVMTest.class);
|
||||
suite.addTest(debug);
|
||||
|
||||
// debug tests
|
||||
TestSuite vm = new TestSuite("VM");
|
||||
vm.addTestSuite(org.luaj.vm.LoadStateTest.class);
|
||||
vm.addTestSuite(org.luaj.vm.LStringTest.class);
|
||||
vm.addTestSuite(org.luaj.vm.LTableTest.class);
|
||||
vm.addTestSuite(org.luaj.vm.LuaJTest.class);
|
||||
suite.addTest(vm);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,20 +4,16 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintStream;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
|
||||
import org.luaj.compiler.Compiler;
|
||||
import org.luaj.compiler.DumpState;
|
||||
import org.luaj.debug.Print;
|
||||
import org.luaj.vm.LoadState;
|
||||
import org.luaj.vm.LPrototype;
|
||||
import org.luaj.vm.LuaState;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.luaj.debug.Print;
|
||||
import org.luaj.vm.LPrototype;
|
||||
import org.luaj.vm.LoadState;
|
||||
import org.luaj.vm.LuaState;
|
||||
|
||||
|
||||
abstract
|
||||
public class AbstractUnitTests extends TestCase {
|
||||
@@ -38,7 +34,7 @@ public class AbstractUnitTests extends TestCase {
|
||||
|
||||
// compile in memory
|
||||
InputStream is = new ByteArrayInputStream( lua );
|
||||
LPrototype p = Compiler.compile(is, dir+"/"+file);
|
||||
LPrototype p = LuaC.compile(is, dir+"/"+file);
|
||||
String actual = protoToString( p );
|
||||
|
||||
// load expected value from jar
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SimpleTests extends TestCase {
|
||||
private void doTest( String script ) {
|
||||
try {
|
||||
InputStream is = new ByteArrayInputStream( script.getBytes("UTF8") );
|
||||
LPrototype p = Compiler.compile( is, "script" );
|
||||
LPrototype p = LuaC.compile( is, "script" );
|
||||
assertNotNull( p );
|
||||
Print.printCode( p );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user