Browse Source

added As3 to unit tests (will look into making more tests pass later)

Simon Krajewski 13 years ago
parent
commit
e1070a292c
4 changed files with 36 additions and 9 deletions
  1. 1 1
      genas3.ml
  2. 2 2
      tests/unit/Test.hx
  3. 26 0
      tests/unit/unit.html
  4. 7 6
      tests/unit/unit.hxml

+ 1 - 1
genas3.ml

@@ -959,7 +959,7 @@ let generate_field ctx static f =
 				print ctx "%s function set %s( __v : %s ) : void { $%s = __v; }" (if v.v_write = AccNo then "protected" else "private") id t id;
 				newline ctx
 			| _ -> ());
-			print ctx "protected var $%s : %s" (s_ident f.cf_name) (type_str ctx f.cf_type p);
+			print ctx "%sprotected var $%s : %s" (if static then "static " else "") (s_ident f.cf_name) (type_str ctx f.cf_type p);
 		end else begin
 			print ctx "%s var %s : %s" rights (s_ident f.cf_name) (type_str ctx f.cf_type p);
 			match f.cf_expr with

+ 2 - 2
tests/unit/Test.hx

@@ -193,13 +193,13 @@ class Test #if swf_mark implements mt.Protect #end #if as3 implements haxe.Publi
 			new TestLocals(),
 			new TestEReg(),
 			new TestXML(),
-			#if !java
+			#if (!java && !as3)
 			// these don't compile
 			new TestMisc(),
 			new TestResource(),
 			new TestInt64(),			
 			// these cause runtime exceptions
-			new TestReflect(),			
+			new TestReflect(),
 			new TestSerialize(),
 			new TestMeta(),
 			#end

+ 26 - 0
tests/unit/unit.html

@@ -103,6 +103,32 @@ iframe {
     />
   </object>
 </div>
+<div class="window">
+  <div class="label">As3</div>
+  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+  width="400"
+  height="300"
+  id="haxeAs3"
+  align="middle">
+    <param name="movie" value="unit9_as3.swf"/>
+    <param name="allowScriptAccess" value="always" />
+    <param name="quality" value="high" />
+    <param name="scale" value="noscale" />
+    <param name="salign" value="lt" />
+    <param name="bgcolor" value="#ffffff"/>
+    <embed src="unit9_as3.swf"
+      bgcolor="#ffffff"
+      width="400"
+      height="300"
+      name="haxeAs3"
+      quality="high"
+      align="middle"
+      allowScriptAccess="always"
+      type="application/x-shockwave-flash"
+      pluginspage="http://www.macromedia.com/go/getflashplayer"
+    />
+  </object>
+</div>
 <div class="window">
   <div class="label">CPP</div>
   <div id="cpp_container" class="cont"><iframe src="runcpp.n"></iframe></div>

+ 7 - 6
tests/unit/unit.hxml

@@ -12,12 +12,6 @@ params.hxml
 -swf-version 11
 -swf unit9.swf
 
-#as3
---next
-params.hxml
--main unit.Test
--as3 as3
-
 #js
 --next
 params.hxml
@@ -58,6 +52,13 @@ params.hxml
 -main unit.Test
 -cpp cpp
 
+#as3
+--next
+params.hxml
+-main unit.Test
+-as3 as3
+-cmd mxmlc as3/__main__.as --output unit9_as3.swf
+
 #java
 --next
 -main RunJava