diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..49b1024 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "test/unit/objs"] + path = test/unit/objs + url = https://github.com/dynup/kpatch-unit-test-objs.git diff --git a/test/unit/Makefile b/test/unit/Makefile index 15a72bd..c4e5c5d 100644 --- a/test/unit/Makefile +++ b/test/unit/Makefile @@ -1,7 +1,11 @@ -ARCH=$(shell uname -m) +ARCH = $(shell uname -m) +OBJDIR ?= objs/$(ARCH) -all: Makefile.include $(ARCH)/Makefile - $(MAKE) -C $(ARCH) +.PHONY: all clean -clean: Makefile.include $(ARCH)/Makefile - $(MAKE) -C $(ARCH) clean +all: Makefile.include + git submodule update --init --rebase + $(MAKE) -C $(OBJDIR) + +clean: Makefile.include + $(MAKE) -C $(OBJDIR) clean diff --git a/test/unit/Makefile.include b/test/unit/Makefile.include index 45a503f..2f07fe9 100644 --- a/test/unit/Makefile.include +++ b/test/unit/Makefile.include @@ -12,7 +12,7 @@ MUTE_FAIL := >/dev/null 2>&1 .SILENT: $(TARGETS) $(TEST_TARGETS) endif -SRC_PATH ?= $(realpath ../../../) +SRC_PATH ?= $(realpath ../../../../) CDO ?= $(SRC_PATH)/kpatch-build/create-diff-object TEST_LIBRARY ?= $(SRC_PATH)/test/test-functions.sh @@ -22,12 +22,6 @@ TEST_ENV = KPATCH_TEST_LIBRARY=$(TEST_LIBRARY) TARGETS = $(patsubst %.$(EXT_ORIG),%.$(EXT_OUTPUT),$(wildcard *.$(EXT_ORIG))) TEST_TARGETS = $(patsubst %.$(EXT_TEST),%.$(EXT_TEST_OUTPUT),$(wildcard *.$(EXT_TEST))) -define check_lfs = - $(if $(shell head -1 $(1) | grep git-lfs.github.com), - $(error $(1) is not fetched. Unittests require https://git-lfs.github.com/), - ) -endef - define check_stripped = $(if $(shell readelf --debug-dump $(1)), $(error $(1) is not properly stripped, use 'strip --strip-debug --keep-file-symbols $(1)' to fix this), @@ -35,7 +29,6 @@ define check_stripped = endef define check_all = - $(call check_lfs,$(1)) $(call check_stripped,$(1)) endef diff --git a/test/unit/objs b/test/unit/objs new file mode 160000 index 0000000..5e9ba83 --- /dev/null +++ b/test/unit/objs @@ -0,0 +1 @@ +Subproject commit 5e9ba838509a38817bf394fdbb43b4f1ce5a9229