From 2e998eee58226c29eeb48c94826ec5209a643ff6 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 | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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..f9fd8c6d 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 @@ -135,4 +135,10 @@ install: clean: rm -f $(INIT_BINARY) + rm -rf test-prefix cargo clean + +test: $(LIBRARY_RELEASE_$(OS)) + mkdir -p test-prefix + PREFIX=test-prefix make install + cd tests; PKG_CONFIG_PATH=../test-prefix/lib64/pkgconfig/ ./run.sh