2014-06-17 03:22:06 +02:00
|
|
|
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
|
|
|
|
|
|
|
|
GTEST_ROOT ?= $(TOP)vendor/googletest
|
|
|
|
GTEST_FILE := ${GTEST_ROOT}/src/gtest-all
|
|
|
|
|
|
|
|
run_PCH := $(d)support/tests_pre.h
|
|
|
|
run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \
|
|
|
|
-I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
|
|
|
|
run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare
|
2014-07-02 19:36:19 +02:00
|
|
|
run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) -pthread
|
2014-06-17 03:22:06 +02:00
|
|
|
run_OBJ := \
|
|
|
|
$(subst .cpp,.o,$(wildcard $(d)tests/*.cpp)) \
|
|
|
|
$(d)support/main.o \
|
|
|
|
$(d)support/util.o \
|
|
|
|
$(TOP)lib/libaegisub.a \
|
|
|
|
$(TOP)lib/libuniversalchardet.a \
|
|
|
|
$(GTEST_FILE).o
|
|
|
|
|
|
|
|
# This bit of goofiness is to make it only try to build the tests if google
|
|
|
|
# test can be found and silently skip it if not, by using $(wildcard) to check
|
|
|
|
# for file existence
|
|
|
|
PROGRAM += $(subst $(GTEST_FILE).cc,$(d)run,$(wildcard $(GTEST_FILE).cc))
|
2010-12-05 20:12:42 +01:00
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
ifeq (yes, $(BUILD_DARWIN))
|
|
|
|
run_LIBS += -framework ApplicationServices -framework Foundation
|
|
|
|
endif
|
2010-12-05 20:12:42 +01:00
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
$(d)data: $(d)setup.sh
|
|
|
|
cd $(TOP)tests; ./setup.sh
|
2010-12-05 20:12:42 +01:00
|
|
|
|
2014-07-05 05:41:25 +02:00
|
|
|
gtest_filter ?= *
|
2014-06-17 03:22:06 +02:00
|
|
|
test-libaegisub: $(d)run $(d)data
|
2014-07-05 05:41:25 +02:00
|
|
|
cd $(TOP)tests; ./run --gtest_filter="$(gtest_filter)"
|
2014-04-25 17:44:11 +02:00
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
|
2010-12-05 20:12:42 +01:00
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
include $(TOP)Makefile.target
|