Commit 6b83a5d8 authored by gejun's avatar gejun

Only turn on O2 for baidu_time_test.cpp to speed up compilation of UT

parent 89ec1d22
......@@ -2,7 +2,7 @@ NEED_GPERFTOOLS=1
NEED_GTEST=1
include ../config.mk
CPPFLAGS+=-DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DUNIT_TEST -Dprivate=public -Dprotected=public -DBVAR_NOT_LINK_DEFAULT_VARIABLES --include sstream_workaround.h
CXXFLAGS=$(CPPFLAGS) -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x
CXXFLAGS=$(CPPFLAGS) -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x
#required by butil/crc32.cc to boost performance for 10x
ifeq ($(shell test $(GCC_VERSION) -ge 40400; echo $$?),0)
......@@ -200,6 +200,10 @@ endif
@echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. --proto_path=../src --proto_path=$(PROTOBUF_HDR) $<
baidu_time_unittest.o:baidu_time_unittest.cpp | libbrpc.dbg.a
@echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) -O2 $(CXXFLAGS) $< -o $@
%.o:%.cpp | libbrpc.dbg.a
@echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
......
......@@ -198,4 +198,4 @@ TEST(BaiduTimeTest, timer_auto_start) {
printf("Cost %" PRId64 "us\n", t.u_elapsed());
}
}
} // namespace
......@@ -12,10 +12,6 @@ class HPackTest : public testing::Test {
// Copied test cases from example of rfc7541
TEST_F(HPackTest, header_with_indexing) {
char c = 128;
uint8_t c2 = c;
printf("%u %u %d %d\n", (uint32_t)c, (uint32_t)c2, (int)c, (int)c2);
brpc::HPacker p1;
ASSERT_EQ(0, p1.Init(4096));
brpc::HPacker p2;
......
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