Commits

camlspotter committed a81dd24

test script fix

  • Participants
  • Parent commits e3023f2

Comments (0)

Files changed (3)

 # CR jfuruse: pcre dir is hard coded
 OCAML_TEST(f) = 
    println(testing $(f))
-   $(shell ocaml -I .. -I ../pa -I $(shell ocamlfind query pcre) -I $(shell ocamlfind query spotlib) dynlink.cma camlp4o.cma pa_orakuda.cma pcre.cma unix.cma str.cma spotlib.cma orakuda.cmo $(f))
+   ocaml -I .. -I ../pa -I $(shell ocamlfind query pcre) -I $(shell ocamlfind query spotlib) -I $(shell ocamlfind query pa_ounit) dynlink.cma camlp4o.cma pa_orakuda.cma pcre.cma unix.cma str.cma pa_ounit_lib.cma spotlib.cma orakuda.cmo $(f)
+   println(test $(f) done)
 
 .PHONY: test 
 test: ../orakuda.cmo ../pa/pa_orakuda.cma
 	$(OCAML_TEST test_cformat.ml)
 	$(OCAML_TEST test_sprintf.ml)
 	$(OCAML_TEST test_command.ml)
-	$(OCAML_TEST test_escape.ml)
         println(test done)
 
 .PHONY: top
 
 CAMLP4_TEST= camlp4of -I ../pa pa_orakuda.cma pcre.cma 
 
-%.x.ml: %.ml ../pa/pa_orakuda.cma
+%.out.ml: %.ml ../pa/pa_orakuda.cma
 	camlp4of -printer OCaml -I ../pa pa_orakuda.cma $< > $@
 
 clean:
-	rm -f *.x.ml
+	rm -f *.out.ml
 

test/test_command.ml

 *)
 
 open Spotlib.Spot
-let command = Spotlib.Spot.Unix.shell_command
+let command s = Spotlib.Spot.Unix.shell_command s
 
-let _ =
-  $`ls .` & function
-    | (`Out, `Read s) -> prerr_string ("OUT: " ^ s)
-    | (`Err, `Read s) -> prerr_string ("ERR: " ^ s)
-    | (`Out, `EOF) -> prerr_endline "OUT: EOF"
-    | (`Err, `EOF) -> prerr_endline "ERR: EOF"
+let _ = $`ls .`
 ;;
     
-let _ =
-  <:qx<ls .>> & function
-    | (`Out, `Read s) -> prerr_string ("OUT: " ^ s)
-    | (`Err, `Read s) -> prerr_string ("ERR: " ^ s)
-    | (`Out, `EOF) -> prerr_endline "OUT: EOF"
-    | (`Err, `EOF) -> prerr_endline "ERR: EOF"
+let _ = <:qx<ls .>>
 ;;
 
 

test/test_regexp.ml

 *)
 
 open Orakuda.Std
+open Orakuda.Regexp.Infix
 
 (* str_item *)
 $/([0-9]+)(?P<x>[a-z]+)|([A-Z]+)/;;
       res
 ;;
 
-let _ = "HeLlO" =~ $/hello/i;;
+let _ = assert (("HeLlO" =~ $/hello/i) <> None)
 
-let _ = try ignore ("HeLlO" =~ $/hello/); assert false with Not_found -> ();;
+let _ = assert (("HeLlO" =~ $/hello/) = None)
 
-let _ = "HeLlO" =~ <:m<hello/i>>;;
+let _ = assert (("HeLlO" =~ <:m<hello/i>>) <> None)
 
-let _ = try ignore ("HeLlO" =~ <:m<hello>>); assert false with Not_found -> ();;
+let _ = assert (("HeLlO" =~ <:m<hello>>) = None)