From 6cdee087f49f3f4b3d44817528c016bf8d92376b Mon Sep 17 00:00:00 2001 From: Matej Hrica Date: Mon, 27 Jan 2025 17:51:31 +0100 Subject: [PATCH] Makefile: add `make test` command Intruduce a test target in Makefile, that runs the e2e tests agains the built binary. Signed-off-by: Matej Hrica --- .gitignore | 1 + Makefile | 9 ++++++++- tests/test_cases/src/test_tsi_hijack_tcp.rs | 0 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/test_cases/src/test_tsi_hijack_tcp.rs diff --git a/.gitignore b/.gitignore index aa03a7ca..c0d236b7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ __pycache__ /libkrun.pc init/init examples/chroot_vm +test-prefix diff --git a/Makefile b/Makefile index abe3a9dc..a39b22eb 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ ifeq ($(PREFIX),) PREFIX := /usr/local endif -.PHONY: install clean $(LIBRARY_RELEASE_$(OS)) $(LIBRARY_DEBUG_$(OS)) +.PHONY: install clean test $(LIBRARY_RELEASE_$(OS)) $(LIBRARY_DEBUG_$(OS)) all: $(LIBRARY_RELEASE_$(OS)) libkrun.pc @@ -136,3 +136,10 @@ install: clean: rm -f $(INIT_BINARY) cargo clean + rm -rf test-prefix + cd tests; cargo clean + +test: $(LIBRARY_RELEASE_$(OS)) + mkdir -p test-prefix + PKG_CONFIG_PATH=test-prefix/lib64/pkgconfig/ PREFIX=test-prefix make install + cd tests; PKG_CONFIG_PATH=../test-prefix/lib64/pkgconfig/ ./run.sh diff --git a/tests/test_cases/src/test_tsi_hijack_tcp.rs b/tests/test_cases/src/test_tsi_hijack_tcp.rs new file mode 100644 index 00000000..e69de29b