Commits

camlspotter committed 6817fef

removed unix related

  • Participants
  • Parent commits 54b369e
  • Branches js

Comments (0)

Files changed (11)

 name="spotlib_js"
 version="2.2.0"
 description="Spotter's garbages"
-requires="str,pa_ounit"
-archive(byte)="spotlib.cmo"
-archive(native)="spotlib.cmx"
+requires=""
+archive(byte)="spotlib_js.cmo"
+archive(native)="spotlib_js.cmx"
 linkopts = ""
-name="spotlib"
+name="spotlib_js"
 version="@version@"
 description="Spotter's garbages"
-requires="unix,str,pa_ounit"
-archive(byte)="spotlib.cmo"
-archive(native)="spotlib.cmx"
+requires=""
+archive(byte)="spotlib_js.cmo"
+archive(native)="spotlib_js.cmx"
 linkopts = ""
 OCAML_BYTE_LINK_FLAGS +=
 OCAML_NATIVE_LINK_FLAGS +=
 
-OCAMLPACKS[]= str oUnit pa_ounit
+OCAMLPACKS[]=
 
-OCAMLDEPFLAGS= -syntax camlp4o -package pa_ounit.syntax -ppopt -pa-ounit-lib -ppopt Spotlib
-OCAMLPPFLAGS= -syntax camlp4o -package pa_ounit.syntax -ppopt -pa-ounit-lib -ppopt Spotlib
+OCAMLDEPFLAGS=
+OCAMLPPFLAGS= 
 
 # OCamlGeneratedFiles(parser.ml lexer.ml)
 OCamlGeneratedFiles(phantomy.ml phantomy.mli)
 #   phantom
    weaktbl
    hashset
-   file
+#   file
    comopt
    overload
 #   graph
-   at
    dllist
 #   channel
    tuple
 LIB = spotlib_js
 
 MyOCamlPackage($(LIB), $(LIBFILES), $(EMPTY), $(EMPTY))
-
-PHANTOM_GEN[] =
-   monad_intf
-   monad
-   xlist
-   xlazy
-   xformat
-   gen_phantom
-
-NO_INSTALL=true
-MyOCamlProgram(gen_phantom, $(PHANTOM_GEN))
-
-phantom.ml: phantom_head.ml gen_phantom.run
-	./gen_phantom.run ml > $@
-
-phantom.mli: phantom_head.mli gen_phantom.run
-	./gen_phantom.run mli > $@
-
-MyOCamlOUnitTest($(LIB))
 external id : 'a -> 'a = "%identity"
 external (!&) : _ -> unit = "%ignore"
 
+(*
 let time f v =
   let start = Unix.gettimeofday () in
   let res = f v in
   let end_ = Unix.gettimeofday () in
   res, end_ -. start
+*)
 
 let imp init f =
   let r = ref init in
     memoize_rec (fun f -> .... f v ....) w
  *)
 
+(*
 val time : ('a -> 'b) -> 'a -> 'b * float
 (** simple profiling *)
+*)
 
 module Weaktbl    = Weaktbl
 (* module Phantom    = Phantom *)
 module Hashset    = Hashset
-module File       = File
+(* module File       = File *)
 module Comopt     = Comopt
 module Overload   = Overload
 module Mtypes     = Mtypes
       if t.day < 1 || t.day > dom then false
       else true
  
+(*
   TEST "is_valid" =
     is_valid (Result.from_Ok (fun _ -> assert false) & of_string "2000-04-01")
 
   
   TEST "is_valid" =
     is_valid (Result.from_Ok (fun _ -> assert false) & of_string "2000-02-29")
+*)
   
   let random () =
     let year = Random.int 200 + 1900 in
     *)
     (diff t date_1970_01_01 + 4) mod 7
  
+(*
   TEST "to_string" =
     "2000-04-01" = to_string { year = 2000; month = 4; day = 1 }
   
       (Result.from_Ok (fun _ -> assert false) & of_string "2013-06-01")
       (Result.from_Ok (fun _ -> assert false) & of_string "2012-01-31") 
     = 366 - 31 + 31 + 28 + 31 + 30 + 31 + 1
+*)
 end
 
 module Time = struct
       else `Minus (r, min)
 end
 
+(*
 module Unix0 = Unix
 
 module Unix = struct
     assert ((tm.tm_year, tm.tm_mon, tm.tm_mday, inv) = (2000 - 1900, 4 - 1, 1, `Ok))
 
 end
+*)
 
 module Datetime = struct
   type t = {
                     time = Time.random ();
                     zone = TZone.random () }
 
