mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
Enable tests because SpiderMonkey supports bigint<->i64 now.
This commit is contained in:
parent
0d92b32162
commit
5c3536ffd3
@ -548,7 +548,7 @@ public class WasmRule extends TemporaryFolder {
|
|||||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, null );
|
compiler.setProperty( JWebAssembly.WASM_USE_GC, null );
|
||||||
System.clearProperty( "SpiderMonkey" );
|
System.clearProperty( "SpiderMonkey" );
|
||||||
}
|
}
|
||||||
ProcessBuilder process = new ProcessBuilder( spiderMonkey.getCommand(), /*"--wasm-bigint",*/ script.getAbsolutePath() );
|
ProcessBuilder process = new ProcessBuilder( spiderMonkey.getCommand(), "--wasm-bigint", script.getAbsolutePath() );
|
||||||
if( gc ) {
|
if( gc ) {
|
||||||
process.command().add( 1, "--wasm-gc" );
|
process.command().add( 1, "--wasm-gc" );
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,6 @@ public class ArrayOperations extends AbstractBaseTest {
|
|||||||
@Test
|
@Test
|
||||||
@Override
|
@Override
|
||||||
public void test() {
|
public void test() {
|
||||||
Assume.assumeFalse( (getScriptEngine().name().startsWith( "SpiderMonkey" ) )
|
|
||||||
&& "loopLong".equals( getMethod() ) ); // TODO SpiderMonkey https://bugzilla.mozilla.org/show_bug.cgi?id=1511958
|
|
||||||
Assume.assumeFalse( getScriptEngine().name().endsWith( "GC" ) );
|
Assume.assumeFalse( getScriptEngine().name().endsWith( "GC" ) );
|
||||||
super.test();
|
super.test();
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,6 @@ public class DynamicValues {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void currentTimeMillis() {
|
public void currentTimeMillis() {
|
||||||
assumeFalse( script == ScriptEngine.SpiderMonkey || script == ScriptEngine.SpiderMonkeyWat );
|
|
||||||
long before = System.currentTimeMillis();
|
long before = System.currentTimeMillis();
|
||||||
String result = rule.evalWasm( script, "currentTimeMillis" );
|
String result = rule.evalWasm( script, "currentTimeMillis" );
|
||||||
long after = System.currentTimeMillis();
|
long after = System.currentTimeMillis();
|
||||||
|
@ -235,15 +235,13 @@ public class MathAPI extends AbstractBaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Export
|
@Export
|
||||||
static int roundD3_8() {
|
static long roundD3_8() {
|
||||||
// SpiderMonkey does not support BigInt currently
|
return Math.round( 3.8 );
|
||||||
return (int)Math.round( 3.8 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Export
|
@Export
|
||||||
static int roundD_3_8() {
|
static long roundD_3_8() {
|
||||||
// SpiderMonkey does not support BigInt currently
|
return Math.round( -3.8 );
|
||||||
return (int)Math.round( -3.8 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Export
|
@Export
|
||||||
|
@ -15,15 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package de.inetsoftware.jwebassembly.runtime;
|
package de.inetsoftware.jwebassembly.runtime;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.junit.ClassRule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
@ -41,9 +38,6 @@ import de.inetsoftware.jwebassembly.api.annotation.Import;
|
|||||||
@RunWith( Parameterized.class )
|
@RunWith( Parameterized.class )
|
||||||
public class RuntimeErrors {
|
public class RuntimeErrors {
|
||||||
|
|
||||||
@ClassRule
|
|
||||||
public static WasmRule rule = new WasmRule( TestClass.class );
|
|
||||||
|
|
||||||
private final ScriptEngine script;
|
private final ScriptEngine script;
|
||||||
|
|
||||||
public RuntimeErrors( ScriptEngine script ) {
|
public RuntimeErrors( ScriptEngine script ) {
|
||||||
@ -55,26 +49,6 @@ public class RuntimeErrors {
|
|||||||
return ScriptEngine.testParams();
|
return ScriptEngine.testParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void longReturn() {
|
|
||||||
assumeTrue( script == ScriptEngine.SpiderMonkey || script == ScriptEngine.SpiderMonkeyWat );
|
|
||||||
String error = rule.evalWasm( script, "longReturn" );
|
|
||||||
int newlineIdx = error.indexOf( '\n' );
|
|
||||||
if( newlineIdx > 0 ) {
|
|
||||||
error = error.substring( 0, newlineIdx );
|
|
||||||
}
|
|
||||||
String expected = "TypeError: cannot pass i64 to or from JS";
|
|
||||||
assertEquals( expected, error );
|
|
||||||
}
|
|
||||||
|
|
||||||
static class TestClass {
|
|
||||||
|
|
||||||
@Export
|
|
||||||
static long longReturn() {
|
|
||||||
return Long.MAX_VALUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void compileErrorTest( String expectedMessge, Class<?> classes ) throws IOException {
|
private void compileErrorTest( String expectedMessge, Class<?> classes ) throws IOException {
|
||||||
WasmRule wasm = new WasmRule( classes );
|
WasmRule wasm = new WasmRule( classes );
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user