From d44e1e268c5da846455d3f73f94a283e80340b6c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 6 Jul 2019 17:38:10 +0200 Subject: [PATCH] Travis: add testing of JSON output against schema and upgrade everything to Python3 --- travis/before_install.sh | 5 +++-- travis/csa/before_install.sh | 3 ++- travis/install.sh | 6 ++++++ travis/linux_clang/before_install.sh | 3 ++- travis/linux_gcc/before_install.sh | 7 ++++--- travis/linux_gcc7/before_install.sh | 2 ++ travis/mingw32/before_install.sh | 5 +++-- travis/osx/before_install.sh | 6 +++--- travis/osx/install.sh | 2 ++ 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/travis/before_install.sh b/travis/before_install.sh index 59b5be9ffb..a577a7ce73 100755 --- a/travis/before_install.sh +++ b/travis/before_install.sh @@ -4,5 +4,6 @@ # "global" before_install script. # Configure Python pip -pip install --user --upgrade pip -pip config --user set global.progress_bar off +pip3 install --user --upgrade pip +pip3 config --user set global.progress_bar off +pip3 install --user jsonschema diff --git a/travis/csa/before_install.sh b/travis/csa/before_install.sh index d93d8bec8f..58446f650c 100755 --- a/travis/csa/before_install.sh +++ b/travis/csa/before_install.sh @@ -1,10 +1,11 @@ #!/bin/bash set -e +sudo apt-get update -qq +sudo apt-get install -qq python3-pip ./travis/before_install.sh -sudo apt-get update -qq sudo apt-get install -qq sqlite3 libsqlite3-dev wget http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz diff --git a/travis/install.sh b/travis/install.sh index d0bc37434c..bc6100da47 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -51,6 +51,12 @@ fi make check make install find /tmp/proj_autoconf_install_from_dist_all + +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo EPSG:32631 -o JSON -q > out.json +cat out.json +echo "Validating JSON" +jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/crsjson.schema.json && echo "Valid !" + cd .. # cmake build from generated tarball diff --git a/travis/linux_clang/before_install.sh b/travis/linux_clang/before_install.sh index bd5447101f..167bc66749 100755 --- a/travis/linux_clang/before_install.sh +++ b/travis/linux_clang/before_install.sh @@ -1,8 +1,9 @@ #!/bin/bash set -e +sudo apt-get update -qq +sudo apt-get install -qq python3-pip ./travis/before_install.sh -sudo apt-get update -qq sudo apt-get install -qq sqlite3 libsqlite3-dev \ No newline at end of file diff --git a/travis/linux_gcc/before_install.sh b/travis/linux_gcc/before_install.sh index 4ac7c3b6e4..5564ff8ffc 100755 --- a/travis/linux_gcc/before_install.sh +++ b/travis/linux_gcc/before_install.sh @@ -1,10 +1,11 @@ #!/bin/bash set -e +sudo apt-get update -qq +sudo apt-get install -qq python3-pip ./travis/before_install.sh -sudo apt-get update -qq sudo apt-get install -y cppcheck sudo apt-get install -qq lcov sudo apt-get install -qq doxygen graphviz @@ -14,7 +15,7 @@ sudo apt-get install -qq openjdk-7-jdk scripts/cppcheck.sh scripts/doxygen.sh -pip install --user sphinxcontrib-bibtex -pip install --user cpp-coveralls +pip3 install --user sphinxcontrib-bibtex +pip3 install --user cpp-coveralls ./travis/docker.sh diff --git a/travis/linux_gcc7/before_install.sh b/travis/linux_gcc7/before_install.sh index 25c7483f3b..50fd4c3635 100755 --- a/travis/linux_gcc7/before_install.sh +++ b/travis/linux_gcc7/before_install.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +sudo apt-get update -qq +sudo apt-get install -qq python3-pip ./travis/before_install.sh diff --git a/travis/mingw32/before_install.sh b/travis/mingw32/before_install.sh index d2bbe3ec7d..d67d819491 100755 --- a/travis/mingw32/before_install.sh +++ b/travis/mingw32/before_install.sh @@ -1,10 +1,11 @@ #!/bin/bash set -e +sudo apt-get update -qq +sudo apt-get install -qq python3-pip ./travis/before_install.sh -sudo apt-get update -qq sudo apt-get install wget sudo apt-get install binutils-mingw-w64-x86-64 sudo apt-get install gcc-mingw-w64-x86-64 @@ -12,4 +13,4 @@ sudo apt-get install g++-mingw-w64-x86-64 sudo apt-get install g++-mingw-w64 sudo apt-get install mingw-w64-tools sudo apt-get install -y wine1.4-amd64 -sudo apt-get install sqlite3 \ No newline at end of file +sudo apt-get install sqlite3 diff --git a/travis/osx/before_install.sh b/travis/osx/before_install.sh index 964fbc67bc..55c0667a3a 100755 --- a/travis/osx/before_install.sh +++ b/travis/osx/before_install.sh @@ -2,6 +2,8 @@ set -e +export PATH=$HOME/Library/Python/3.6/bin:$PATH + ./travis/before_install.sh brew update @@ -10,8 +12,6 @@ brew install sqlite3 brew install doxygen brew install md5sha1sum -export PATH=$HOME/Library/Python/2.7/bin:$PATH -# breathe=4.12.0 is the last version to work for us with sphinx 1.8.5 / Python 2 -pip install --user sphinx sphinx-rtd-theme sphinxcontrib-bibtex breathe==4.12.0 +pip3 install --user sphinx sphinx-rtd-theme sphinxcontrib-bibtex breathe which sphinx-build (cd docs; make html) diff --git a/travis/osx/install.sh b/travis/osx/install.sh index 4869ee657f..ff5266f668 100755 --- a/travis/osx/install.sh +++ b/travis/osx/install.sh @@ -5,4 +5,6 @@ set -e export CCACHE_CPP2=yes export PROJ_DB_CACHE_DIR="$HOME/.ccache" +export PATH=$HOME/Library/Python/3.6/bin:$PATH + CC="ccache clang" CXX="ccache clang++" CFLAGS="-Werror -O2" CXXFLAGS="-Werror -O2" ./travis/install.sh