Skip to content

Commit

Permalink
Make WASM tests happy
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Jul 17, 2023
1 parent 94aa018 commit 43e257b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/analyzer/tests/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ macro_rules! test_analysis_ingot {
"test_ingot",
IngotMode::Main,
FileKind::Local,
&tests::fixture_dir_files($path),
&test_files::new_fixture_dir_files($path),
indexmap! { "std".into() => std },
);

Expand Down
11 changes: 11 additions & 0 deletions crates/test-files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use include_dir::{include_dir, Dir};

const FIXTURES: Dir = include_dir!("$CARGO_MANIFEST_DIR/fixtures");

const NEW_FIXTURES: Dir = include_dir!("$CARGO_MANIFEST_DIR/../tests/fixtures");

pub fn fixture(path: &str) -> &'static str {
FIXTURES
.get_file(path)
Expand Down Expand Up @@ -31,3 +33,12 @@ pub fn fixture_dir_files(path: &str) -> Vec<(&'static str, &'static str)> {

fe_library::static_dir_files(dir)
}

/// Returns `(file_path, file_content)`
pub fn new_fixture_dir_files(path: &str) -> Vec<(&'static str, &'static str)> {
let dir = NEW_FIXTURES
.get_dir(path)
.unwrap_or_else(|| panic!("no fixture dir named \"{path}\""));

fe_library::static_dir_files(dir)
}
2 changes: 0 additions & 2 deletions crates/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ repository = "https://github.com/ethereum/fe"
fe-test-runner = {path = "../test-runner", version = "^0.23.0"}
fe-driver = {path = "../driver", version = "^0.23.0"}
fe-common = {path = "../common", version = "^0.23.0"}
fe-library = { path = "../library" }

dir-test = "^0.1"
include_dir = "0.7.2"

[features]
solc-backend = ["fe-driver/solc-backend"]
13 changes: 0 additions & 13 deletions crates/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ use fe_common::diagnostics::print_diagnostics;
use fe_common::utils::files::load_fe_files_from_dir;
use fe_test_runner::TestSink;

use include_dir::{include_dir, Dir};

const FIXTURES: Dir = include_dir!("$CARGO_MANIFEST_DIR/fixtures");

#[dir_test(dir: "$CARGO_MANIFEST_DIR/fixtures/files", glob: "*.fe")]
fn single_file_test_run(fixture: Fixture<&str>) {
let mut db = fe_driver::Db::default();
Expand Down Expand Up @@ -77,12 +73,3 @@ fn ingot_test_run(fixture: Fixture<&str>) {
}
}
}

/// Returns `(file_path, file_content)`
pub fn fixture_dir_files(path: &str) -> Vec<(&'static str, &'static str)> {
let dir = FIXTURES
.get_dir(path)
.unwrap_or_else(|| panic!("no fixture dir named \"{path}\""));

fe_library::static_dir_files(dir)
}

0 comments on commit 43e257b

Please sign in to comment.