Skip to content

Commit b3ea19a

Browse files
authored
test: cache global template build at initialization (foundry-rs#6299)
* test: cache global template build at initialization * chore: remove pragmas from test sources * chore: route all pragma soliditys through TestProject * test: only use a single Solc version * test: restore pragma in can_test_pre_bytecode_hash * comment * regex fixes * fix regex 2
1 parent b205b6a commit b3ea19a

31 files changed

+541
-653
lines changed

crates/common/src/term.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ impl Reporter for SpinnerReporter {
184184

185185
/// Invoked before a new [`Solc`] bin is installed
186186
fn on_solc_installation_start(&self, version: &Version) {
187-
self.send_msg(format!("Installing solc version {version}"));
187+
self.send_msg(format!("Installing Solc version {version}"));
188188
}
189189

190190
/// Invoked before a new [`Solc`] bin was successfully installed
191191
fn on_solc_installation_success(&self, version: &Version) {
192-
self.send_msg(format!("Successfully installed solc {version}"));
192+
self.send_msg(format!("Successfully installed Solc {version}"));
193193
}
194194

195195
fn on_solc_installation_error(&self, version: &Version, error: &str) {
196-
self.send_msg(Paint::red(format!("Failed to install solc {version}: {error}")).to_string());
196+
self.send_msg(Paint::red(format!("Failed to install Solc {version}: {error}")).to_string());
197197
}
198198

199199
fn on_unresolved_imports(&self, imports: &[(&Path, &Path)], remappings: &[Remapping]) {

crates/forge/tests/cli/cache.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ forgetest!(can_list_specific_chain, |_prj, cmd| {
1616
});
1717

1818
forgetest_init!(can_test_no_cache, |prj, cmd| {
19-
let _ = std::fs::remove_dir_all(prj.cache_path());
19+
prj.clear_cache();
2020

2121
cmd.args(["test", "--no-cache"]).assert_success();
22-
assert!(!prj.cache_path().exists(), "cache file should not exist");
22+
assert!(!prj.cache().exists(), "cache file should not exist");
2323

24-
cmd.forge_fuse().args(["test"]).assert_success();
25-
assert!(prj.cache_path().exists(), "cache file should exist");
24+
cmd.forge_fuse().arg("test").assert_success();
25+
assert!(prj.cache().exists(), "cache file should exist");
2626
});

0 commit comments

Comments
 (0)