-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from ocaml-multicore/lin-stress-mode
Add Lin_domain.stress_test
- Loading branch information
Showing
18 changed files
with
173 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(* ************************************************************ *) | ||
(* Lin tests of [Ephemeron] *) | ||
(* ************************************************************ *) | ||
|
||
module EConf = | ||
struct | ||
module E = Ephemeron.K1.Make(struct | ||
type t = Int.t | ||
let equal = Int.equal | ||
let hash = Fun.id | ||
end) | ||
|
||
type t = string E.t | ||
let init () = E.create 42 | ||
let cleanup _ = () | ||
|
||
open Lin | ||
let int,string = nat_small, string_small_printable | ||
let api = | ||
[ val_ "Ephemeron.clear" E.clear (t @-> returning unit); | ||
val_ "Ephemeron.add" E.add (t @-> int @-> string @-> returning unit); | ||
val_ "Ephemeron.remove" E.remove (t @-> int @-> returning unit); | ||
val_ "Ephemeron.find" E.find (t @-> int @-> returning_or_exc string); | ||
val_ "Ephemeron.find_opt" E.find_opt (t @-> int @-> returning (option string)); | ||
val_ "Ephemeron.find_all" E.find_all (t @-> int @-> returning (list string)); | ||
val_ "Ephemeron.replace" E.replace (t @-> int @-> string @-> returning unit); | ||
val_ "Ephemeron.mem" E.mem (t @-> int @-> returning bool); | ||
val_ "Ephemeron.length" E.length (t @-> returning int); | ||
val_ "Ephemeron.clean" E.clean (t @-> returning unit); | ||
] | ||
end | ||
|
||
module ET_domain = Lin_domain.Make(EConf) | ||
;; | ||
QCheck_base_runner.run_tests_main [ | ||
ET_domain.stress_test ~count:1000 ~name:"Lin Ephemeron stress test with Domain"; | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(* ********************************************************************** *) | ||
(* Lin Tests [Weak] *) | ||
(* ********************************************************************** *) | ||
module WConf = | ||
struct | ||
type t = int64 Weak.t | ||
|
||
let weak_size = 16 | ||
let init () = Weak.create weak_size | ||
let cleanup _ = () | ||
|
||
open Lin | ||
let int,int64 = nat_small,nat64_small | ||
let api = | ||
[ val_ "Weak.length" Weak.length (t @-> returning int); | ||
val_ "Weak.set" Weak.set (t @-> int @-> option int64 @-> returning_or_exc unit); | ||
val_ "Weak.get" Weak.get (t @-> int @-> returning_or_exc (option int64)); | ||
val_ "Weak.get_copy" Weak.get_copy (t @-> int @-> returning_or_exc (option int64)); | ||
val_ "Weak.check" Weak.check (t @-> int @-> returning_or_exc bool); | ||
val_ "Weak.fill" Weak.fill (t @-> int @-> int @-> option int64 @-> returning_or_exc unit); | ||
(*val blit : 'a t -> int -> 'a t -> int -> int -> unit *) | ||
] | ||
end | ||
|
||
module WT_domain = Lin_domain.Make(WConf) | ||
;; | ||
QCheck_base_runner.run_tests_main [ | ||
WT_domain.stress_test ~count:1000 ~name:"Lin Weak stress test with Domain"; | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(* ********************************************************************** *) | ||
(* Lin tests of [Weak Hashset] *) | ||
(* ********************************************************************** *) | ||
module WHSConf = | ||
struct | ||
module WHS = Weak.Make(String) | ||
type t = WHS.t | ||
let weak_size = 16 | ||
let init () = WHS.create weak_size | ||
let cleanup t = WHS.clear t | ||
|
||
open Lin | ||
let string = string_small | ||
let api = | ||
[ val_ "Weak.S.clear" WHS.clear (t @-> returning unit); | ||
val_ "Weak.S.merge" WHS.merge (t @-> string @-> returning_or_exc string); | ||
val_ "Weak.S.add" WHS.add (t @-> string @-> returning_or_exc unit); | ||
val_ "Weak.S.remove" WHS.remove (t @-> string @-> returning_or_exc unit); | ||
val_ "Weak.S.find" WHS.find (t @-> string @-> returning_or_exc string); | ||
val_ "Weak.S.find_opt" WHS.find_opt (t @-> string @-> returning_or_exc (option string)); | ||
val_ "Weak.S.find_all" WHS.find_all (t @-> string @-> returning_or_exc (list string)); | ||
val_ "Weak.S.mem" WHS.mem (t @-> string @-> returning_or_exc bool); | ||
(*val iter : (data -> unit) -> t -> unit*) | ||
(*val fold : (data -> 'a -> 'a) -> t -> 'a -> 'a*) | ||
val_ "Weak.S.count" WHS.count (t @-> returning int); | ||
(*val stats : t -> int * int * int * int * int * int*) | ||
] | ||
end | ||
|
||
module WHST_domain = Lin_domain.Make(WHSConf) | ||
;; | ||
QCheck_base_runner.run_tests_main [ | ||
WHST_domain.stress_test ~count:1000 ~name:"Lin Weak HashSet stress test with Domain"; | ||
] |