mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
add ONCE call to copy zig glue files when running tests
This commit is contained in:
parent
6278c4d7bb
commit
41192b7103
2 changed files with 15 additions and 0 deletions
|
@ -14,6 +14,7 @@ roc_load = { path = "../compiler/load" }
|
||||||
roc_module = { path = "../compiler/module" }
|
roc_module = { path = "../compiler/module" }
|
||||||
roc_reporting = { path = "../reporting" }
|
roc_reporting = { path = "../reporting" }
|
||||||
roc_command_utils = { path = "../utils/command" }
|
roc_command_utils = { path = "../utils/command" }
|
||||||
|
copy_zig_glue = { path = "../copy_zig_glue" }
|
||||||
|
|
||||||
bumpalo.workspace = true
|
bumpalo.workspace = true
|
||||||
criterion.workspace = true
|
criterion.workspace = true
|
||||||
|
|
|
@ -14,8 +14,11 @@ use std::io::Write;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::{Command, ExitStatus, Stdio};
|
use std::process::{Command, ExitStatus, Stdio};
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use std::sync::Once;
|
||||||
use tempfile::NamedTempFile;
|
use tempfile::NamedTempFile;
|
||||||
|
|
||||||
|
static ZIG_PLATFORM_COPY_GLUE_ONCE: Once = Once::new();
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Out {
|
pub struct Out {
|
||||||
pub cmd_str: OsString, // command with all its arguments, for easy debugging
|
pub cmd_str: OsString, // command with all its arguments, for easy debugging
|
||||||
|
@ -122,6 +125,8 @@ where
|
||||||
roc_cmd.arg(arg);
|
roc_cmd.arg(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialize_zig_test_platforms();
|
||||||
|
|
||||||
for (k, v) in extra_env {
|
for (k, v) in extra_env {
|
||||||
roc_cmd.env(k, v);
|
roc_cmd.env(k, v);
|
||||||
}
|
}
|
||||||
|
@ -473,3 +478,12 @@ pub fn known_bad_file(file_name: &str) -> PathBuf {
|
||||||
|
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Copies the glue source files for zig platforms from the roc builtins
|
||||||
|
/// this is only temporary, see comments in crates/copy_zig_glue/src/main.rs
|
||||||
|
fn initialize_zig_test_platforms() {
|
||||||
|
ZIG_PLATFORM_COPY_GLUE_ONCE.call_once(|| {
|
||||||
|
// initialization code here
|
||||||
|
copy_zig_glue::copy_zig_glue();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue