Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Safonov <dsafonov@virtuozzo.com>2016-05-11 15:49:00 +0300
committerAndrei Vagin <avagin@virtuozzo.com>2017-03-14 21:03:29 +0300
commit6fe6a283e18226e94ac908c333cbd54f4f26db13 (patch)
tree46043f1db2b7aedfd3cde0c4f2016841a709875e /compel/Makefile
parent89978b5b1d39868397b82fb016bafa1b086b147b (diff)
compel: add tests for compel
Yet they only test for ELF header, but soon I'll add more of them. It's build with $ make test/compel/handle_binary and test output is in TAP format: $ ./test/compel/handle_binary ok 1 - check zero ELF header ok 2 - check non-supported ELF header ok 3 - check non-relocatable ELF header ok 4 - check zero ELF header ok 5 - check non-supported ELF header ok 6 - check non-relocatable ELF header (here two runs for x86_64 and x86_32 ELF binaries) I'm planning to integrate it with Travis, so we will be sure that compel is properly working (as this tests doesn't need any ns and may be run on qemu-static). Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'compel/Makefile')
-rw-r--r--compel/Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/compel/Makefile b/compel/Makefile
index 23b064c45..db90c7e14 100644
--- a/compel/Makefile
+++ b/compel/Makefile
@@ -6,8 +6,10 @@ ccflags-y += -iquote compel/arch/$(ARCH)/include
ccflags-y += -DCOMPEL_VERSION=\"$(COMPEL_SO_VERSION_MAJOR).$(COMPEL_SO_VERSION_MINOR)\"
host-ccflags-y += $(filter-out -pg $(CFLAGS-GCOV),$(ccflags-y))
-HOSTCFLAGS += $(filter-out -pg $(CFLAGS-GCOV),$(WARNINGS) $(filter-out -DCONFIG_X86_64,$(DEFINES)))
+HOSTCFLAGS += $(filter-out -pg $(CFLAGS-GCOV),$(WARNINGS) $(DEFINES))
HOSTLDFLAGS += $(filter-out -pg $(CFLAGS-GCOV),$(LDFLAGS))
+HOSTCFLAGS := $(filter-out -DCONFIG_X86_64,$(HOSTCFLAGS))
+export host-ccflags-y HOSTCFLAGS HOSTLDFLAGS
hostprogs-y += compel
compel-objs += main.o
@@ -17,10 +19,18 @@ compel-objs += arch/$(ARCH)/handle-elf.o
ifeq ($(ARCH),x86)
# Add -DCONFIG_X86_64 or -DCONFIG_X86_32 to HOSTCFLAGS
define ccflags-defines
- HOSTCFLAGS_$(notdir $(1)) += -DCONFIG_X86_64
+ export HOSTCFLAGS_$(notdir $(1)) += -DCONFIG_X86_64
endef
$(eval $(call map,ccflags-defines,$(compel-objs)))
compel-objs += handle-elf-32.o
-HOSTCFLAGS_handle-elf-32.o += -DCONFIG_X86_32
+export HOSTCFLAGS_handle-elf-32.o += -DCONFIG_X86_32
endif # ARCH == x86
+
+export compel-objs
+test/compel/%:
+ $(Q) $(MAKE) $(build)=test/compel $@
+
+test: test/compel/test_handle_binary
+
+.PHONY: test