-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35a1e17
commit 8c32d27
Showing
7 changed files
with
549 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC1091 | ||
|
||
set -eo pipefail | ||
|
||
ci_dir=$(dirname "${BASH_SOURCE[0]}") | ||
ci_dir=$(realpath "${ci_dir}") | ||
. "${ci_dir}"/shared.sh | ||
|
||
if [[ -z "${TARGET}" ]]; then | ||
export TARGET="x86_64-unknown-linux-gnu" | ||
fi | ||
|
||
cargo xtask ui-test \ | ||
--target "${TARGET}" \ | ||
--engine "${CROSS_ENGINE}" \ | ||
--verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ once_cell = "1.15" | |
semver = "1" | ||
chrono = "0.4" | ||
wildmatch = "2.1.1" | ||
tempfile = "3.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use std::path::{Path, PathBuf}; | ||
use std::{fs, mem}; | ||
|
||
use crate::util; | ||
use clap::Args; | ||
use cross::shell::MessageInfo; | ||
use cross::ToUtf8; | ||
|
||
/// Create and print a temporary directory to stdout. | ||
#[derive(Args, Debug)] | ||
pub struct MakeTempDir { | ||
/// `tmp` to create the temporary directory inside. | ||
/// Defaults to `"${target_dir}/tmp"`. | ||
tmpdir: Option<PathBuf>, | ||
} | ||
|
||
pub fn make_temp_dir(MakeTempDir { tmpdir }: MakeTempDir) -> cross::Result<()> { | ||
let mut msg_info = MessageInfo::create(0, false, None)?; | ||
let dir = temp_dir(tmpdir.as_deref(), &mut msg_info)?; | ||
msg_info.print(dir.to_utf8()?) | ||
} | ||
|
||
pub fn temp_dir(parent: Option<&Path>, msg_info: &mut MessageInfo) -> cross::Result<PathBuf> { | ||
let parent = match parent { | ||
Some(parent) => parent.to_owned(), | ||
None => util::project_dir(msg_info)?.join("target").join("tmp"), | ||
}; | ||
fs::create_dir_all(&parent)?; | ||
let dir = tempfile::TempDir::new_in(&parent)?; | ||
let path = dir.path().to_owned(); | ||
mem::drop(dir); | ||
|
||
fs::create_dir(&path)?; | ||
Ok(path) | ||
} |
Oops, something went wrong.