diff options
| author | nyamatongwe <unknown> | 2011-02-01 15:08:37 +1100 |
|---|---|---|
| committer | nyamatongwe <unknown> | 2011-02-01 15:08:37 +1100 |
| commit | cebe1906c3f42f093c497118d1048057ab4aec3a (patch) | |
| tree | 74986c53e261fea310243f047922f565a53888d5 /test/unit/makefile | |
| parent | 3d028ac24af1f6d1183717c55d65e291836c37d9 (diff) | |
| download | scintilla-mirror-cebe1906c3f42f093c497118d1048057ab4aec3a.tar.gz | |
Unit tests for Scintilla data structures.
Diffstat (limited to 'test/unit/makefile')
| -rw-r--r-- | test/unit/makefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/test/unit/makefile b/test/unit/makefile new file mode 100644 index 000000000..6a4ec8747 --- /dev/null +++ b/test/unit/makefile @@ -0,0 +1,62 @@ +# Build all the unit tests +# Should be run using mingw32-make on Windows + +.SUFFIXES: .cxx + +GTEST_DIR = ../../../../gtest-1.5.0 + +ifdef windir + +DEL = del /q +# Find Google Test headers. +CPPFLAGS += -I$(GTEST_DIR)/include +GTEST_ALL = gtest-all.o +LINKFLAGS = $(CPPFLAGS) $(CXXFLAGS) + +else + +DEL = rm -f +CPPFLAGS = $(shell gtest-config --cppflags) +CXXFLAGS = $(shell gtest-config --cxxflags) +LINKFLAGS = $(shell gtest-config --ldflags --libs) + +endif + +#vpath %.cxx ../src ../lexlib ../lexers +vpath %.cxx ../../src + + +INCLUDEDIRS = -I ../../include -I ../../src -I../../lexlib + + +# Find headers of test code. +CPPFLAGS += $(INCLUDEDIRS) + +CXXFLAGS += -g -Wall -Wextra -Wno-unused-function +#~ CXXFLAGS += -g -Wall + +CASES:=$(addsuffix .o,$(basename $(notdir $(wildcard test*.cxx)))) +TESTEDOBJS=ContractionState.o RunStyles.o + +TESTS=unitTest + +GTEST_HEADERS=$(GTEST_DIR)/include/gtest/*.h $(GTEST_DIR)/include/gtest/internal/*.h + +all: $(TESTS) + +clean: + $(DEL) $(TESTS) *.a *.o *.exe + +# Usually you shouldn't tweak such internal variables, indicated by a +# trailing _. +GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS) + +gtest-all.o: $(GTEST_SRCS_) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(GTEST_DIR) -c \ + $(GTEST_DIR)/src/gtest-all.cc + +.cxx.o: + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< + +unitTest: $(CASES) $(TESTEDOBJS) unitTest.o $(GTEST_ALL) + $(CXX) $(LINKFLAGS) $^ -o $@ |