-  let random_2038 () = { date = Date.random_2038 ();
+  let _random_2038 () = { date = Date.random_2038 ();
                          time = Time.random ();
                          zone = TZone.random () }
 
   
   let of_string s = Result.catch_exn & fun () -> of_string_exn s
 
+(*
   TEST_UNIT "parse" =
     for _i = 0 to 100000 do
       let t = random () in
         assert false
       end
     done
+*)
 
   let epoch t =
     (* Seconds from 1970-01-01T00:00:00Z
     + Time.dsec t.time
     + TZone.in_secs t.zone
 
+(*
   let of_utc_tm tm = 
     { date = Unix.date_of_tm tm;
       time = { Time.hour = tm.Unix0.tm_hour;
                min  = tm.Unix0.tm_min;
                sec  = tm.Unix0.tm_sec };
       zone = `UTC } 
+*)
 
+(*
   TEST_UNIT "epoch GMT" =
     for _i = 0 to 100000 do
       let dt = 
         assert false
       end
     done
+*)
 end
 
+(*
 module Fat = struct
 
   let int64_of_float f = 
      calculated from historical different local time settings.
      +-4hours are accepted.
   *)
-  let diff t1 t2 = 
+  let _diff t1 t2 = 
     let open Xint64 in
     let d = int64_of_float & t1.from_epoch -. t2.from_epoch in
     let div = Int64.to_int & d / secs_of_day in
     | Some (f, tm, `Ok) -> { date = d; from_epoch = f; tm }
     | Some (_, _, `Invalid) | None -> random ()
 
+  let _random = random
+
   TEST_UNIT "random" =
     for _i = 0 to 1000 do    
       ignore (random ())
     done
 
 end
+*)
 
       Note that the epoch of EOD and the epoch of D+1T00:00:00 are the same,
       but they are different [t]s.
  *)
+(*
   val of_utc_tm : Unix.tm -> t
+*)
 end
 
 let split_at len str = String.sub str 0 len, String.sub str len (String.length str - len)
 
+(*
 TEST_UNIT "Xstring.split_at" = 
     assert (split_at 3 "hello world" = ("hel", "lo world"))
 ;;
+*)
 
 let take len str = String.sub str 0 len
 let prefix = take
 let drop len str = String.sub str len (String.length str - len)
 let drop_postfix len str = String.sub str 0 (String.length str - len)
 
+(*
 TEST_UNIT "Xstring.drop_postfix" = 
     assert (drop_postfix 6 "hello world" = "hello")
 ;;
+*)
 
 let postfix len str = 
   let l = String.length str in
   String.sub str (l-len) len
 
+(*
 TEST_UNIT "Xstring.drop_postfix" = 
     assert (postfix 5 "hello world" = "world")
 ;;
+*)
 
 let is_prefix' ?(from=0) sub str =
   let sublen = String.length sub in
     else None
   with _ -> None
 
+(*
 TEST_UNIT "Xstring.is_prefix'" = 
     assert (is_prefix' "hello" "hello world" = Some " world")
 ;;
+*)
 
 let is_prefix ?(from=0) sub str =
   let sublen = String.length sub in
     String.sub str from sublen = sub
   with _ -> false
 
+(*
 TEST_UNIT "Xstring.is_prefix" = 
     assert (is_prefix "hello" "hello world")
 ;;
+*)
 
 let contains ?from:(pos=0) ~needle:sub str =
   let str_len = String.length str in
     in
     iter pos
 
+(*
 TEST_UNIT "Xstring.contains" = 
     assert (contains ~needle:"hello" "hello world")
     assert (contains ~needle:"hello" "bye world" = false)
     assert (contains ~needle:"shindanmaker.com" "http://shindanmaker.com/341161")
 ;;    
+*)
 
 let is_postfix sub str =
   let sublen = String.length sub in
   try postfix sublen str = sub with _ -> false
   
+(*
 TEST_UNIT "Xstring.is_postfix" = 
     assert (is_postfix "world" "hello world")
 ;;
+*)
 
 let is_postfix' sub str =
   let sublen = String.length sub in
     else None
   with _ -> None
 
+(*
 TEST_UNIT "Xstring.is_postfix" = 
     assert (is_postfix' "world" "hello world" = Some "hello ")
 ;;
+*)
 
 let index_string_from str pos sub =
   let sub_len = String.length sub in
 let checkenv s = try ignore (Sys.getenv s); true with Not_found -> false
 
+(*
 let command fmt = Printf.kprintf Sys.command fmt
 let must fmt = Printf.kprintf (fun s -> if Sys.command s <> 0 then Exn.failwithf "command %s failed" s) fmt
 let cp = must "/bin/cp %s %s"
 let patch_p1 = must "/bin/patch -p1 < %s"
+*)
 val checkenv : string -> bool
   (** check existence of environment variable *)
 
+(*
 val command : ('a, unit, string, int) format4 -> 'a
 val must : ('a, unit, string, unit) format4 -> 'a
 val cp : string -> string -> unit
 val patch_p1 : string -> unit
+*)