2006-03-29 10:35:45 +00:00
|
|
|
######################################################################
|
|
|
|
# Unit/regression tests, based on CxxTest.
|
|
|
|
# Use the 'test' target to run them.
|
2006-03-29 11:00:39 +00:00
|
|
|
# Edit TESTS and TESTLIBS to add more tests.
|
|
|
|
#
|
2006-03-29 10:35:45 +00:00
|
|
|
######################################################################
|
|
|
|
|
2011-02-09 01:09:01 +00:00
|
|
|
TESTS := $(srcdir)/test/common/*.h $(srcdir)/test/audio/*.h
|
2011-06-08 12:58:53 +00:00
|
|
|
TEST_LIBS := audio/libaudio.a common/libcommon.a
|
2006-03-29 11:00:39 +00:00
|
|
|
|
|
|
|
#
|
2011-05-16 13:22:43 +00:00
|
|
|
TEST_FLAGS := --runner=StdioPrinter --no-std --no-eh
|
2009-03-21 22:11:16 +00:00
|
|
|
TEST_CFLAGS := -I$(srcdir)/test/cxxtest
|
2010-02-01 21:32:33 +00:00
|
|
|
TEST_LDFLAGS := $(LIBS)
|
2010-11-05 01:20:53 +00:00
|
|
|
TEST_CXXFLAGS := $(filter-out -Wglobal-constructors,$(CXXFLAGS))
|
2006-03-29 11:00:39 +00:00
|
|
|
|
2009-11-24 22:11:27 +00:00
|
|
|
ifdef HAVE_GCC3
|
|
|
|
# In test/common/str.h, we test a zero length format string. This causes GCC
|
|
|
|
# to generate a warning which in turn poses a problem when building with -Werror.
|
|
|
|
# To work around this, we disable -Wformat here.
|
|
|
|
TEST_CFLAGS += -Wno-format
|
|
|
|
endif
|
2006-03-29 11:00:39 +00:00
|
|
|
|
|
|
|
# Enable this to get an X11 GUI for the error reporter.
|
|
|
|
#TEST_FLAGS += --gui=X11Gui
|
|
|
|
#TEST_LDFLAGS += -L/usr/X11R6/lib -lX11
|
|
|
|
|
|
|
|
|
|
|
|
test: test/runner
|
|
|
|
./test/runner
|
|
|
|
test/runner: test/runner.cpp $(TEST_LIBS)
|
2011-01-28 10:27:50 +00:00
|
|
|
$(QUIET_LINK)$(CXX) $(TEST_CXXFLAGS) $(CPPFLAGS) $(TEST_CFLAGS) -o $@ $+ $(TEST_LDFLAGS)
|
2006-03-29 11:00:39 +00:00
|
|
|
test/runner.cpp: $(TESTS)
|
2009-03-21 22:11:16 +00:00
|
|
|
@mkdir -p test
|
|
|
|
$(srcdir)/test/cxxtest/cxxtestgen.py $(TEST_FLAGS) -o $@ $+
|
2006-03-29 10:35:45 +00:00
|
|
|
|
2006-03-29 11:05:38 +00:00
|
|
|
|
|
|
|
clean: clean-test
|
|
|
|
clean-test:
|
|
|
|
-$(RM) test/runner.cpp test/runner
|
|
|
|
|
|
|
|
.PHONY: test clean-test
|