aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/test.sh
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-02-09 12:31:46 -0500
committerGravatar GitHub <noreply@github.com>2018-02-09 12:31:46 -0500
commit633eb7bb8bbce2d31d682bf5255d9ef5a97a29c5 (patch)
treeca0d4beba983ba6250deefc37faa1649654ed6fb /Firestore/test.sh
parent274fe52bbf817ef9d35638effb4de08454acfc6d (diff)
Let Travis run for `CMake` test and `lint.sh` (#769)
* Fix nanopb (in cmake build) Look for binaries in the src dir (since that's where we build now.) This error would be masked if a previous build had completed prior to switching nanopb to build out of src. Also, don't patch the protoc path multiple times. This could be triggered by (eg) 'make && make clean && make'. * Add resource_path.{h,cc} to the cmake build * Fix signed/unsigned int comparison warnings * let Travis run for `CMake` test and `lint.sh` * Ensure FieldValue tag_ is initialized during cp/mv ctor. Otherwise, the assignment operator attempts to deallocate based on the (uninitialized) tag_ variable, posssibly leading to segfaults. * address change * fix trailing space * address change * moving Firestore checks closer together * Fix tests that throw exceptions. The (previous) tests checked to ensure that an abort() occurs, but if ABSL_HAVE_EXCEPTIONS is defined on non-macos (which is currently the default) then the assertions will throw a std::logic_error rather than abort()ing. On macos, an exception is thrown too, but the exception doesn't derrive from std::exception, so ASSERT_DEATH_* doesn't catch it (hence why ASSERT_DEATH_* actually works.) To resolve this, I've switched to ASSERT_ANY_THROW. * ./scripts/lint.sh * Move FieldValue::tag_ initializer to be in class. * check Travis ulimit * check travis limit * set make -j 200 instead of unlimited * use cpu core number instead of 200
Diffstat (limited to 'Firestore/test.sh')
-rwxr-xr-xFirestore/test.sh23
1 files changed, 22 insertions, 1 deletions
diff --git a/Firestore/test.sh b/Firestore/test.sh
index 7e26e3f..b211f46 100755
--- a/Firestore/test.sh
+++ b/Firestore/test.sh
@@ -38,6 +38,23 @@ test_iOS() {
| xcpretty
}
+test_CMake() {
+ echo "cpu core: $(sysctl -n hw.ncpu)"
+ echo "set cmake build" && \
+ mkdir build && \
+ cd build && \
+ cmake .. || \
+ exit 1
+
+ echo "initial cmake build" && \
+ make -j $(sysctl -n hw.ncpu) all || \
+ exit 2
+
+ echo "test Firestore cmake build" && \
+ cd Firestore && \
+ make test
+}
+
test_iOS; RESULT=$?
if [[ $RESULT == 65 ]]; then
echo "xcodebuild exited with 65, retrying"
@@ -46,4 +63,8 @@ if [[ $RESULT == 65 ]]; then
test_iOS; RESULT=$?
fi
-exit $RESULT
+if [ $RESULT != 0 ]; then exit $RESULT; fi
+
+test_CMake; RESULT=$?
+
+if [ $RESULT != 0 ]; then exit $RESULT; fi