Browse Source

added Java to unit tests (not running broken tests)

Simon Krajewski 13 years ago
parent
commit
1300c9d97f
5 changed files with 39 additions and 6 deletions
  1. 18 0
      tests/unit/RunJava.hx
  2. 5 3
      tests/unit/Test.hx
  3. 0 2
      tests/unit/TestInt64.hx
  4. 4 0
      tests/unit/unit.html
  5. 12 1
      tests/unit/unit.hxml

+ 18 - 0
tests/unit/RunJava.hx

@@ -0,0 +1,18 @@
+class RunJava {
+
+	static function main() {
+		var p = new neko.io.Process("java",["-cp",neko.Web.getCwd()+"/java/src", "unit.Test"]);
+		try {
+			while( true ) {
+				var c = p.stdout.readByte();
+				if( c == "\n".code )
+					neko.Lib.print("<br>");
+				else
+					neko.Lib.print(StringTools.htmlEscape(String.fromCharCode(c)));
+			}
+		} catch ( e : haxe.io.Eof ) {
+		}
+		neko.Lib.print(StringTools.htmlEscape(p.stderr.readAll().toString()).split("\n").join("<br>"));
+	}
+
+}

+ 5 - 3
tests/unit/Test.hx

@@ -190,14 +190,16 @@ class Test #if swf_mark implements mt.Protect #end #if as3 implements haxe.Publi
 			new TestReflect(),
 			new TestReflect(),
 			new TestBytes(),
 			new TestBytes(),
 			new TestInt32(),
 			new TestInt32(),
-			new TestInt64(),
 			new TestIO(),
 			new TestIO(),
 			new TestLocals(),
 			new TestLocals(),
 			new TestSerialize(),
 			new TestSerialize(),
-			new TestMisc(),
+			#if !java
 			new TestResource(),
 			new TestResource(),
-			new TestEReg(),
+			new TestInt64(),			
+			new TestMisc(),
 			new TestType(),
 			new TestType(),
+			#end
+			new TestEReg(),
 			#if !macro
 			#if !macro
 			new TestXML(),
 			new TestXML(),
 			#end
 			#end

+ 0 - 2
tests/unit/TestInt64.hx

@@ -24,9 +24,7 @@ class TestInt64 extends Test {
 		
 		
 		eq( 1.ofInt().shl(0).toStr(), "1" );
 		eq( 1.ofInt().shl(0).toStr(), "1" );
 		
 		
-		#if !java
 		eq(Int64.ofInt(0).toStr(), "0");
 		eq(Int64.ofInt(0).toStr(), "0");
-		#end
 	}
 	}
 
 
 }
 }

+ 4 - 0
tests/unit/unit.html

@@ -107,6 +107,10 @@ iframe {
   <div class="label">CPP</div>
   <div class="label">CPP</div>
   <div id="cpp_container" class="cont"><iframe src="runcpp.n"></iframe></div>
   <div id="cpp_container" class="cont"><iframe src="runcpp.n"></iframe></div>
 </div>
 </div>
+<div class="window">
+  <div class="label">Java</div>
+  <div id="java_container" class="cont"><iframe src="runjava.n"></iframe></div>
+</div>
 <script type="text/javascript">
 <script type="text/javascript">
 setTimeout('unit.Test.main()', 1000)
 setTimeout('unit.Test.main()', 1000)
 </script>
 </script>

+ 12 - 1
tests/unit/unit.hxml

@@ -56,4 +56,15 @@ params.hxml
 --next
 --next
 params.hxml
 params.hxml
 -main unit.Test
 -main unit.Test
--cpp cpp
+-cpp cpp
+
+#java
+--next
+-main RunJava
+-neko runjava.n
+
+--next
+params.hxml
+-main unit.Test
+-java java
+-cmd javac -sourcepath java/src java/src/unit/Test.java