Hello!
I'm trying to create automated tests and I've been following the tutorial (From the rust book) and I was able to build and make a the test example.
However, I want to make tests for my project and it's from another cargo file. I want to import my projects function calls in the tests (The automated tests).
NOTE: this cargo.toml below is for the main.rs binary.
Cargo.toml for project:
workspace = { members = ["automated_tests"] }
[package]
name = "terminal_adventure"
version = "0.1.0"
edition = "2021"
# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1
# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# NOTE: Remember to revert this before releasing your game!
# Otherwise you will need to include libbevy_dylib alongside your game if you want it to run.
# If you remove the "dynamic" feature, your game executable can run standalone.
bevy = { version = "0.12.1", features = ["dynamic_linking"] }
bevy_ascii_terminal = "0.14.0"
bevy_interact_2d = "0.9.0"
NOTE: the cargo.toml below is for the lib.rs
The Cargo.toml for the test:
[package]
name = "automated_tests"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Any guidance or help would be appreciated.