Commits

camlspotter committed 010d6a8

test script

Comments (0)

Files changed (3)

dcamltests/Makefile

 depend: beforedepend
 	$(CAMLRUN) $(ROOT)/tools/ocamldep $(INCLUDES) *.mli *.ml > .depend
 
-Makefile.targets: *.ml *.mli
+Makefile.targets: *.ml # *.mli
 	echo TARGETS= \\ > $@
 	ls *.ml *.mli | sed -e 's/mli/cmi/' -e 's/ml/cmo/' -e 's/$$/ \\/'	 >> $@
 

dcamltests/auto-test.pl

   # $result =~ s/Error: .*/Error!/g;
   $result =~ s/\s+/ /g;
   if( $? == 11 ){ $result = "Seg fault!!!"; }
-  elsif( $? == 512 ){ }
+  elsif( $? == 512 ){ $result = "ERROR: $result"; }
   elsif( $? != 0 ){ $result = "$?!!!"; }
   else { $result = "OK"; }
+  if( $file =~ /^error_/ && $result =~ /^ERROR/ ){
+      $result = "OK (error)";
+  }
   print "$file:\t$result\n";
   while (<IN>) { print $_; }
 }

dcamltests/lousy.ml

-module Add_class : sig
-  type 'a t
-  val (+) : $:('a t) -> 'a -> 'a -> 'a
-end = struct
-  type 'a t = 'a -> 'a -> 'a
-  let (+) $:d = d
-end
-
-module Add_int = struct
-  let int = Pervasives.(+)
-end
-
-module Add_float = struct
-  let float = (+.)
-end
-
-module Add = struct
-  include (Add_class : sig
-    type 'a t = 'a Add_class.t
-    val (+) : $:('a t) -> 'a -> 'a -> 'a
-  end)
-  include Add_int
-  include Add_float
-end
-  
-open Add
-let double x = x + x
-
-let _ =
-  (* muhahahaha! *)
-  assert (double 1 = 2 );
-  assert (double 1.2 = 2.4)
-