aboutsummaryrefslogtreecommitdiff
path: root/tools/run_tests/tests.sh
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2016-02-18 20:10:23 -0800
committerJosh Haberman <jhaberman@gmail.com>2016-03-02 14:51:09 -0800
commit738393b2c0690bcb92a6689f3a07d518289c4dde (patch)
tree309cc3883e29a59f37b2e66ca2934794e9935820 /tools/run_tests/tests.sh
parentd33e93b83367ea4dfabeed9cda03bc06a1ff0f6a (diff)
downloadprotobuf-738393b2c0690bcb92a6689f3a07d518289c4dde.tar.gz
protobuf-738393b2c0690bcb92a6689f3a07d518289c4dde.tar.bz2
protobuf-738393b2c0690bcb92a6689f3a07d518289c4dde.zip
Try running multiple tests in a row.
Diffstat (limited to 'tools/run_tests/tests.sh')
-rwxr-xr-x[-rw-r--r--]tools/run_tests/tests.sh49
1 files changed, 47 insertions, 2 deletions
diff --git a/tools/run_tests/tests.sh b/tools/run_tests/tests.sh
index a6ba1405..718d6de9 100644..100755
--- a/tools/run_tests/tests.sh
+++ b/tools/run_tests/tests.sh
@@ -1,9 +1,13 @@
-# This file is not intended to be executed directly. It is intended to be
-# included in a larger shell script.
+#!/bin/bash
# For when some other test needs the C++ main build, including protoc and
# libprotobuf.
internal_build_cpp() {
+ if [ -f src/protoc ]; then
+ # Already built.
+ return
+ fi
+
if [[ $(uname -s) == "Linux" && "$TRAVIS" == "true" ]]; then
# Install GCC 4.8 to replace the default GCC 4.6. We need 4.8 for more
# decent C++ 11 support in order to compile conformance tests.
@@ -277,3 +281,44 @@ build_javascript() {
cd js && npm install && npm test && cd ..
}
+[ -n "${PARALLELISM}" ] && PARALLELISM=-j8
+
+# Note: travis currently does not support testing more than one language so the
+# .travis.yml cheats and claims to only be cpp. If they add multiple language
+# support, this should probably get updated to install steps and/or
+# rvm/gemfile/jdk/etc. entries rather than manually doing the work.
+
+# .travis.yml uses matrix.exclude to block the cases where app-get can't be
+# use to install things.
+
+# -------- main --------
+
+# Set value used in tests.sh.
+PARALLELISM=-j2
+
+if [ "$#" -ne 1 ]; then
+ echo "
+Usage: $0 { cpp |
+ csharp |
+ java_jdk6 |
+ java_jdk7 |
+ java_oracle7 |
+ javanano_jdk6 |
+ javanano_jdk7 |
+ javanano_oracle7 |
+ objectivec_ios |
+ objectivec_osx |
+ python |
+ python_cpp |
+ ruby_19 |
+ ruby_20 |
+ ruby_21 |
+ ruby_22 |
+ jruby }
+"
+ exit 1
+fi
+
+set -e # exit immediately on error
+set -x # display all commands
+eval "build_$1"