Skip to content

Commit e3a134c

Browse files
tkrodriguezdougxc
authored andcommitted
Run all tests in StringIntrinsicAVX3ThresholdTest
1 parent 2c98339 commit e3a134c

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/SubprocessTest.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ public SubprocessUtil.Subprocess launchSubprocess(Predicate<String> vmArgsFilter
7474
return launchSubprocess(null, vmArgsFilter, true, getClass(), currentUnitTestName(), runnable, args);
7575
}
7676

77-
public SubprocessUtil.Subprocess launchSubprocess(Class<? extends GraalCompilerTest> testClass, Runnable runnable, String... args) throws InterruptedException, IOException {
78-
return launchSubprocess(null, null, true, testClass, currentUnitTestName(), runnable, args);
79-
}
80-
8177
public static SubprocessUtil.Subprocess launchSubprocess(Class<? extends GraalCompilerTest> testClass, String testSelector, Runnable runnable, String... args)
8278
throws InterruptedException, IOException {
8379
return launchSubprocess(null, null, true, testClass, testSelector, runnable, args);
@@ -93,6 +89,8 @@ private static List<String> filter(List<String> args, Predicate<String> vmArgsFi
9389
return result;
9490
}
9591

92+
public static final String ALL_TESTS = "ALL_TESTS";
93+
9694
public boolean isRecursiveLaunch() {
9795
return isRecursiveLaunch(getClass());
9896
}
@@ -123,7 +121,7 @@ public static SubprocessUtil.Subprocess launchSubprocess(Predicate<List<String>>
123121
List<String> mainClassAndArgs = new LinkedList<>();
124122
mainClassAndArgs.add("com.oracle.mxtool.junit.MxJUnitWrapper");
125123
assert testSelector != null : "must pass the name of the current unit test";
126-
String testName = testClass.getName() + "#" + testSelector;
124+
String testName = testSelector.equals(ALL_TESTS) ? testClass.getName() : testClass.getName() + "#" + testSelector;
127125
mainClassAndArgs.add(testName);
128126
boolean junitVerbose = getProcessCommandLine().contains("-JUnitVerbose");
129127
if (junitVerbose) {

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/StringIntrinsicAVX3ThresholdTest.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public void before() {
5252
*/
5353
}
5454

55-
@SuppressWarnings("unused")
56-
public void testWithAVX3Threshold(String testSelector, Class<? extends GraalCompilerTest> testClass) {
55+
public void testWithAVX3Threshold(Class<? extends GraalCompilerTest> testClass) {
5756
Runnable nopRunnable = () -> {
5857
/*
5958
* The runnable is only relevant when running a test in the same class as the parent
@@ -62,7 +61,7 @@ public void testWithAVX3Threshold(String testSelector, Class<? extends GraalComp
6261
};
6362
SubprocessUtil.Subprocess subprocess = null;
6463
try {
65-
subprocess = launchSubprocess(testClass, nopRunnable, "-XX:UseAVX=3", "-XX:+UnlockDiagnosticVMOptions", "-XX:AVX3Threshold=0");
64+
subprocess = launchSubprocess(testClass, ALL_TESTS, nopRunnable, "-XX:UseAVX=3", "-XX:+UnlockDiagnosticVMOptions", "-XX:AVX3Threshold=0");
6665
} catch (IOException | InterruptedException e) {
6766
Assert.fail("subprocess exception: " + e);
6867
}
@@ -71,17 +70,17 @@ public void testWithAVX3Threshold(String testSelector, Class<? extends GraalComp
7170

7271
@Test
7372
public void compressInflate() {
74-
testWithAVX3Threshold("compressInflate", StringCompressInflateTest.class);
73+
testWithAVX3Threshold(StringCompressInflateTest.class);
7574
}
7675

7776
@Test
7877
public void compareTo() {
79-
testWithAVX3Threshold("compareTo", StringCompareToTest.class);
80-
testWithAVX3Threshold("compareTo", StringCompareToAVX512Test.class);
78+
testWithAVX3Threshold(StringCompareToTest.class);
79+
testWithAVX3Threshold(StringCompareToAVX512Test.class);
8180
}
8281

8382
@Test
8483
public void countPositives() {
85-
testWithAVX3Threshold("countPositives", CountPositivesTest.class);
84+
testWithAVX3Threshold(CountPositivesTest.class);
8685
}
8786
}

0 commit comments

Comments
 (0)