Skip to content

Commit e2894b2

Browse files
committed
Remove unused bindings, play with weights
1 parent c137861 commit e2894b2

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

src/sys/stm_tests.ml

+13-23
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ struct
151151
| [] -> Gen.return None
152152
| bindings ->
153153
Gen.(oneofl bindings >>= fun (n, sub_fs) ->
154-
oneof [
155-
return (Some ([],n));
156-
map (function None -> Some ([],n)
154+
frequency [
155+
2,return (Some ([],n));
156+
3,map (function None -> Some ([],n)
157157
| Some (path,name) -> Some (n::path,name)) (gen_existing_pair sub_fs)]
158158
)
159159
)
@@ -170,17 +170,17 @@ struct
170170
| Some (p,n) -> return (p,n));
171171
])
172172

173-
let arb_cmd s =
173+
let arb_cmd s = (* weights 3,3,3 - seed 223753993 *)
174174
QCheck.make ~print:show_cmd
175-
Gen.(oneof [
176-
map (fun path -> File_exists path) (path_gen s);
177-
map (fun path -> Is_directory path) (path_gen s);
178-
map (fun (path,new_dir_name) -> Remove (path, new_dir_name)) (pair_gen s);
179-
map2 (fun old_path new_path -> Rename (old_path, new_path)) (path_gen s) (path_gen s);
180-
map (fun (path,new_dir_name) -> Mkdir (path, new_dir_name)) (pair_gen s);
181-
map (fun (path,delete_dir_name) -> Rmdir (path, delete_dir_name)) (pair_gen s);
182-
map (fun path -> Readdir path) (path_gen s);
183-
map (fun (path,new_file_name) -> Mkfile (path, new_file_name)) (pair_gen s);
175+
Gen.(frequency [
176+
1,map (fun path -> File_exists path) (path_gen s);
177+
1,map (fun path -> Is_directory path) (path_gen s);
178+
1,map (fun (path,new_dir_name) -> Remove (path, new_dir_name)) (pair_gen s);
179+
3,map2 (fun old_path new_path -> Rename (old_path, new_path)) (path_gen s) (path_gen s);
180+
3,map (fun (path,new_dir_name) -> Mkdir (path, new_dir_name)) (pair_gen s);
181+
1,map (fun (path,delete_dir_name) -> Rmdir (path, delete_dir_name)) (pair_gen s);
182+
3,map (fun path -> Readdir path) (path_gen s);
183+
1,map (fun (path,new_file_name) -> Mkfile (path, new_file_name)) (pair_gen s);
184184
])
185185

186186
let sandbox_root = "_sandbox"
@@ -380,16 +380,6 @@ struct
380380
| _,_ -> false
381381
end
382382

383-
let run_cmd cmd =
384-
let ic = Unix.open_process_in cmd in
385-
let os = In_channel.input_line ic in
386-
ignore (Unix.close_process_in ic);
387-
os
388-
389-
let uname_os () = run_cmd "uname -s"
390-
391-
let arch () = run_cmd "opam var arch"
392-
393383
module Sys_seq = STM_sequential.Make(SConf)
394384
module Sys_dom = STM_domain.Make(SConf)
395385

0 commit comments

Comments
 (0)