You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
819 B
31 lines
819 B
let projectDir = Sys.getcwd(); |
|
let tmpDir = Filename.concat(projectDir, ".fnmTmp"); |
|
|
|
include Rely.Make({ |
|
let config = |
|
Rely.TestFrameworkConfig.initialize({ |
|
snapshotDir: |
|
Filename.concat( |
|
projectDir, |
|
Filename.concat("test", "__snapshots__"), |
|
), |
|
projectDir, |
|
}); |
|
}); |
|
|
|
let run = args => { |
|
let arguments = |
|
args |> Array.append([|"./_build/default/executable/FnmApp.exe"|]); |
|
let env = Unix.environment() |> Array.append([|"FNM_DIR=" ++ tmpDir|]); |
|
let result = |
|
Lwt_process.pread_chars(~env, ("", arguments)) |> Lwt_stream.to_string; |
|
Lwt_main.run(result); |
|
}; |
|
|
|
let clearTmpDir = () => { |
|
let _ = Lwt_process.pread(("", [|"rm", "-rf", tmpDir|])) |> Lwt_main.run; |
|
(); |
|
}; |
|
|
|
let redactSfwRoot = |
|
Str.global_replace(Str.regexp_string(tmpDir), "<sfwRoot>");
|
|
|