From 9feefc2e7f09dad4c2f00a99327bf1c50789ee75 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 4 Oct 2016 00:42:24 +0200 Subject: [PATCH] Makefile: added run-testsuite target. --- .gitignore | 1 + src/Makefile | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.gitignore b/.gitignore index 81bf8c04..a86fc0cd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ GNUmakefile MMakefile Makevars.local* +tmp-testsuite* *.a *.dll diff --git a/src/Makefile b/src/Makefile index ca63c35c..dd965091 100644 --- a/src/Makefile +++ b/src/Makefile @@ -141,6 +141,8 @@ help$(objext): $(MAKEFILE_LIST) endif +# automatically format some C++ source code files +ifeq ($(shell uname),Linux) CLANG_FORMAT_FILES += packhead.cpp CLANG_FORMAT_FILES += s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h CLANG_FORMAT_FILES += snprintf.cpp @@ -149,5 +151,26 @@ CLANG_FORMAT_FILES += ui.cpp ui.h util.h clang-format: $(top_srcdir)/src/stub/scripts/upx-clang-format -i $(addprefix $(top_srcdir)/src/,$(CLANG_FORMAT_FILES)) .PHONY: clang-format +endif + + +# run the UPX testsuite - git clone https://github.com/upx/upx-testsuite.git +# you have to set upx_testsuite_SRCDIR +ifndef upx_testsuite_SRCDIR +# search standard locations below $(top_srcdir) +ifneq ($(wildcard $(top_srcdir)/../upx-testsuite.git/files/packed/.),) +upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite.git +else ifneq ($(wildcard $(top_srcdir)/../upx-testsuite/files/packed/.),) +upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuit +endif +endif +ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),) +run-testsuite: export upx_exe := ./upx$(exeext) +run-testsuite: export upx_testsuite_SRCDIR := $(upx_testsuite_SRCDIR) +run-testsuite: export upx_testsuite_BUILDDIR := ./tmp-testsuite +run-testsuite: ./upx$(exeext) + time -p bash $(top_srcdir)/.github/travis_testsuite_1.sh +.PHONY: run-testsuite +endif # vim:set ts=8 sw=8 noet: