aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2016-01-22 21:10:07 -0800
committerVitaly Buka <vitalybuka@google.com>2016-01-25 19:28:17 +0000
commit43bf6b78b758c7efd18d2cdc8c3c93cea04e71b8 (patch)
tree2926b3b23dca715df247f58667cdb7e8ba3d277f
parente03c0946c88601203e97b2da3de2d8b478f43c34 (diff)
downloadlibweave-43bf6b78b758c7efd18d2cdc8c3c93cea04e71b8.tar.gz
Update gtest
Change-Id: Ifce12b71b7435df58f9b25ef5b5e4e8d0ab909c6 Reviewed-on: https://weave-review.googlesource.com/2330 Reviewed-by: Vitaly Buka <vitalybuka@google.com>
-rw-r--r--tests.mk21
-rwxr-xr-xthird_party/get_gtest.sh19
-rw-r--r--third_party/third_party.mk5
3 files changed, 31 insertions, 14 deletions
diff --git a/tests.mk b/tests.mk
index 563b94b..4e11f7e 100644
--- a/tests.mk
+++ b/tests.mk
@@ -28,8 +28,15 @@ $(weave_unittest_obj_files) : out/$(BUILD_MODE)/%.o : %.cc third_party/include/g
mkdir -p $(dir $@)
$(CXX) $(DEFS_TEST) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
-out/$(BUILD_MODE)/libweave_testrunner : $(weave_unittest_obj_files) $(third_party_chromium_crypto_unittest_obj_files) $(third_party_chromium_base_unittest_obj_files) out/$(BUILD_MODE)/libweave_common.a out/$(BUILD_MODE)/libweave-test.a
- $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lgmock -lgtest -lpthread -lrt -Lthird_party/lib
+out/$(BUILD_MODE)/libweave_testrunner : \
+ $(weave_unittest_obj_files) \
+ $(third_party_chromium_crypto_unittest_obj_files) \
+ $(third_party_chromium_base_unittest_obj_files) \
+ out/$(BUILD_MODE)/libweave_common.a \
+ out/$(BUILD_MODE)/libweave-test.a \
+ third_party/lib/gmock.a \
+ third_party/lib/gtest.a
+ $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lpthread -lrt -Lthird_party/lib
test : out/$(BUILD_MODE)/libweave_testrunner
$(TEST_ENV) $< $(TEST_FLAGS)
@@ -43,8 +50,14 @@ $(weave_exports_unittest_obj_files) : out/$(BUILD_MODE)/%.o : %.cc third_party/i
mkdir -p $(dir $@)
$(CXX) $(DEFS_TEST) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
-out/$(BUILD_MODE)/libweave_exports_testrunner : $(weave_exports_unittest_obj_files) out/$(BUILD_MODE)/libweave.so out/$(BUILD_MODE)/libweave-test.a out/$(BUILD_MODE)/src/test/weave_testrunner.o
- $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lgmock -lgtest -lpthread -lrt -Lthird_party/lib -Wl,-rpath=out/$(BUILD_MODE)/
+out/$(BUILD_MODE)/libweave_exports_testrunner : \
+ $(weave_exports_unittest_obj_files) \
+ out/$(BUILD_MODE)/libweave.so \
+ out/$(BUILD_MODE)/libweave-test.a \
+ out/$(BUILD_MODE)/src/test/weave_testrunner.o \
+ third_party/lib/gmock.a \
+ third_party/lib/gtest.a
+ $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lpthread -lrt -Lthird_party/lib -Wl,-rpath=out/$(BUILD_MODE)/
export-test : out/$(BUILD_MODE)/libweave_exports_testrunner
$(TEST_ENV) $< $(TEST_FLAGS)
diff --git a/third_party/get_gtest.sh b/third_party/get_gtest.sh
index 0a2e952..9b546ab 100755
--- a/third_party/get_gtest.sh
+++ b/third_party/get_gtest.sh
@@ -15,16 +15,17 @@ cd googletest
# gtest is in process of changing of dir structure and it has broken build
# files. So this is temporarily workaround to fix that.
-git reset --hard d945d8c000a0ade73585d143532266968339bbb3
+git reset --hard 82b11b8cfcca464c2ac74b623d04e74452e74f32
mv googletest googlemock/gtest
-for SUB_DIR in googlemock/gtest googlemock; do
- cd $THIRD_PARTY/googletest/$SUB_DIR || exit 1
- autoreconf -fvi || exit 1
- ./configure --disable-shared || exit 1
- make || exit 1
- cp -rf include/* $THIRD_PARTY/include/ || exit 1
- cp -rf lib/.libs/* $THIRD_PARTY/lib/ || exit 1
-done
+cd $THIRD_PARTY/googletest/googlemock/gtest/make || exit 1
+make gtest.a || exit 1
+cp -rf ../include/* $THIRD_PARTY/include/ || exit 1
+cp -rf gtest.a $THIRD_PARTY/lib/ || exit 1
+
+cd $THIRD_PARTY/googletest/googlemock/make || exit 1
+make gmock.a || exit 1
+cp -rf ../include/* $THIRD_PARTY/include/ || exit 1
+cp -rf gmock.a $THIRD_PARTY/lib/ || exit 1
rm -rf $THIRD_PARTY/googletest
diff --git a/third_party/third_party.mk b/third_party/third_party.mk
index f092e89..8a11e2d 100644
--- a/third_party/third_party.mk
+++ b/third_party/third_party.mk
@@ -50,7 +50,10 @@ $(third_party_libuweave_obj_files) : out/$(BUILD_MODE)/%.o : %.c
###
# libgtest and libgmock (third_party, downloaded on build)
-third_party/include/gtest/gtest.h :
+third_party/lib/gtest.a: third_party/include/gtest/gtest.h
+third_party/lib/gmock.a: third_party/include/gtest/gtest.h
+
+third_party/include/gtest/gtest.h:
@echo Downloading and building libgtest and libgmock...
third_party/get_gtest.sh
@echo Finished downloading and building libgtest and libgmock.