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.

37 lines
898 B

6 years ago
let projectDir = Sys.getcwd();
let tmpDir = Filename.concat(projectDir, ".fnmTmp");
6 years ago
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([|"./_esy/default/build/default/executable/FnmApp.exe"|]);
let env =
Unix.environment()
|> Array.append([|
Printf.sprintf("%s=%s", Fnm.Config.FNM_DIR.name, tmpDir),
|]);
6 years ago
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>");