Cache worker

This commit is contained in:
Artur Jamro
2019-08-27 14:38:42 -07:00
committed by Dan Gohman
parent 9c747db429
commit febb0cb693
14 changed files with 1034 additions and 65 deletions

View File

@@ -2,6 +2,9 @@ use wasmtime_environ::cache_config;
#[test]
fn test_cache_default_config_in_memory() {
let errors = cache_config::init::<&str>(true, None, false);
assert!(errors.is_empty());
let errors = cache_config::init::<&str>(true, None, false, None);
assert!(
errors.is_empty(),
"This test loads config from the default location, if there's one. Make sure it's correct!"
);
}

View File

@@ -20,7 +20,7 @@ fn test_cache_fail_calling_init_twice() {
);
fs::write(&config_path, config_content).expect("Failed to write test config file");
let errors = cache_config::init(true, Some(&config_path), false);
let errors = cache_config::init(true, Some(&config_path), false, None);
assert!(errors.is_empty());
let _errors = cache_config::init(true, Some(&config_path), false);
let _errors = cache_config::init(true, Some(&config_path), false, None);
}

View File

@@ -18,6 +18,6 @@ fn test_cache_fail_invalid_config() {
);
fs::write(&config_path, config_content).expect("Failed to write test config file");
let errors = cache_config::init(true, Some(&config_path), false);
let errors = cache_config::init(true, Some(&config_path), false, None);
assert!(!errors.is_empty());
}

View File

@@ -5,6 +5,6 @@ use wasmtime_environ::cache_config;
fn test_cache_fail_invalid_path_to_config() {
let dir = tempfile::tempdir().expect("Can't create temporary directory");
let config_path = dir.path().join("cache-config.toml"); // doesn't exist
let errors = cache_config::init(true, Some(&config_path), false);
let errors = cache_config::init(true, Some(&config_path), false, None);
assert!(!errors.is_empty());
}

View File

@@ -6,7 +6,7 @@ fn test_cache_write_default_config() {
let dir = tempfile::tempdir().expect("Can't create temporary directory");
let config_path = dir.path().join("cache-config.toml");
let errors = cache_config::init(true, Some(&config_path), true);
let errors = cache_config::init(true, Some(&config_path), true, None);
assert!(errors.is_empty());
assert!(config_path.exists());
}