Skip to content

Commit

Permalink
Fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Apr 2, 2024
1 parent 2ec5e9d commit ee55339
Showing 1 changed file with 118 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1641,28 +1641,60 @@ public void testModule5()
@Test
public void testModule6()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
int expectNumberofTensorParameters;
int expectedNumberOfTensorVariables;
int[] expectedTensorParameterValueNumbers;

// PYTHONPATH is only supported for Jython3.
if (getUsesJython3Testing()) {
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/tf2_test_module4a.py", "proj4/src/tf2_test_module5.py"},
"src/tf2_test_module4a.py",
"C.f",
"proj4",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);
}

/** 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 (getUsesJython3Testing()) {
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/tf2_test_module5a.py", "proj5/tf2_test_module6.py"},
"src/tf2_test_module5a.py",
"C.f",
"proj5",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);
}

/**
Expand All @@ -1672,6 +1704,22 @@ public void testModule7()
@Test
public void testModule8()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
int expectNumberofTensorParameters;
int expectedNumberOfTensorVariables;
int[] expectedTensorParameterValueNumbers;

// PYTHONPATH is only supported for Jython3.
if (getUsesJython3Testing()) {
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/tf2_test_module8a.py",
Expand All @@ -1681,9 +1729,9 @@ public void testModule8()
"src/tf2_test_module8a.py",
"C.f",
"proj6",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);

test(
new String[] {
Expand All @@ -1694,9 +1742,9 @@ public void testModule8()
"src/tf2_test_module8a.py",
"D.g",
"proj6",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);
}

@Test
Expand Down Expand Up @@ -1729,6 +1777,23 @@ public void testModule10()
@Test
public void testModule11()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {

int expectNumberofTensorParameters;
int expectedNumberOfTensorVariables;
int[] expectedTensorParameterValueNumbers;

// PYTHONPATH is only supported for Jython3.
if (getUsesJython3Testing()) {
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/tf2_test_module9a.py",
Expand All @@ -1738,15 +1803,31 @@ public void testModule11()
"src/tf2_test_module9b.py",
"D.f",
"proj7",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);
}

/** 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 (getUsesJython3Testing()) {
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/tf2_test_module10a.py",
Expand All @@ -1756,15 +1837,31 @@ public void testModule12()
"src/tf2_test_module10b.py",
"D.f",
"proj8",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);
}

/** 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 (getUsesJython3Testing()) {
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/tf2_test_module11a.py",
Expand All @@ -1774,9 +1871,9 @@ public void testModule13()
"src/tf2_test_module11b.py",
"D.g",
"proj9",
1,
1,
new int[] {3});
expectNumberofTensorParameters,
expectedNumberOfTensorVariables,
expectedTensorParameterValueNumbers);
}

private void test(
Expand Down

0 comments on commit ee55339

Please sign in to comment.