Skip to content

Commit

Permalink
Makefile: respect CARGO_ARGS when running tests
Browse files Browse the repository at this point in the history
Use the already existing CARGO_ARGS in the Makefile when running
tests, as there are  situations where one may want to pass additional
flags to "cargo test", like building the tests in release mode.

Signed-off-by: Carlos López <[email protected]>
  • Loading branch information
00xc committed Mar 26, 2024
1 parent 80f3ea3 commit c163d25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bin/coconut-test-qemu.igvm: $(IGVMBUILDER) $(IGVMMEASURE) bin/test-kernel.elf b
$(IGVMMEASURE) $@

test:
cargo test --workspace --target=x86_64-unknown-linux-gnu
cargo test ${CARGO_ARGS} --workspace --target=x86_64-unknown-linux-gnu

test-in-svsm: utils/cbit bin/coconut-test-qemu.igvm
./scripts/test-in-svsm.sh
Expand Down Expand Up @@ -102,7 +102,7 @@ bin/svsm-kernel.elf: bin
objcopy -O elf64-x86-64 --strip-unneeded ${SVSM_KERNEL_ELF} $@

bin/test-kernel.elf: bin
LINK_TEST=1 cargo +nightly test -p svsm --config 'target.x86_64-unknown-none.runner=["sh", "-c", "cp $$0 ../${TEST_KERNEL_ELF}"]'
LINK_TEST=1 cargo +nightly test ${CARGO_ARGS} -p svsm --config 'target.x86_64-unknown-none.runner=["sh", "-c", "cp $$0 ../${TEST_KERNEL_ELF}"]'
objcopy -O elf64-x86-64 --strip-unneeded ${TEST_KERNEL_ELF} bin/test-kernel.elf

${FS_BIN}: bin
Expand Down

0 comments on commit c163d25

Please sign in to comment.