Skip to content

Commit

Permalink
Makefile: add make test command
Browse files Browse the repository at this point in the history
Intruduce a test target in Makefile, that runs the e2e tests agains the built binary.

Signed-off-by: Matej Hrica <mhrica@redhat.com>
  • Loading branch information
mtjhrc committed Feb 4, 2025
1 parent 3ba8e02 commit 6cdee08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ __pycache__
/libkrun.pc
init/init
examples/chroot_vm
test-prefix
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Empty file.

0 comments on commit 6cdee08

Please sign in to comment.