Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix doctests and run in Makefile target
Our custom bare-metal allocator (`SvsmAllocator`) does not work during tests, as they run as regular userspace binaries. Thus, we must not set it as the global Rust allocator. To do this, we need a compile-time directive that lets us know we are building doctests and not the regular binary (`cfg(doctests)`), but sadly it is not properly set during test compilation(see rust-lang/rust#45599, rust-lang/rust#67295 and coconut-svsm#93). In order to bypass this, set the compile time flag ourselves via the RUSTFLAGS environment variable so that tests work. Also add the new invocation to the `test` target in the Makefile. Fixes: coconut-svsm#93 Fixes: 8cdea8e ("Cargo manifest: disable doctests") Signed-off-by: Carlos López <carlos.lopez@suse.com>
- Loading branch information