mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
wasm-gc: fix html generated for manually running JUnit test
This commit is contained in:
parent
96bf4379c9
commit
f143fc2af8
|
@ -109,7 +109,7 @@ class WebAssemblyGCPlatformSupport extends TestPlatformSupport<WasmGCTarget> {
|
||||||
@Override
|
@Override
|
||||||
void additionalOutput(File outputPath, File outputPathForMethod, TeaVMTestConfiguration<?> configuration,
|
void additionalOutput(File outputPath, File outputPathForMethod, TeaVMTestConfiguration<?> configuration,
|
||||||
MethodReference reference) {
|
MethodReference reference) {
|
||||||
htmlOutput(outputPath, outputPathForMethod, configuration, reference, "teavm-run-test-wasm.html");
|
htmlOutput(outputPath, outputPathForMethod, configuration, reference, "teavm-run-test-wasm-gc.html");
|
||||||
var testPath = getOutputFile(outputPath, "classTest", configuration.getSuffix(),
|
var testPath = getOutputFile(outputPath, "classTest", configuration.getSuffix(),
|
||||||
getExtension() + "-runtime.js");
|
getExtension() + "-runtime.js");
|
||||||
try {
|
try {
|
||||||
|
@ -122,7 +122,7 @@ class WebAssemblyGCPlatformSupport extends TestPlatformSupport<WasmGCTarget> {
|
||||||
@Override
|
@Override
|
||||||
void additionalSingleTestOutput(File outputPathForMethod, TeaVMTestConfiguration<?> configuration,
|
void additionalSingleTestOutput(File outputPathForMethod, TeaVMTestConfiguration<?> configuration,
|
||||||
MethodReference reference) {
|
MethodReference reference) {
|
||||||
htmlSingleTestOutput(outputPathForMethod, configuration, "teavm-run-test-wasm.html");
|
htmlSingleTestOutput(outputPathForMethod, configuration, "teavm-run-test-wasm-gc.html");
|
||||||
var testPath = getOutputFile(outputPathForMethod, "test", configuration.getSuffix(),
|
var testPath = getOutputFile(outputPathForMethod, "test", configuration.getSuffix(),
|
||||||
getExtension() + "-runtime.js");
|
getExtension() + "-runtime.js");
|
||||||
try {
|
try {
|
||||||
|
|
49
tools/junit/src/main/resources/teavm-run-test-wasm-gc.html
Normal file
49
tools/junit/src/main/resources/teavm-run-test-wasm-gc.html
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
~ Copyright 2018 Alexey Andreev.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TeaVM JUnit test</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="${SCRIPT}-runtime.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
TeaVM.wasm.load("${SCRIPT}", {
|
||||||
|
installImports(o) {
|
||||||
|
o.teavmTest = {
|
||||||
|
success() {
|
||||||
|
var pre = document.createElement("pre");
|
||||||
|
document.body.appendChild(pre);
|
||||||
|
pre.appendChild(document.createTextNode("OK"));
|
||||||
|
},
|
||||||
|
failure(javaString) {
|
||||||
|
let jsString = "";
|
||||||
|
let length = instance.exports.stringLength(javaString);
|
||||||
|
for (let i = 0; i < length; ++i) {
|
||||||
|
jsString += String.fromCharCode(instance.exports.charAt(javaString, i));
|
||||||
|
}
|
||||||
|
var pre = document.createElement("pre");
|
||||||
|
document.body.appendChild(pre);
|
||||||
|
pre.appendChild(document.createTextNode(jsString));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).then(teavm => teavm.main(["${IDENTIFIER}"]));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user