Skip to content

Commit 6619612

Browse files
committed
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 <[email protected]>
1 parent 9e6edc8 commit 6619612

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__
99
/libkrun.pc
1010
init/init
1111
examples/chroot_vm
12+
test-prefix

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ ifeq ($(PREFIX),)
7474
PREFIX := /usr/local
7575
endif
7676

77-
.PHONY: install clean $(LIBRARY_RELEASE_$(OS)) $(LIBRARY_DEBUG_$(OS))
77+
.PHONY: install clean test $(LIBRARY_RELEASE_$(OS)) $(LIBRARY_DEBUG_$(OS))
7878

7979
all: $(LIBRARY_RELEASE_$(OS)) libkrun.pc
8080

@@ -136,3 +136,10 @@ install: libkrun.pc
136136
clean:
137137
rm -f $(INIT_BINARY)
138138
cargo clean
139+
rm -rf test-prefix
140+
cd tests; cargo clean
141+
142+
test: $(LIBRARY_RELEASE_$(OS))
143+
mkdir -p test-prefix
144+
PKG_CONFIG_PATH=test-prefix/lib64/pkgconfig/ PREFIX="$$(realpath test-prefix)" make install
145+
cd tests; LD_LIBRARY_PATH=../test-prefix/lib64/ PKG_CONFIG_PATH=../test-prefix/lib64/pkgconfig/ ./run.sh

0 commit comments

Comments
 (0)