From bee8be5e85a8999dec7068209017abb584a967ec Mon Sep 17 00:00:00 2001 From: Philippe Liard Date: Wed, 6 Jul 2011 12:15:51 +0000 Subject: [PATCH] TOOLS: Add continuous integration script. --- tools/script/continuous-integration.sh | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 tools/script/continuous-integration.sh diff --git a/tools/script/continuous-integration.sh b/tools/script/continuous-integration.sh new file mode 100755 index 000000000..2413c3233 --- /dev/null +++ b/tools/script/continuous-integration.sh @@ -0,0 +1,42 @@ +#! /bin/sh + +# Copyright (C) 2011 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Author: Philippe Liard + +# Countinuous integration script that tests the different versions and +# configurations of libphonenumber. + +# Test the C++ version with the provided CMake parameter. +test_cpp_version() { + CMAKE_FLAGS="$1" + ( + rm -rf cpp/build && mkdir cpp/build && cd cpp/build && \ + cmake "${CMAKE_FLAGS}" .. && make && ./libphonenumber_test + ) || exit $? +} +test_cpp_version '' +test_cpp_version '-DUSE_RE2=ON' +test_cpp_version '-DUSE_LITE_METADATA=ON' +test_cpp_version '-DUSE_STD_MAP=ON' + +# Test Java version using Ant. +(cd java && ant clean jar && ant junit) || exit $? + +# Test Java version using Maven. +(cd java && mvn clean package) || exit $? + +# Test build tools. +(cd tools/java && mvn clean package) || exit $?