X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fmisc%2FRegressionTests.java;h=6501727b4c11b69f6a74031cc53d9ab45a847013;hp=196382c9b498aa3276c5aa5ab5a821e1cae5626e;hb=acfe58223b9a0f78e64a14a1ca5d5998626ee3fe;hpb=b205c5ee125119b0372328b70e8a66164df18fd0 diff --git a/src/edu/berkeley/sbp/misc/RegressionTests.java b/src/edu/berkeley/sbp/misc/RegressionTests.java index 196382c..6501727 100644 --- a/src/edu/berkeley/sbp/misc/RegressionTests.java +++ b/src/edu/berkeley/sbp/misc/RegressionTests.java @@ -62,7 +62,22 @@ public class RegressionTests { TestCase[] expanded = (TestCase[])new TestCaseBuilder().walk(r2.expand1()); System.err.println("executing..."); - for(TestCase tc : expanded) tc.execute(); + for(TestCase tc : expanded) { + tc.execute(); + /* + String st = "a"; + for(int i=0; i<12; i++) { + //System.out.println("length " + st.length()); + tc.input = st; + long nowy = System.currentTimeMillis(); + GSS.shifts = 0; + GSS.reductions = 0; + tc.execute(); + System.out.println("length " + st.length() + " => " + ((System.currentTimeMillis()-nowy)/1000.0) + " " + GSS.shifts + " " + GSS.reductions); + st = st+st; + } + */ + } } catch (Throwable t) { System.err.println("\n\nexception thrown, class == " + t.getClass().getName()); @@ -76,7 +91,7 @@ public class RegressionTests { public static class TestCase { private final boolean tib; private final boolean jav; - public final String input; + public /*final*/ String input; public final String[] output; public final Union grammar; public TestCase(String input, String[] output, Union grammar, boolean tib, boolean jav) throws IOException { @@ -105,6 +120,7 @@ public class RegressionTests { pfe = pf; } //ystem.out.println("res=="+res); + if (graph) { FileOutputStream fos = new FileOutputStream("out.dot"); PrintWriter p = new PrintWriter(new OutputStreamWriter(fos)); @@ -147,6 +163,7 @@ public class RegressionTests { return true; } System.out.println("\r\033[32mPASS\033[0m "); + return false; } }