diff --git a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/loader/Python3Loader.java b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/loader/Python3Loader.java index 23b5d41a9..91448ecf6 100644 --- a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/loader/Python3Loader.java +++ b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/loader/Python3Loader.java @@ -10,6 +10,8 @@ *****************************************************************************/ package com.ibm.wala.cast.python.loader; +import static java.util.logging.Level.WARNING; + import com.ibm.wala.cast.ir.translator.ConstantFoldingRewriter; import com.ibm.wala.cast.ir.translator.RewritingTranslatorToCAst; import com.ibm.wala.cast.ir.translator.TranslatorToCAst; @@ -32,10 +34,15 @@ import java.io.File; import java.io.IOException; import java.util.List; +import java.util.logging.Logger; import org.python.core.PyObject; +import org.python.core.PySyntaxError; +import org.python.core.PyUnicode; public class Python3Loader extends PythonLoader { + private static final Logger logger = Logger.getLogger(Python3Loader.class.getName()); + public Python3Loader(IClassHierarchy cha, IClassLoader parent, List pythonPath) { super(cha, parent, pythonPath); } @@ -94,15 +101,25 @@ public ConstantFoldingRewriter createCAstRewriter(CAst ast) { return new ConstantFoldingRewriter(ast) { @Override protected Object eval(CAstOperator op, Object lhs, Object rhs) { + String s = lhs + " " + op.getValue() + " " + rhs; + logger.info(() -> "Evaluating: " + s); + + // Use the Python interpreter to evaluate the expression. + PyUnicode unicode = new PyUnicode(s); + PyObject x; + try { - PyObject x = - Python3Interpreter.getInterp().eval(lhs + " " + op.getValue() + " " + rhs); - if (x.isNumberType()) { - System.err.println(lhs + " " + op.getValue() + " " + rhs + " -> " + x.asInt()); - return x.asInt(); - } - } catch (Exception e) { - // interpreter died for some reason, so no information. + x = Python3Interpreter.getInterp().eval(unicode); + } catch (PySyntaxError e) { + // Handle syntax errors gracefully. + logger.log(WARNING, e, () -> "Syntax error in expression: " + unicode); + return null; + } + + if (x.isNumberType()) { + // If the result is a number, return its integer value. + logger.info(() -> s + " -> " + x.asInt()); + return x.asInt(); } return null; } diff --git a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/util/Python3Interpreter.java b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/util/Python3Interpreter.java index 94833ca16..a8d13814f 100644 --- a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/util/Python3Interpreter.java +++ b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/util/Python3Interpreter.java @@ -7,13 +7,9 @@ public class Python3Interpreter extends com.ibm.wala.cast.python.util.PythonInte private static PythonInterpreter interp; public static PythonInterpreter getInterp() { - try { - if (interp == null) { - // PySystemState.initialize( ); - interp = new PythonInterpreter(); - } - } catch (Throwable e) { - + if (interp == null) { + // PySystemState.initialize( ); + interp = new PythonInterpreter(); } return interp; } diff --git a/com.ibm.wala.cast.python.ml.test/pom.xml b/com.ibm.wala.cast.python.ml.test/pom.xml index 9ac54b628..382a49a61 100644 --- a/com.ibm.wala.cast.python.ml.test/pom.xml +++ b/com.ibm.wala.cast.python.ml.test/pom.xml @@ -10,7 +10,7 @@ ${project.groupId} - com.ibm.wala.cast.python.jython.test + com.ibm.wala.cast.python.jython3.test 0.0.1-SNAPSHOT diff --git a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java index 0c194e730..9bf63f825 100644 --- a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java +++ b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflow2Model.java @@ -46,11 +46,6 @@ /** Test TF2 APIs. */ public class TestTensorflow2Model extends TestPythonMLCallGraphShape { - private static final String JAVA_CLASSPATH_SYSTEM_PROPERTY_KEY = "java.class.path"; - - /** Name of the Maven submodule uses for Jython3 testing. */ - private static final String JYTHON3_TEST_PROJECT = "com.ibm.wala.cast.python.jython3.test"; - private static final Logger LOGGER = Logger.getLogger(TestTensorflow2Model.class.getName()); @Test @@ -1009,10 +1004,8 @@ public void testDataset24() @Test public void testDataset25() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/165 is fixed. - test("tf2_test_dataset25.py", "f", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/165 is fixed. - test("tf2_test_dataset25.py", "g", 0, 0); + test("tf2_test_dataset25.py", "f", 1, 1, 2); + test("tf2_test_dataset25.py", "g", 1, 1, 2); // TODO: Change to 0, 0 once https://github.com/wala/ML/issues/165 is fixed. test("tf2_test_dataset25.py", "h", 1, 1, 2); } @@ -1020,14 +1013,10 @@ public void testDataset25() @Test public void testDataset26() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/165 is fixed. - test("tf2_test_dataset26.py", "f", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/165 is fixed. - test("tf2_test_dataset26.py", "g1", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/165 is fixed. - test("tf2_test_dataset26.py", "g2", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/165 is fixed. - test("tf2_test_dataset26.py", "g3", 0, 0); + test("tf2_test_dataset26.py", "f", 1, 1, 2); + test("tf2_test_dataset26.py", "g1", 1, 1, 2); + test("tf2_test_dataset26.py", "g2", 1, 1, 2); + test("tf2_test_dataset26.py", "g3", 1, 1, 2); // TODO: Change to 0, 0 once https://github.com/wala/ML/issues/165 is fixed. test("tf2_test_dataset26.py", "h", 1, 1, 2); } @@ -1036,21 +1025,16 @@ public void testDataset26() public void testDataset27() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test("tf2_test_dataset27.py", "f", 1, 1, 2); - // TODO: Change to 1, 1, 2 when https://github.com/wala/ML/issues/164 is fixed: - test("tf2_test_dataset27.py", "g", 0, 0); - // TODO: Change to 1, 1, 2 when https://github.com/wala/ML/issues/164 is fixed: - test("tf2_test_dataset27.py", "h", 0, 0); - // TODO: Change to 1, 1, 2 when https://github.com/wala/ML/issues/164 is fixed: - test("tf2_test_dataset27.py", "i", 0, 0); + test("tf2_test_dataset27.py", "g", 1, 1, 2); + test("tf2_test_dataset27.py", "h", 1, 1, 2); + test("tf2_test_dataset27.py", "i", 1, 1, 2); } @Test public void testDataset28() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - // TODO: Change to 1, 1, 2 when https://github.com/wala/ML/issues/164 is fixed: - test("tf2_test_dataset28.py", "f", 0, 0); - // TODO: Change to 1, 1, 2 when https://github.com/wala/ML/issues/164 is fixed: - test("tf2_test_dataset28.py", "g", 0, 0); + test("tf2_test_dataset28.py", "f", 1, 1, 2); + test("tf2_test_dataset28.py", "g", 1, 1, 2); // TODO: Change to 0, 0 when https://github.com/wala/ML/issues/164 is fixed: test("tf2_test_dataset28.py", "h", 1, 1, 2); } @@ -1072,30 +1056,21 @@ public void testDataset31() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { // TODO: Change to 0, 0 once https://github.com/wala/ML/issues/166 is fixed. test("tf2_test_dataset31.py", "f", 1, 1, 2); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "g1", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "g2", 0, 0); + test("tf2_test_dataset31.py", "g1", 1, 1, 2); + test("tf2_test_dataset31.py", "g2", 1, 1, 2); // TODO: Change to 0, 0 once https://github.com/wala/ML/issues/166 is fixed. test("tf2_test_dataset31.py", "h", 1, 1, 2); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "i1", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "i2", 0, 0); + test("tf2_test_dataset31.py", "i1", 1, 1, 2); + test("tf2_test_dataset31.py", "i2", 1, 1, 2); // TODO: Change to 0, 0 once https://github.com/wala/ML/issues/166 is fixed. test("tf2_test_dataset31.py", "j", 1, 1, 2); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "k1", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "k2", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "k2", 0, 0); + test("tf2_test_dataset31.py", "k1", 1, 1, 2); + test("tf2_test_dataset31.py", "k2", 1, 1, 2); + test("tf2_test_dataset31.py", "k2", 1, 1, 2); // TODO: Change to 0, 0 once https://github.com/wala/ML/issues/166 is fixed. test("tf2_test_dataset31.py", "l", 1, 1, 2); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "m1", 0, 0); - // TODO: Change to 1, 1, 2 once https://github.com/wala/ML/issues/166 is fixed. - test("tf2_test_dataset31.py", "m2", 0, 0); + test("tf2_test_dataset31.py", "m1", 1, 1, 2); + test("tf2_test_dataset31.py", "m2", 1, 1, 2); } @Test @@ -1146,8 +1121,7 @@ public void testDataset37() @Test public void testTensorboardExample() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - // Change to 0, 4 once https://github.com/wala/ML/issues/147 is fixed. - test("tensorboard_example.py", "summarize_weights", 0, 12); + test("tensorboard_example.py", "summarize_weights", 0, 4); } @Test @@ -1588,32 +1562,10 @@ public void testModule() 2); } - /** - * This test needs a PYTHONPATH that points to `proj`. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test needs a PYTHONPATH that points to `proj`. */ + @Test public void testModule2() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj/src/__init__.py", "proj/src/tf2_test_module2a.py", "proj/src/tf2_test_module3.py" @@ -1621,37 +1573,15 @@ public void testModule2() "src/tf2_test_module2a.py", "f", "proj", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } - /** - * This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test should not need a PYTHONPATH. */ + @Test public void testModule3() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj2/src/__init__.py", "proj2/src/tf2_test_module3a.py", "proj2/tf2_test_module4.py" @@ -1659,38 +1589,18 @@ public void testModule3() "src/tf2_test_module3a.py", "f", "proj2", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * This test should not need a PYTHONPATH, meaning that I don't need to set one in the console * when I run the files. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule4() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj3/src/__init__.py", @@ -1701,9 +1611,9 @@ public void testModule4() "src/tf2_test_module4a.py", "f", "proj3", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); test( new String[] { @@ -1715,9 +1625,9 @@ public void testModule4() "src/tf2_test_module4a.py", "g", "proj3", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } @Test @@ -1733,32 +1643,10 @@ public void testModule5() 3); } - /** - * This test needs a PYTHONPATH that points to `proj4`. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test needs a PYTHONPATH that points to `proj4`. */ + @Test public void testModule6() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj4/src/__init__.py", "proj4/src/tf2_test_module4a.py", "proj4/src/tf2_test_module5.py" @@ -1766,37 +1654,15 @@ public void testModule6() "src/tf2_test_module4a.py", "C.f", "proj4", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } - /** - * This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test should not need a PYTHONPATH. */ + @Test public void testModule7() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj5/src/__init__.py", "proj5/src/tf2_test_module5a.py", "proj5/tf2_test_module6.py" @@ -1804,38 +1670,18 @@ public void testModule7() "src/tf2_test_module5a.py", "C.f", "proj5", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * This test should not need a PYTHONPATH, meaning that I don't need to set one in the console * when I run the files. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule8() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj6/src/__init__.py", @@ -1846,9 +1692,9 @@ public void testModule8() "src/tf2_test_module8a.py", "C.f", "proj6", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); test( new String[] { @@ -1860,9 +1706,9 @@ public void testModule8() "src/tf2_test_module8a.py", "D.g", "proj6", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } @Test @@ -1891,33 +1737,10 @@ public void testModule10() 3); } - /** - * This test needs a PYTHONPATH that points to `proj7`. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test needs a PYTHONPATH that points to `proj7`. */ + @Test public void testModule11() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj7/src/__init__.py", @@ -1928,37 +1751,15 @@ public void testModule11() "src/tf2_test_module9b.py", "D.f", "proj7", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } - /** - * This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test should not need a PYTHONPATH. */ + @Test public void testModule12() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj8/src/__init__.py", @@ -1969,37 +1770,15 @@ public void testModule12() "src/tf2_test_module10b.py", "D.f", "proj8", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } - /** - * This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test should not need a PYTHONPATH. */ + @Test public void testModule13() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj9/src/__init__.py", @@ -2010,121 +1789,59 @@ public void testModule13() "src/tf2_test_module11b.py", "D.g", "proj9", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/177. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule14() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj10/C/__init__.py", "proj10/C/B.py", "proj10/A.py"}, "C/B.py", "f", "proj10", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule15() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj11/C/__init__.py", "proj11/C/B.py", "proj11/A.py"}, "C/B.py", "f", "proj11", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } - /** - * This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** This test should not need a PYTHONPATH. */ + @Test public void testModule16() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj12/C/__init__.py", "proj12/C/B.py", "proj12/A.py"}, "C/B.py", "f", "proj12", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** @@ -2132,30 +1849,10 @@ public void testModule16() * https://docs.python.org/3/tutorial/modules.html#packages. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule17() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj13/C/__init__.py", "proj13/C/D/__init__.py", "proj13/C/D/B.py", "proj13/A.py" @@ -2163,9 +1860,9 @@ public void testModule17() "C/D/B.py", "f", "proj13", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** @@ -2174,30 +1871,10 @@ public void testModule17() * different packages. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule18() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj14/C/__init__.py", @@ -2209,9 +1886,9 @@ public void testModule18() "C/D/B.py", "f", "proj14", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); test( new String[] { @@ -2224,39 +1901,19 @@ public void testModule18() "C/E.py", "g", "proj14", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test for https://github.com/wala/ML/issues/177. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule19() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj15/C/__init__.py", "proj15/C/D/__init__.py", "proj15/C/D/B.py", "proj15/A.py" @@ -2264,77 +1921,37 @@ public void testModule19() "C/D/B.py", "f", "proj15", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule20() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj16/C/__init__.py", "proj16/C/B.py", "proj16/A.py"}, "C/B.py", "D.f", "proj16", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule21() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj17/C/__init__.py", "proj17/C/E/__init__.py", "proj17/C/E/B.py", "proj17/A.py" @@ -2342,9 +1959,9 @@ public void testModule21() "C/E/B.py", "D.f", "proj17", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** @@ -2362,30 +1979,10 @@ public void testModule22() * Test for https://github.com/wala/ML/issues/177. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule23() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj19/C/__init__.py", @@ -2397,9 +1994,9 @@ public void testModule23() "C/D/E/B.py", "f", "proj19", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** @@ -2453,30 +2050,10 @@ public void testModule26() * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule27() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj21/C/__init__.py", @@ -2488,9 +2065,9 @@ public void testModule27() "C/D/B.py", "F.f", "proj21", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); test( new String[] { @@ -2503,153 +2080,73 @@ public void testModule27() "C/E.py", "G.g", "proj21", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/177. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule28() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj22/C/__init__.py", "proj22/C/B.py", "proj22/A.py"}, "C/B.py", "D.f", "proj22", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule29() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj23/C/__init__.py", "proj23/C/B.py", "proj23/A.py"}, "C/B.py", "f", "proj23", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule30() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj24/C/__init__.py", "proj24/C/B.py", "proj24/A.py"}, "C/B.py", "D.f", "proj24", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule31() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj25/C/__init__.py", "proj25/C/E/__init__.py", "proj25/C/E/B.py", "proj25/A.py" @@ -2657,77 +2154,37 @@ public void testModule31() "C/E/B.py", "D.f", "proj25", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule32() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj26/C/__init__.py", "proj26/C/B.py", "proj26/A.py"}, "C/B.py", "D.f", "proj26", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule33() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj27/C/__init__.py", "proj27/C/D/__init__.py", "proj27/C/D/B.py", "proj27/A.py" @@ -2735,39 +2192,19 @@ public void testModule33() "C/D/B.py", "f", "proj27", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule34() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj28/C/__init__.py", "proj28/C/D/__init__.py", "proj28/C/D/B.py", "proj28/A.py" @@ -2775,266 +2212,127 @@ public void testModule34() "C/D/B.py", "E.f", "proj28", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule35() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj29/C/__init__.py", "proj29/C/B.py", "proj29/A.py"}, "C/B.py", "f", "proj29", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test for https://github.com/wala/ML/issues/178. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule36() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj30/C/__init__.py", "proj30/C/B.py", "proj30/A.py"}, "C/B.py", "f", "proj30", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule37() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } test( new String[] {"proj31/C/__init__.py", "proj31/C/B.py", "proj31/C/A.py", "proj31/main.py"}, "C/B.py", "f", "proj31", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule38() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj32/C/__init__.py", "proj32/C/B.py", "proj32/C/A.py", "proj32/main.py"}, "C/B.py", "f", "proj32", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule39() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj33/C/__init__.py", "proj33/C/B.py", "proj33/C/A.py", "proj33/main.py"}, "C/B.py", "D.f", "proj33", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule40() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj34/C/__init__.py", "proj34/C/B.py", "proj34/C/A.py", "proj34/main.py"}, "C/B.py", "D.f", "proj34", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule41() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj35/E/__init__.py", @@ -3047,39 +2345,19 @@ public void testModule41() "E/D/B.py", "f", "proj35", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule42() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj36/E/__init__.py", @@ -3092,39 +2370,19 @@ public void testModule42() "E/D/B.py", "F.f", "proj36", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule43() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj37/E/__init__.py", @@ -3137,39 +2395,19 @@ public void testModule43() "E/D/B.py", "F.f", "proj37", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule44() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj38/E/__init__.py", @@ -3182,191 +2420,91 @@ public void testModule44() "E/D/B.py", "f", "proj38", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule45() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj39/C/__init__.py", "proj39/C/B.py", "proj39/C/A.py", "proj39/main.py"}, "C/B.py", "f", "proj39", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule46() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj40/C/__init__.py", "proj40/C/B.py", "proj40/C/A.py", "proj40/main.py"}, "C/B.py", "f", "proj40", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule47() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj41/C/__init__.py", "proj41/C/B.py", "proj41/C/A.py", "proj41/main.py"}, "C/B.py", "D.f", "proj41", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule48() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] {"proj42/C/__init__.py", "proj42/C/B.py", "proj42/C/A.py", "proj42/main.py"}, "C/B.py", "D.f", "proj42", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule49() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj43/E/__init__.py", @@ -3379,39 +2517,19 @@ public void testModule49() "E/D/B.py", "f", "proj43", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule50() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj44/E/__init__.py", @@ -3424,39 +2542,19 @@ public void testModule50() "E/D/B.py", "F.f", "proj44", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule51() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj45/E/__init__.py", @@ -3469,39 +2567,19 @@ public void testModule51() "E/D/B.py", "F.f", "proj45", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {3}); } /** * Test relative imports using wildcards. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule52() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj46/E/__init__.py", @@ -3514,39 +2592,19 @@ public void testModule52() "E/D/B.py", "f", "proj46", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } /** * Test relative imports. * *

This test should not need a PYTHONPATH. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. */ - @Test(expected = AssertionError.class) + @Test public void testModule53() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj47/E/__init__.py", @@ -3561,9 +2619,9 @@ public void testModule53() "E/D/B.py", "f", "proj47", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); test( new String[] { @@ -3579,19 +2637,13 @@ public void testModule53() "D/B.py", "g", "proj47", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule54() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3604,14 +2656,8 @@ public void testModule54() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule55() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3624,14 +2670,8 @@ public void testModule55() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule56() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3644,14 +2684,8 @@ public void testModule56() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule57() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3664,14 +2698,8 @@ public void testModule57() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule58() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3684,14 +2712,8 @@ public void testModule58() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule59() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3704,14 +2726,8 @@ public void testModule59() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule60() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3724,14 +2740,8 @@ public void testModule60() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule61() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3744,14 +2754,8 @@ public void testModule61() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule62() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3764,14 +2768,8 @@ public void testModule62() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule63() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3784,14 +2782,8 @@ public void testModule63() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule64() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3804,14 +2796,8 @@ public void testModule64() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule65() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3824,14 +2810,8 @@ public void testModule65() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule66() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3844,14 +2824,8 @@ public void testModule66() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/202. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/202. */ + @Test public void testModule67() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3864,14 +2838,8 @@ public void testModule67() new int[] {3}); } - /** - * Test https://github.com/wala/ML/issues/205. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/205. */ + @Test public void testModule68() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3884,14 +2852,8 @@ public void testModule68() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/205. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/205. */ + @Test public void testModule69() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3932,14 +2894,8 @@ public void testModule71() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/210. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/210. */ + @Test public void testModule72() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3952,14 +2908,8 @@ public void testModule72() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/210. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/210. */ + @Test public void testModule73() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -3972,14 +2922,8 @@ public void testModule73() new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/210. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/210. */ + @Test public void testModule74() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -4013,14 +2957,8 @@ public void testModule76() test(new String[] {"module.py", "client.py"}, "module.py", "f", "", 1, 1, new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/211. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/211. */ + @Test public void testModule77() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { test( @@ -4040,32 +2978,10 @@ public void testModule78() test(new String[] {"module.py", "client2.py"}, "module.py", "f", "", 1, 1, new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/209. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/209. */ + @Test public void testModule79() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj73/models/__init__.py", @@ -4077,9 +2993,9 @@ public void testModule79() "models/albert.py", "f", "proj73", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); test( new String[] { @@ -4092,37 +3008,15 @@ public void testModule79() "models/bert.py", "g", "proj73", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } - /** - * Test https://github.com/wala/ML/issues/209. - * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + /** Test https://github.com/wala/ML/issues/209. */ + @Test public void testModule80() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // PYTHONPATH is only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - test( new String[] { "proj74/models/__init__.py", @@ -4134,9 +3028,9 @@ public void testModule80() "models/albert.py", "f", "proj74", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); test( new String[] { @@ -4149,9 +3043,9 @@ public void testModule80() "models/bert.py", "g", "proj74", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + 1, + 1, + new int[] {2}); } @Test @@ -4176,54 +3070,12 @@ public void testStaticMethod4() throws ClassHierarchyException, CancelException, @Test public void testStaticMethod5() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Static methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_static_method5.py", - "MyClass.the_static_method", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_static_method5.py", "MyClass.the_static_method", 1, 1, 2); } @Test public void testStaticMethod6() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Static methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_static_method6.py", - "MyClass.the_static_method", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_static_method6.py", "MyClass.the_static_method", 1, 1, 2); } @Test @@ -4238,132 +3090,27 @@ public void testStaticMethod8() throws ClassHierarchyException, CancelException, @Test public void testStaticMethod9() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Static methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 2; - expectedNumberOfTensorVariables = 2; - expectedTensorParameterValueNumbers = new int[] {2, 3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } - - test( - "tf2_test_static_method9.py", - "MyClass.the_static_method", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_static_method9.py", "MyClass.the_static_method", 2, 2, 2, 3); } @Test public void testStaticMethod10() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Static methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 2; - expectedNumberOfTensorVariables = 2; - expectedTensorParameterValueNumbers = new int[] {2, 3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } - - test( - "tf2_test_static_method10.py", - "MyClass.the_static_method", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_static_method10.py", "MyClass.the_static_method", 2, 2, 2, 3); } @Test public void testStaticMethod11() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Static methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_static_method11.py", - "f", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_static_method11.py", "f", 1, 1, 2); } @Test public void testStaticMethod12() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Static methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_static_method12.py", - "f", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_static_method12.py", "f", 1, 1, 2); } @Test public void testClassMethod() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Class methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {2}; - } - - test( - "tf2_test_class_method.py", - "MyClass.the_class_method", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_class_method.py", "MyClass.the_class_method", 1, 1, 3); } @Test @@ -4373,90 +3120,17 @@ public void testClassMethod2() throws ClassHierarchyException, CancelException, @Test public void testClassMethod3() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Class methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_class_method3.py", - "MyClass.f", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_class_method3.py", "MyClass.f", 1, 1, 2); } - /* - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + @Test public void testClassMethod4() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Class methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_class_method4.py", - "MyClass.f", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_class_method4.py", "MyClass.f", 1, 1, 2); } - /* - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - */ - @Test(expected = AssertionError.class) + @Test public void testClassMethod5() throws ClassHierarchyException, CancelException, IOException { - int expectNumberofTensorParameters; - int expectedNumberOfTensorVariables; - int[] expectedTensorParameterValueNumbers; - - // Class methods are only supported for Jython3. - if (usesJython3Testing()) { - expectNumberofTensorParameters = 1; - expectedNumberOfTensorVariables = 1; - expectedTensorParameterValueNumbers = new int[] {3}; - } else { - // NOTE: Remove this case once https://github.com/wala/ML/issues/147 is fixed. - expectNumberofTensorParameters = 0; - expectedNumberOfTensorVariables = 0; - expectedTensorParameterValueNumbers = new int[] {}; - } - - test( - "tf2_test_class_method5.py", - "MyClass.f", - expectNumberofTensorParameters, - expectedNumberOfTensorVariables, - expectedTensorParameterValueNumbers); + test("tf2_test_class_method5.py", "MyClass.f", 1, 1, 2); } @Test @@ -4482,16 +3156,14 @@ public void testDecoratedMethod() throws ClassHierarchyException, CancelExceptio } /** Test https://github.com/wala/ML/issues/188. */ - @Test + @Test(expected = AssertionError.class) public void testDecoratedMethod2() throws ClassHierarchyException, CancelException, IOException { - // NOTE: Change to 0, 0 once https://github.com/wala/ML/issues/147 is fixed. test("tf2_test_decorated_method2.py", "f", 1, 1, 2); } /** Test https://github.com/wala/ML/issues/190. */ - @Test + @Test(expected = AssertionError.class) public void testDecoratedMethod3() throws ClassHierarchyException, CancelException, IOException { - // NOTE: Change to 0, 0 once https://github.com/wala/ML/issues/147 is fixed. test("tf2_test_decorated_method3.py", "raffi", 1, 1, 2); } @@ -4520,17 +3192,20 @@ public void testDecoratedMethod8() throws ClassHierarchyException, CancelExcepti test("tf2_test_decorated_method8.py", "f", 1, 1, 2); } - /** This decorator isn't defined. Thus, we shouldn't have a CG node for it. */ - @Test + /** + * This decorator isn't defined. Thus, we shouldn't have a CG node for it. + * + *

We now require nodes for functions under test. Otherwise, a test could pass even though the + * function doesn't exist. + */ + @Test(expected = AssertionError.class) public void testDecoratedMethod9() throws ClassHierarchyException, CancelException, IOException { - // NOTE: Change to 0, 0 once https://github.com/wala/ML/issues/147 is fixed. - test("tf2_test_decorated_method9.py", "f", 1, 1, 2); + test("tf2_test_decorated_method9.py", "f", 0, 0); } /** Test https://github.com/wala/ML/issues/190. */ - @Test + @Test(expected = AssertionError.class) public void testDecoratedMethod10() throws ClassHierarchyException, CancelException, IOException { - // NOTE: Change to 0, 0 once https://github.com/wala/ML/issues/147 is fixed. test("tf2_test_decorated_method10.py", "f", 1, 1, 2); } @@ -4541,14 +3216,13 @@ public void testDecoratedMethod11() throws ClassHierarchyException, CancelExcept @Test public void testDecoratedMethod12() throws ClassHierarchyException, CancelException, IOException { - // NOTE: Change to 0, 0 once https://github.com/wala/ML/issues/147 is fixed. - test("tf2_test_decorated_method12.py", "f", 1, 1, 2); + // NOTE: Change to 1, 1, 2 once https://github.com/wala/ML/issues/188 is fixed. + test("tf2_test_decorated_method12.py", "f", 0, 0); } /** Test https://github.com/wala/ML/issues/190. */ - @Test + @Test(expected = AssertionError.class) public void testDecoratedMethod13() throws ClassHierarchyException, CancelException, IOException { - // NOTE: Change to 0, 0 once https://github.com/wala/ML/issues/147 is fixed. test("tf2_test_decorated_method13.py", "f", 1, 1, 2); } @@ -4574,13 +3248,9 @@ public void testDecoratedFunctions2() * Test a pytest without decorators that needs a PYTHONPATH. This is a "control" case. We'll add a * decorator in the next case. * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - * * @see TestTensorflow2Model#testModule11(). */ - @Test(expected = AssertionError.class) + @Test public void testDecoratedFunctions3() throws ClassHierarchyException, CancelException, IOException { test( @@ -4615,13 +3285,9 @@ public void testDecoratedFunctions5() /** * Test a pytest with a decorator that needs a PYTHONPATH. * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - * * @see TestTensorflow2Model#testModule11(). */ - @Test(expected = AssertionError.class) + @Test public void testDecoratedFunctions6() throws ClassHierarchyException, CancelException, IOException { test( @@ -4649,13 +3315,9 @@ public void testDecoratedFunctions7() /** * Test a Pytest with a decorator without parameters that needs a PYTHONPATH. * - *

We now require nodes for functions under test. Otherwise, a test could pass even though the - * function doesn't exist. Remove the below expected assertion failure once - * https://github.com/wala/ML/issues/147 is fixed. - * * @see TestTensorflow2Model#testModule11(). */ - @Test(expected = AssertionError.class) + @Test public void testDecoratedFunctions8() throws ClassHierarchyException, CancelException, IOException { test( @@ -4897,15 +3559,4 @@ private List getPathFiles(String string) { }) .collect(toList()); } - - /** - * Returns true iff Jython3 is used for testing. - * - * @return True iff Jython3 is used for testing. - */ - protected static boolean usesJython3Testing() { - String classpath = System.getProperty(JAVA_CLASSPATH_SYSTEM_PROPERTY_KEY); - String[] classpathEntries = classpath.split(File.pathSeparator); - return Arrays.stream(classpathEntries).anyMatch(cpe -> cpe.contains(JYTHON3_TEST_PROJECT)); - } } diff --git a/com.ibm.wala.cast.python.ml/pom.xml b/com.ibm.wala.cast.python.ml/pom.xml index 2c02fc343..d36237871 100644 --- a/com.ibm.wala.cast.python.ml/pom.xml +++ b/com.ibm.wala.cast.python.ml/pom.xml @@ -44,7 +44,7 @@ ${project.groupId} - com.ibm.wala.cast.python.jython + com.ibm.wala.cast.python.jython3 ${project.version} diff --git a/com.ibm.wala.cast.python.test/pom.xml b/com.ibm.wala.cast.python.test/pom.xml index 0e1a6833d..d2a544c97 100644 --- a/com.ibm.wala.cast.python.test/pom.xml +++ b/com.ibm.wala.cast.python.test/pom.xml @@ -51,6 +51,14 @@ junit junit + + org.ow2.asm + asm-all + + + com.github.jnr + jnr-constants +