mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +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,8 +14,11 @@ use std::io::Write;
|
|||
use std::path::PathBuf;
|
||||
use std::process::{Command, ExitStatus, Stdio};
|
||||
use std::sync::Mutex;
|
||||
use std::sync::Once;
|
||||
use tempfile::NamedTempFile;
|
||||
|
||||
static ZIG_PLATFORM_COPY_GLUE_ONCE: Once = Once::new();
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Out {
|
||||
pub cmd_str: OsString, // command with all its arguments, for easy debugging
|
||||
|
@ -122,6 +125,8 @@ where
|
|||
roc_cmd.arg(arg);
|
||||
}
|
||||
|
||||
initialize_zig_test_platforms();
|
||||
|
||||
for (k, v) in extra_env {
|
||||
roc_cmd.env(k, v);
|
||||
}
|
||||
|
@ -473,3 +478,12 @@ pub fn known_bad_file(file_name: &str) -> PathBuf {
|
|||
|
||||
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