Skip to main content

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_c_api_path, integration_wasm_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/// The QuickJS interpreter, compiled to a WASI module.
32pub fn qjs() -> PathBuf {
33    c_asset_path().join("qjs.wasm")
34}
35
36/// The `wasmer.toml` file for QuickJS.
37pub fn qjs_wasmer_toml() -> PathBuf {
38    c_asset_path().join("qjs-wasmer.toml")
39}
40
41/// A `*.wat` file which calculates fib(40) and exits with no output.
42pub fn fib() -> PathBuf {
43    asset_path().join("fib.wat")
44}
45
46/// A `*.wat` file with no `_start()` function.
47pub fn wat_no_start() -> PathBuf {
48    asset_path().join("no_start.wat")
49}
50
51/// C source for a WASIX guest that imports and calls `wasm_c_api_v0`.
52pub fn wasix_wasm_c_api_smoke_c() -> PathBuf {
53    integration_wasm_c_api_path().join("wasix-wasm-c-api-smoke.c")
54}