Commit e5ad244f authored by gejun's avatar gejun

mv libbrpc.dbg.a into test & fix .travis.yml

parent 72a7748b
...@@ -5,9 +5,8 @@ sudo: required ...@@ -5,9 +5,8 @@ sudo: required
install: install:
- sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev - sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev
- sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd - - sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd -
- sh config_brpc.sh --headers=/usr/include --libs=/usr/lib - sh config_brpc.sh --headers=/usr/include --libs=/usr/lib --nodebugsymbols
- make -sj8 - make -j4
- cd test && make -sj8
script: script:
- cd test && sh ./run_tests.sh - cd test && sh ./run_tests.sh
...@@ -180,16 +180,16 @@ PROTOS=$(BRPC_PROTOS) src/idl_options.proto ...@@ -180,16 +180,16 @@ PROTOS=$(BRPC_PROTOS) src/idl_options.proto
all: protoc-gen-mcpack libbrpc.a libbrpc.so output/include output/lib output/bin all: protoc-gen-mcpack libbrpc.a libbrpc.so output/include output/lib output/bin
.PHONY:debug .PHONY:debug
debug: libbrpc.dbg.a libbvar.dbg.a debug: test/libbrpc.dbg.a test/libbvar.dbg.a
.PHONY:clean .PHONY:clean
clean:clean_debug clean:
@echo "Cleaning" @echo "Cleaning"
@rm -rf src/mcpack2pb/generator.o protoc-gen-mcpack libbrpc.a libbrpc.so $(OBJS) output/include output/lib output/bin $(PROTOS:.proto=.pb.h) $(PROTOS:.proto=.pb.cc) @rm -rf src/mcpack2pb/generator.o protoc-gen-mcpack libbrpc.a libbrpc.so $(OBJS) output/include output/lib output/bin $(PROTOS:.proto=.pb.h) $(PROTOS:.proto=.pb.cc)
.PHONY:clean_debug .PHONY:clean_debug
clean_debug: clean_debug:
@rm -rf libbrpc.dbg.a libbvar.dbg.a $(DEBUG_OBJS) @rm -rf test/libbrpc.dbg.a test/libbvar.dbg.a $(DEBUG_OBJS)
.PRECIOUS: %.o .PRECIOUS: %.o
...@@ -206,11 +206,11 @@ libbrpc.so:$(BRPC_PROTOS:.proto=.pb.h) $(OBJS) ...@@ -206,11 +206,11 @@ libbrpc.so:$(BRPC_PROTOS:.proto=.pb.h) $(OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -shared -o $@ $(LIBPATHS) $(SOPATHS) -Xlinker "-(" $(filter %.o,$^) -Xlinker "-)" $(STATIC_LINKINGS) $(DYNAMIC_LINKINGS) @$(CXX) -shared -o $@ $(LIBPATHS) $(SOPATHS) -Xlinker "-(" $(filter %.o,$^) -Xlinker "-)" $(STATIC_LINKINGS) $(DYNAMIC_LINKINGS)
libbvar.dbg.a:$(BVAR_DEBUG_OBJS) test/libbvar.dbg.a:$(BVAR_DEBUG_OBJS)
@echo "Packing $@" @echo "Packing $@"
@ar crs $@ $^ @ar crs $@ $^
libbrpc.dbg.a:$(BRPC_PROTOS:.proto=.pb.h) $(DEBUG_OBJS) test/libbrpc.dbg.a:$(BRPC_PROTOS:.proto=.pb.h) $(DEBUG_OBJS)
@echo "Packing $@" @echo "Packing $@"
@ar crs $@ $(filter %.o,$^) @ar crs $@ $(filter %.o,$^)
......
...@@ -14,7 +14,7 @@ ifeq ($(shell test $(GCC_VERSION) -ge 70000; echo $$?),0) ...@@ -14,7 +14,7 @@ ifeq ($(shell test $(GCC_VERSION) -ge 70000; echo $$?),0)
endif endif
HDRPATHS=-I. -I../src $(addprefix -I, $(HDRS)) HDRPATHS=-I. -I../src $(addprefix -I, $(HDRS))
LIBPATHS=-L.. $(addprefix -L, $(LIBS)) LIBPATHS=$(addprefix -L, $(LIBS))
TEST_BUTIL_SOURCES = \ TEST_BUTIL_SOURCES = \
at_exit_unittest.cc \ at_exit_unittest.cc \
...@@ -135,38 +135,35 @@ TEST_BINS = test_butil test_bvar $(TEST_BTHREAD_SOURCES:.cpp=) $(TEST_BRPC_SOURC ...@@ -135,38 +135,35 @@ TEST_BINS = test_butil test_bvar $(TEST_BTHREAD_SOURCES:.cpp=) $(TEST_BRPC_SOURC
all: $(TEST_BINS) all: $(TEST_BINS)
.PHONY:clean .PHONY:clean
clean:clean_bins clean_debug clean:clean_bins
@echo "Cleaning" @echo "Cleaning"
@rm -rf $(TEST_BUTIL_OBJS) $(TEST_BVAR_OBJS) $(TEST_BTHREAD_OBJS) $(TEST_BRPC_OBJS) $(TEST_PROTO_OBJS) @rm -rf $(TEST_BUTIL_OBJS) $(TEST_BVAR_OBJS) $(TEST_BTHREAD_OBJS) $(TEST_BRPC_OBJS) $(TEST_PROTO_OBJS)
@$(MAKE) -C.. clean_debug
.PHONY:clean_bins .PHONY:clean_bins
clean_bins: clean_bins:
@rm -rf $(TEST_BINS) @rm -rf $(TEST_BINS)
.PHONY:clean_debug libbrpc.dbg.a:
clean_debug:
@$(MAKE) -C.. clean_debug
../libbrpc.dbg.a: FORCE
@$(MAKE) -C.. debug @$(MAKE) -C.. debug
FORCE: FORCE:
.PRECIOUS: %.o .PRECIOUS: %.o
test_butil:../libbrpc.dbg.a $(TEST_BUTIL_OBJS) test_butil:libbrpc.dbg.a $(TEST_BUTIL_OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) @$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
test_bvar:../libbrpc.dbg.a $(TEST_BVAR_OBJS) test_bvar:libbrpc.dbg.a $(TEST_BVAR_OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $(TEST_BVAR_OBJS) ../libbvar.dbg.a -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) @$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $(TEST_BVAR_OBJS) libbvar.dbg.a -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
bthread%unittest:../libbrpc.dbg.a bthread%unittest.o bthread%unittest:libbrpc.dbg.a bthread%unittest.o
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) @$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
brpc_%_unittest:../libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o brpc_%_unittest:libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) @$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
...@@ -174,11 +171,11 @@ brpc_%_unittest:../libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o ...@@ -174,11 +171,11 @@ brpc_%_unittest:../libbrpc.dbg.a $(TEST_PROTO_OBJS) brpc_%_unittest.o
@echo "Generating $@" @echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. --proto_path=../src --proto_path=$(PROTOBUF_HDR) $< @$(PROTOC) --cpp_out=. --proto_path=. --proto_path=../src --proto_path=$(PROTOBUF_HDR) $<
%.o:%.cpp %.o:%.cpp | libbrpc.dbg.a
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc %.o:%.cc | libbrpc.dbg.a
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test_num=0 test_num=0
failed_test="" failed_test=""
rc=0 rc=0
make -j8 make -j4
test_bins="test_butil test_bvar bthread*unittest brpc*unittest" test_bins="test_butil test_bvar bthread*unittest brpc*unittest"
for test_bin in $test_bins; do for test_bin in $test_bins; do
test_num=$((test_num + 1)) test_num=$((test_num + 1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment