Skip to content

Commit

Permalink
[GR-54772] Install TruffleTestClass both in TestRunner#createTestClas…
Browse files Browse the repository at this point in the history
…s and TruffleRunner.ParameterizedRunner constructor in order for it to work both with JUnit 4.12 and 4.13.2.

PullRequest: graal/18060
  • Loading branch information
jchalou committed Jun 19, 2024
2 parents 895eb28 + 9516a26 commit 133d179
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public TruffleLanguage<?> getTestLanguage() {
private static final class ParameterizedRunner extends BlockJUnit4ClassRunnerWithParameters {

ParameterizedRunner(TestWithParameters test) throws InitializationError {
super(test);
super(new TestWithParameters(test.getName(), new TruffleTestClass(test.getTestClass().getJavaClass()), test.getParameters()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

import static org.graalvm.wasm.utils.WasmBinaryTools.compileWat;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;

import java.io.IOException;
import java.util.function.Consumer;
Expand Down Expand Up @@ -163,7 +164,7 @@ public void linkingFailureInvertedOnlyAux() throws IOException, InterruptedExcep
// We can later refine these semantics, and avoid a failure here.
// To do this, we should only lazily link exactly the required modules, instead of
// linking all of them.
Assert.assertThat("Should fail due to unresolved import in the other module.", e.getMessage(),
assertThat("Should fail due to unresolved import in the other module.", e.getMessage(),
containsString("module 'non_existing', referenced by the import 'f' in the module 'module1', does not exist"));
}

Expand Down Expand Up @@ -198,7 +199,7 @@ public void linkingFailureOnlyAux() throws IOException, InterruptedException {
// We can later refine these semantics, and avoid a failure here.
// To do this, we should only lazily link exactly the required modules, instead of
// linking all of them.
Assert.assertThat("Should fail due to unresolved import in the other module.", e.getMessage(),
assertThat("Should fail due to unresolved import in the other module.", e.getMessage(),
containsString("module 'non_existing', referenced by the import 'f' in the module 'module1', does not exist"));
}

Expand Down Expand Up @@ -227,7 +228,7 @@ public void linkingFailureDueToDependency() throws IOException, InterruptedExcep
g.execute();
Assert.fail("Should not reach here.");
} catch (Throwable e) {
Assert.assertThat("Should fail due to unresolved import in the other module.", e.getMessage(),
assertThat("Should fail due to unresolved import in the other module.", e.getMessage(),
containsString("module 'non_existing', referenced by the import 'f' in the module 'module1', does not exist"));
}

Expand All @@ -236,7 +237,7 @@ public void linkingFailureDueToDependency() throws IOException, InterruptedExcep
g2.execute();
Assert.fail("Should not reach here.");
} catch (Throwable e) {
Assert.assertThat("Should fail due to both modules being in a failed linking state.", e.getMessage(),
assertThat("Should fail due to both modules being in a failed linking state.", e.getMessage(),
containsString("Linking of module wasm-module(module2) previously failed"));
}
}
Expand Down

0 comments on commit 133d179

Please sign in to comment.