wasmer_integration_tests_cli/
fixtures.rs

1//! Paths for commonly used test files.
2
3use std::path::{Path, PathBuf};
4
5use crate::{asset_path, c_asset_path, integration_wasm_path, integration_webc_path};
6
7pub fn resources() -> PathBuf {
8    Path::new(env!("CARGO_MANIFEST_DIR")).join("resources")
9}
10
11pub fn packages() -> PathBuf {
12    Path::new(env!("CARGO_MANIFEST_DIR"))
13        .join("tests")
14        .join("packages")
15}
16
17pub fn php() -> (PathBuf, PathBuf, PathBuf) {
18    let resources = resources().join("php");
19    (
20        integration_wasm_path().join("php.wasm"),
21        resources.clone(),
22        resources.join("db"),
23    )
24}
25
26/// A WEBC file containing the Python interpreter, compiled to WASI.
27pub fn python() -> PathBuf {
28    c_asset_path().join("python--python@3.13.5.webc")
29}
30
31/// A WEBC file containing bash.
32pub fn bash() -> PathBuf {
33    integration_webc_path().join("bash-1.0.16-f097441a-a80b-4e0d-87d7-684918ef4bb6.webc")
34}
35
36/// A WEBC file containing `wat2wasm`, `wasm-validate`, and other helpful
37/// WebAssembly-related commands.
38pub fn wabt() -> PathBuf {
39    c_asset_path().join("wabt-1.0.37.wasmer")
40}
41
42/// The QuickJS interpreter, compiled to a WASI module.
43pub fn qjs() -> PathBuf {
44    c_asset_path().join("qjs.wasm")
45}
46
47/// The `wasmer.toml` file for QuickJS.
48pub fn qjs_wasmer_toml() -> PathBuf {
49    c_asset_path().join("qjs-wasmer.toml")
50}
51
52/// A `*.wat` file which calculates fib(40) and exits with no output.
53pub fn fib() -> PathBuf {
54    asset_path().join("fib.wat")
55}
56
57/// A `*.wat` file with no `_start()` function.
58pub fn wat_no_start() -> PathBuf {
59    asset_path().join("no_start.wat")
60}