blob: 81efebbff06a037333528f829808b0200ec2c9ba [file] [log] [blame]
Philippe Liardbee8be52011-07-06 12:15:51 +00001#! /bin/sh
2
3# Copyright (C) 2011 Google Inc.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# Author: Philippe Liard
18
19# Countinuous integration script that tests the different versions and
20# configurations of libphonenumber.
21
Philippe Liardb8acd0d2011-08-16 13:13:07 +000022# Check geocoding resource files encoding.
23(find resources/geocoding -type f | xargs file | egrep -v 'UTF-8|ASCII') && exit 1
24
Philippe Liardbee8be52011-07-06 12:15:51 +000025# Test the C++ version with the provided CMake parameter.
26test_cpp_version() {
27 CMAKE_FLAGS="$1"
28 (
29 rm -rf cpp/build && mkdir cpp/build && cd cpp/build && \
30 cmake "${CMAKE_FLAGS}" .. && make && ./libphonenumber_test
31 ) || exit $?
32}
33test_cpp_version ''
34test_cpp_version '-DUSE_RE2=ON'
35test_cpp_version '-DUSE_LITE_METADATA=ON'
36test_cpp_version '-DUSE_STD_MAP=ON'
37
38# Test Java version using Ant.
39(cd java && ant clean jar && ant junit) || exit $?
40
41# Test Java version using Maven.
42(cd java && mvn clean package) || exit $?
43
44# Test build tools.
45(cd tools/java && mvn clean package) || exit $?