Skip to content

Commit

Permalink
[ci] break jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Feb 1, 2024
1 parent 495b4a4 commit 6451982
Show file tree
Hide file tree
Showing 69 changed files with 111 additions and 125 deletions.
2 changes: 1 addition & 1 deletion tests/sys/src/FileNames.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FileNames {
case _:
[
// 255 bytes is the max filename length according to http://en.wikipedia.org/wiki/Comparison_of_file_systems
#if !(python || neko || cpp || java)
#if !(python || neko || cpp || jvm)
[for (i in 0...255) "a"].join(""),
#end
];
Expand Down
6 changes: 3 additions & 3 deletions tests/sys/src/TestSys.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestSys extends TestCommandBase {
// new copies should not be affected
Assert.isNull(Sys.environment()[nonExistent]);

#if !java
#if !jvm
// env should not update when environment updates
final toUpdate = "TO_UPDATE";

Expand Down Expand Up @@ -58,7 +58,7 @@ class TestSys extends TestCommandBase {
Assert.isNull(Sys.getEnv("doesn't exist"));
}

#if !java
#if !jvm
function testPutEnv() {
Sys.putEnv("FOO", "value");
Assert.equals("value", Sys.getEnv("FOO"));
Expand Down Expand Up @@ -129,7 +129,7 @@ class TestSys extends TestCommandBase {
Assert.notEquals(current, haxe.io.Path.removeTrailingSlashes(current));
}

#if !java
#if !jvm
function testSetCwd() {
var cur = Sys.getCwd();
Sys.setCwd("../");
Expand Down
8 changes: 4 additions & 4 deletions tests/sys/src/TestUnicode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class TestUnicode extends utest.Test {

#if target.unicode
function testFilesystem() {
#if !java // java does not have this functionality
#if !jvm // java does not have this functionality
// setCwd + getCwd
Sys.setCwd("test-res");
function enterLeave(dir:String, ?alt:String):Void {
Expand Down Expand Up @@ -175,7 +175,7 @@ class TestUnicode extends utest.Test {
);
}, "test-res");

#if !java // java does not have this functionality
#if !jvm // java does not have this functionality
assertNormalEither(path -> {
if (!FileSystem.exists(path)) return false; // NFC/NFD differences
Sys.setCwd(path);
Expand Down Expand Up @@ -302,7 +302,7 @@ class TestUnicode extends utest.Test {
assertUEquals(runUtility(["println", '$i', mode]).stdout, str + endLine);
// trace
assertUEnds(runUtility(["trace", '$i', mode]).stdout, str + endLine);
#if !java
#if !jvm
// putEnv + getEnv
assertUEquals(runUtility(["putEnv", "HAXE_TEST", '$i', mode, "getEnv", "HAXE_TEST"]).stdout, str + endLine);
// putEnv + environment
Expand All @@ -311,7 +311,7 @@ class TestUnicode extends utest.Test {
});

// args
if (#if (java || eval || cpp) Sys.systemName() != "Windows" #else true #end) {
if (#if (jvm || eval || cpp) Sys.systemName() != "Windows" #else true #end) {
// https://stackoverflow.com/questions/7660651/passing-command-line-unicode-argument-to-java-code
UnicodeSequences.normalBoth(str -> {
assertUEquals(runUtility(["args", str]).stdout, str + endLine);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/RunCastGenerator.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class RunCastGenerator {
}
line("// This file is auto-generated from RunCastGenerator.hx - do not edit!");
line("package unit;");
line("#if java");
line("#if jvm");
line("import java.StdTypes;");
line("private typedef Int32 = Int;");
line("private typedef Float32 = Single;");
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/src/unit/MyClass.hx
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ class ParamConstraintsClass {

public function memberAnon < A:{ x : Int } & { y : Float }> (v:A) { return v.x + v.y; }

#if !java //this is a known bug caused by issue #915
@:overload(function< A, B:Array<A> > (a:A, b:B):Void { } )
public function memberOverload < A, B > (a:String, b:String) { }
#end
}

class ParamConstraintsClass2<T> {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/src/unit/TestConstrainedMonomorphs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private class MyNotString {
}
}

#if java
#if jvm
@:native("unit.DetectiveHaxeExtern")
extern private class DetectiveHaxeExtern {
overload static function itWasYou(i1:Int, i2:Int):String;
Expand Down Expand Up @@ -64,7 +64,7 @@ class TestConstrainedMonomorphs extends Test {
eq("fooFOO", infer(new MyNotString("foo")));
}

#if java
#if jvm
function testDetectiveHaxe() {
var a = null;
eq("nullfoo", DetectiveHaxeExtern.itWasYou(a, "foo"));
Expand Down Expand Up @@ -121,4 +121,4 @@ class TestConstrainedMonomorphs extends Test {
}
#end

}
}
2 changes: 1 addition & 1 deletion tests/unit/src/unit/TestDCE.hx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class TestDCE extends Test {
}

// TODO: this should be possible in lua
#if (!cpp && !java && !lua)
#if (!cpp && !jvm && !lua)
public function testProperty2() {
var a = new RemovePropertyKeepAccessors();
a.test = 3;
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/src/unit/TestExceptions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ private class CustomNativeException extends php.Exception {}
private class CustomNativeException extends js.lib.Error {}
#elseif flash
private class CustomNativeException extends flash.errors.Error {}
#elseif java
#elseif jvm
private class CustomNativeException extends java.lang.RuntimeException {}
#elseif python
private class CustomNativeException extends python.Exceptions.Exception {}
#elseif (lua || eval || neko || hl || cpp)
private class CustomNativeException { public function new(m:String) {} }
#end

#if java
#if jvm
private class NativeExceptionBase extends java.lang.RuntimeException {}
private class NativeExceptionChild extends NativeExceptionBase {}
private class NativeExceptionOther extends java.lang.RuntimeException {}
Expand Down Expand Up @@ -381,7 +381,7 @@ class TestExceptions extends Test {
}
}

#if java
#if jvm
function testCatchChain() {
eq("caught NativeExceptionChild: msg", raise(() -> throw new NativeExceptionChild("msg")));
eq("caught NativeExceptionBase: msg", raise(() -> throw new NativeExceptionBase("msg")));
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/TestInterface.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private class Point implements IX implements IY {
return x;
}

public function getY() : #if java /* see https://github.com/HaxeFoundation/haxe/issues/6486 */ Float #else Int #end {
public function getY() : Int {
return y;
}

Expand Down Expand Up @@ -95,4 +95,4 @@ class TestInterface extends Test {
eq(i2, c);
eq(i1,i2);
}
}
}
2 changes: 1 addition & 1 deletion tests/unit/src/unit/TestJava.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import haxe.test.TEnum;
import java.util.EnumSet;
import java.vm.*;

#if java
#if jvm
@:strict(haxe.test.MyClass.MyClass_MyAnnotation({author: "John Doe", someEnum: TB}))
@:strict(MyClass_ParameterLessAnnotation)
class TestJava extends Test {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/TestMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function main() {
#if !no_pattern_matching
new TestMatch(),
#end
#if java
#if jvm
new TestJava(),
#end
#if lua
Expand All @@ -84,7 +84,7 @@ function main() {
#if php
new TestPhp(),
#end
#if java
#if jvm
new TestOverloads(),
#end
new TestOverloadsForEveryone(),
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/TestMisc.hx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class TestMisc extends Test {
eq(opt2().x, 5);
eq(opt2().y, "hello");

#if !(flash || cpp || java)
#if !(flash || cpp || jvm)
eq(opt2(null, null).x, 5);
#end
eq(opt2(0, null).y, "hello");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/TestNumericCasts.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated from RunCastGenerator.hx - do not edit!
package unit;
#if java
#if jvm
import java.StdTypes;
private typedef Int32 = Int;
private typedef Float32 = Single;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/TestOverloads.hx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class TestOverloads extends Test
eq(Primitives.prim(nf, null), "Null<Float>");
var dyn:Dynamic = null;
eq(Primitives.prim(dyn), "Dynamic");
#if java
#if jvm
var s:Single = 1.0;
eq(Primitives.prim(s), "Single" );
var ns:Null<Single> = null;
Expand Down Expand Up @@ -251,7 +251,7 @@ private class Primitives
return "Null<Int>";
}

#if java
#if jvm
overload public static function prim(v:Single):String
{
return "Single";
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/TestReflect.hx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class TestReflect extends Test {
eq( i.intValue, 55 );
var i = Type.createEmptyInstance(MyClass);
t( (i is MyClass) );
eq( i.get(), #if (flash || cpp || java || hl) 0 #else null #end );
eq( i.intValue, #if (flash || cpp || java || hl) 0 #else null #end );
eq( i.get(), #if (flash || cpp || jvm || hl) 0 #else null #end );
eq( i.intValue, #if (flash || cpp || jvm || hl) 0 #else null #end );
var e : MyEnum = Type.createEnum(MyEnum,__unprotect__("A"));
eq( e, MyEnum.A );
var e : MyEnum = Type.createEnum(MyEnum,__unprotect__("C"),[55,"hello"]);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/TestType.hx
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class TestType extends Test {
//typeError(pcc.memberAnon( { x : 1 } ));
//typeError(pcc.memberAnon( { y : 3. } ));

#if !java
#if !jvm
// pcc.memberOverload("foo", "bar");
#end
// TODO: this should not fail (overload accepts)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue10143.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package unit.issues;

//targets with pf_supports_rest_args = true
#if (js || lua || php || java || python || flash)
#if (js || lua || php || jvm || python || flash)

class Issue10143 extends Test {
function test1() {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/issues/Issue10193.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package unit.issues;

class Issue10193 extends Test {
#if (js || java)
#if (js || jvm)
function test() {
var c = new C(42);
eq(42, c.a);
Expand All @@ -10,7 +10,7 @@ class Issue10193 extends Test {
#end
}

#if (js || java) // some targets are not happy with this for some reason...
#if (js || jvm) // some targets are not happy with this for some reason...
@:keep
@:native("Issue10193E")
private class EImpl {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue10508.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package unit.issues;

class Issue10508 extends Test {
#if java
#if jvm
function test() {
t(java.math.RoundingMode.getConstructors().length > 0);
t(java.math.RoundingMode.createAll().length > 0);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue10571.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package unit.issues;

class Issue10571 extends Test {
#if java
#if jvm
function test() {
eq("test()", foo());
eq("test(I)", foo(1));
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue10618.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package unit.issues;

#if java
#if jvm
@:keep
private class NotMain implements java.util.Iterator<String> {
static function main() {}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/issues/Issue1925.hx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package unit.issues;
#if java
#if jvm
import java.NativeArray;
#end

class Issue1925 extends Test {
#if java
#if jvm
static var d2:Array<NativeArray<Int>>;
function test() {
var d = new NativeArray<Int>(10);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/issues/Issue2049.hx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package unit.issues;
#if java
#if jvm
import java.NativeArray;
import java.Lib;
#end

class Issue2049 extends unit.Test
{
#if java
#if jvm
public function test()
{
var arr = [ 1., 1., 1., 0.5 ].map( function( n: Float ): Single { return n; });
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/issues/Issue2648.hx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package unit.issues;
import unit.Test;

#if java
#if jvm
private class TestParam<T> {
@:overload static public function forName(s:Int) { }
@:overload static public function forName(s:String) { }
}
#end

class Issue2648 extends Test {
#if java
#if jvm
function test() {
TestParam.forName(1);
TestParam.forName("s");
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unit/issues/Issue2688.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package unit.issues;

class Issue2688 extends Test {
#if java
#if jvm
public function test() {
var x = 0;
var b = new B(function() {
Expand All @@ -13,7 +13,7 @@ class Issue2688 extends Test {
#end
}

#if java
#if jvm
@:nativeGen
private class A {
public function new() {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue2754.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package unit.issues;

class Issue2754 extends unit.Test
{
#if java
#if jvm
public function testClass()
{
var tc = new TestClass();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue2772.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package unit.issues;

class Issue2772 extends Test
{
#if java
#if jvm
public function test()
{
var f = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/unit/issues/Issue2861.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package unit.issues;

class Issue2861 extends Test
{
#if (flash || neko || cpp || java || php || hl)
#if (flash || neko || cpp || jvm || php || hl)
public function test()
{
var b = haxe.io.Bytes.alloc(2048);
Expand Down
Loading

0 comments on commit 6451982

Please sign in to comment.