Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cli_testing_examples under crates/cli/tests #6558

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ exclude = [
"ci/benchmarks/bench-runner",
"ci/repl_basic_test",
# Examples sometimes have Rust hosts in their platforms. The compiler should ignore those.
"crates/cli_testing_examples",
jschear marked this conversation as resolved.
Show resolved Hide resolved
"examples",
]
# Needed to be able to run `cargo run -p roc_cli --no-default-features` -
Expand Down Expand Up @@ -69,7 +68,9 @@ version = "0.0.1"
# change the tag value in this Cargo.toml to point to that tag, and `cargo update`.
# This way, GitHub Actions works and nobody's builds get broken.
# TODO: Switch this back to roc-lang/inkwell once it is updated
inkwell = { git = "https://github.com/roc-lang/inkwell", branch = "inkwell-llvm-16", features = ["llvm16-0"] }
inkwell = { git = "https://github.com/roc-lang/inkwell", branch = "inkwell-llvm-16", features = [
"llvm16-0",
] }

arrayvec = "0.7.2" # update roc_std/Cargo.toml on change
backtrace = "0.3.67"
Expand All @@ -78,18 +79,27 @@ bincode = "1.3.3"
bitflags = "1.3.2"
bitvec = "1.0.1"
blake3 = "1.3.3"
brotli = "3.3.4" # used for decompressing tarballs over HTTPS, if the server supports brotli
brotli = "3.3.4" # used for decompressing tarballs over HTTPS, if the server supports brotli
bumpalo = { version = "3.12.0", features = ["collections"] }
bytemuck = { version = "1.13.1", features = ["derive"] }
capstone = { version = "0.11.0", default-features = false }
cgmath = "0.18.0"
chrono = "0.4.26"
clap = { version = "4.2.7", default-features = false, features = ["std", "color", "suggestions", "help", "usage", "error-context"] }
clap = { version = "4.2.7", default-features = false, features = [
"std",
"color",
"suggestions",
"help",
"usage",
"error-context",
] }
colored = "2.0.0"
console_error_panic_hook = "0.1.7"
const_format = { version = "0.2.30", features = ["const_generics"] }
copypasta = "0.8.2"
criterion = { git = "https://github.com/Anton-4/criterion.rs", features = ["html_reports"], rev = "30ea0c5" }
criterion = { git = "https://github.com/Anton-4/criterion.rs", features = [
"html_reports",
], rev = "30ea0c5" }
criterion-perf-events = { git = "https://github.com/Anton-4/criterion-perf-events", rev = "0f38c3e" }
crossbeam = "0.8.2"
dircpy = "0.3.14"
Expand All @@ -102,7 +112,12 @@ fs_extra = "1.3.0"
futures = "0.3.26"
glyph_brush = "0.7.7"
hashbrown = { version = "0.14.3" }
iced-x86 = { version = "1.18.0", default-features = false, features = ["std", "decoder", "op_code_info", "instr_info"] }
iced-x86 = { version = "1.18.0", default-features = false, features = [
"std",
"decoder",
"op_code_info",
"instr_info",
] }
im = "15.1.0"
im-rc = "15.1.0"
indexmap = "2.1.0"
Expand Down Expand Up @@ -139,12 +154,17 @@ quote = "1.0.23"
rand = "0.8.5"
regex = "1.7.1"
remove_dir_all = "0.8.1"
reqwest = { version = "0.11.23", default-features = false, features = ["blocking", "rustls-tls"] } # default-features=false removes libopenssl as a dependency on Linux, which might not be available!
reqwest = { version = "0.11.23", default-features = false, features = [
"blocking",
"rustls-tls",
] } # default-features=false removes libopenssl as a dependency on Linux, which might not be available!
rlimit = "0.9.1"
rustyline = { git = "https://github.com/roc-lang/rustyline", rev = "e74333c" }
rustyline-derive = { git = "https://github.com/roc-lang/rustyline", rev = "e74333c" }
schemars = "0.8.12"
serde = { version = "1.0.153", features = ["derive"] } # update roc_std/Cargo.toml on change
serde = { version = "1.0.153", features = [
"derive",
] } # update roc_std/Cargo.toml on change
serde-xml-rs = "0.6.0"
serde_json = "1.0.94" # update roc_std/Cargo.toml on change
serial_test = "1.0.0"
Expand Down Expand Up @@ -192,7 +212,7 @@ debug = true

[profile.release-with-lto]
inherits = "release"
lto = "thin" # TODO: We could consider full here since this is only used for packaged release on github.
lto = "thin" # TODO: We could consider full here since this is only used for packaged release on github.

[profile.debug-full]
inherits = "dev"
Expand Down
16 changes: 8 additions & 8 deletions crates/cli/tests/cli_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,14 @@ mod cli_run {
// on the building of the platform

test_roc_app(
"crates/cli_testing_examples/expects",
"crates/cli/tests/expects",
"expects.roc",
&[],
&[],
&[],
indoc!(
r#"
── EXPECT FAILED in ...roc/roc/crates/cli_testing_examples/expects/expects.roc ─
── EXPECT FAILED in tests/expects/expects.roc ─────────────────────────────────

This expectation failed:

Expand All @@ -580,14 +580,14 @@ mod cli_run {
);

test_roc_app(
"crates/cli_testing_examples/expects",
"crates/cli/tests/expects",
"expects.roc",
&[],
&[],
&[],
indoc!(
r#"
── EXPECT FAILED in ...roc/roc/crates/cli_testing_examples/expects/expects.roc ─
── EXPECT FAILED in tests/expects/expects.roc ─────────────────────────────────

This expectation failed:

Expand All @@ -599,7 +599,7 @@ mod cli_run {
a : Num *
a = 1

── EXPECT FAILED in ...roc/roc/crates/cli_testing_examples/expects/expects.roc ─
── EXPECT FAILED in tests/expects/expects.roc ─────────────────────────────────

This expectation failed:

Expand All @@ -611,7 +611,7 @@ mod cli_run {
a : Num *
a = 1

── EXPECT FAILED in ...roc/roc/crates/cli_testing_examples/expects/expects.roc ─
── EXPECT FAILED in tests/expects/expects.roc ─────────────────────────────────

This expectation failed:

Expand Down Expand Up @@ -659,7 +659,7 @@ mod cli_run {
)]
fn fibonacci() {
test_roc_app_slim(
"crates/cli_testing_examples/algorithms",
"crates/cli/tests/algorithms",
"fibonacci.roc",
"",
UseValgrind::Yes,
Expand Down Expand Up @@ -698,7 +698,7 @@ mod cli_run {
#[cfg_attr(windows, ignore)]
fn quicksort() {
test_roc_app_slim(
"crates/cli_testing_examples/algorithms",
"crates/cli/tests/algorithms",
"quicksort.roc",
"[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2]\n",
UseValgrind::Yes,
Expand Down
24 changes: 18 additions & 6 deletions crates/cli_utils/src/bench_utils.rs

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions crates/cli_utils/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,15 @@ pub fn extract_valgrind_errors(xml: &str) -> Result<Vec<ValgrindError>, serde_xm
Ok(answer)
}

// start the dir with crates/cli_testing_examples
// start the dir with crates/cli/tests
#[allow(dead_code)]
pub fn cli_testing_dir(dir_name: &str) -> PathBuf {
let mut path = root_dir();

// Descend into examples/{dir_name}
path.push("crates");
path.push("cli_testing_examples");
path.push("cli");
path.push("tests");
path.extend(dir_name.split('/')); // Make slashes cross-target

path
Expand Down