summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2024-05-24 16:20:26 +0200
committerNadrieril2024-05-24 16:31:32 +0200
commit0ebfa7a15f4d7218389488ff8a92206c0d6642ec (patch)
tree53f04658b99d039faeb67c24af21bca9e35b7870
parentc4af12c1c34406720d8173f2972d4cf1f42f8f5b (diff)
runner: Allow filenames with dashes
-rw-r--r--tests/test_runner/dune2
-rw-r--r--tests/test_runner/run_test.ml1
2 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_runner/dune b/tests/test_runner/dune
index e8b29d66..1c719532 100644
--- a/tests/test_runner/dune
+++ b/tests/test_runner/dune
@@ -1,6 +1,6 @@
(executable
(public_name test_runner)
- (libraries core_unix.sys_unix re unix)
+ (libraries core_unix.sys_unix re str unix)
(preprocess
(pps ppx_deriving.show ppx_deriving.ord ppx_sexp_conv))
(name run_test))
diff --git a/tests/test_runner/run_test.ml b/tests/test_runner/run_test.ml
index 25efbcfd..3bda4e29 100644
--- a/tests/test_runner/run_test.ml
+++ b/tests/test_runner/run_test.ml
@@ -167,6 +167,7 @@ module Input = struct
(* Given a path to a rust file or crate, gather the details and options about how to build the test. *)
let build (path : string) : t =
let name = Filename.remove_extension (Filename.basename path) in
+ let name = Str.global_replace (Str.regexp "-") "_" name in
let kind =
if Sys_unix.is_file_exn path then SingleFile
else if Sys_unix.is_directory_exn path then Crate