Skip to content

Commit

Permalink
Print the correct library name in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanlong committed May 6, 2021
1 parent 5fc8f7e commit c51352c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pgx_async/test/test_pgx_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ end

include Pgx_test.Make_tests (Pgx_async) (Alcotest_io)

let () = run_tests ()
let () = run_tests ~library_name:"pgx_async"
2 changes: 1 addition & 1 deletion pgx_lwt_unix/test/test_pgx_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ end

include Pgx_test.Make_tests (Pgx_lwt_unix) (Alcotest_io)

let () = run_tests ()
let () = ~library_name:"pgx_lwt_unix"
6 changes: 3 additions & 3 deletions pgx_test/src/pgx_test.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
external reraise : exn -> _ = "%reraise"

module type S = sig
val run_tests : unit -> unit
val run_tests : library_name:string -> unit
end

module type ALCOTEST_IO = sig
Expand Down Expand Up @@ -110,7 +110,7 @@ struct
output_list 0
;;

let run_tests () =
let run_tests ~library_name =
Random.self_init ();
set_to_default_db ();
let tests =
Expand Down Expand Up @@ -614,7 +614,7 @@ struct
]
in
if force_tests || have_pg_config
then Alcotest_io.run "pgx_test" [ "pgx_async", tests ]
then Alcotest_io.run "pgx_test" [ library_name, tests ]
else print_endline "Skipping PostgreSQL tests since PGUSER is unset."
;;
end
2 changes: 1 addition & 1 deletion pgx_test/src/pgx_test.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module type S = sig
val run_tests : unit -> unit
val run_tests : library_name:string -> unit
end

module type ALCOTEST_IO = sig
Expand Down
2 changes: 1 addition & 1 deletion pgx_unix/test/test_pgx_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ end

include Pgx_test.Make_tests (Pgx_unix) (Alcotest_io)

let () = run_tests ()
let () = run_tests ~library_name:"pgx_unix"

0 comments on commit c51352c

Please sign in to comment.