diff --git a/.travis.yml b/.travis.yml index d8c27542b..106cd74a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,28 +32,35 @@ jobs: - DOCKER_IMG="focal" - DOCKER_SCRIPT="./tools/build_extra_tests" - os: linux - dist: xenial + dist: bionic + services: docker compiler: gcc env: - - BUILD_TYPE="local" - - QT_VERSION="5.9.9" # 5.12.1 vtesto stmsdf fails with valgrind 3.11.0 which is on xenial - addons: - apt: - packages: - - expat - - fop - - valgrind - - xsltproc - - libxml2-utils - - libusb-1.0-0-dev - - docbook-xml - - docbook-xsl - - libgl1-mesa-dev - - libxkbcommon-x11-0 # for qt onliner installer 3.2.1 - cache: - directories: - - $HOME/Cache - timeout: 600 + - BUILD_TYPE="docker" + - DOCKER_IMG="f32" + #- os: linux + # dist: xenial + # compiler: gcc + # env: + # - BUILD_TYPE="local" + # - QT_VERSION="5.9.9" # 5.12.1 vtesto stmsdf fails with valgrind 3.11.0 which is on xenial + # addons: + # apt: + # packages: + # - expat + # - fop + # - valgrind + # - xsltproc + # - libxml2-utils + # - libusb-1.0-0-dev + # - docbook-xml + # - docbook-xsl + # - libgl1-mesa-dev + # - libxkbcommon-x11-0 # for qt onliner installer 3.2.1 + # cache: + # directories: + # - $HOME/Cache + # timeout: 600 - os: osx compiler: clang env: diff --git a/test_encoding_latin1 b/test_encoding_latin1 index e2aa1c493..9f8c0fa36 100755 --- a/test_encoding_latin1 +++ b/test_encoding_latin1 @@ -13,104 +13,110 @@ errorcount=0 if locale -a | grep -q en_US.iso88591 ; then export LC_ALL=en_US.iso88591 + # check if QTextCodec::codecForLocale works + # It won't if Qt is using ICU and the ICU version is >= 61 + # https://bugs.launchpad.net/ubuntu/+source/qtbase-opensource-src/+bug/1874832 + if "$PNAME" -D1 2>&1 | grep -q 'mib 4' ; then + echo "Running latin1 file name encoding test" + filenamebase=test_encoding_file¢ + + # test input file name mangling with gpsbabel::File + echo "testing input file name with gpsbabel::File" + rm -f ${TMPDIR}/test_encoding_file* + cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/${filenamebase}.gpx + ${PNAME} -i gpx -f ${TMPDIR}/${filenamebase}.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { + echo "ERROR: The input file name was mangled." + errorcount=`expr $errorcount + 1` + } -echo "Running latin1 file name encoding test" -filenamebase=test_encoding_file¢ - -# test input file name mangling with gpsbabel::File - echo "testing input file name with gpsbabel::File" - rm -f ${TMPDIR}/test_encoding_file* - cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/${filenamebase}.gpx - ${PNAME} -i gpx -f ${TMPDIR}/${filenamebase}.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { - echo "ERROR: The input file name was mangled." - errorcount=`expr $errorcount + 1` - } - -# test output file name mangling with gpsbabel::File - echo "testing output file name with gpsbabel::File" - rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/${filenamebase}.kml - count=$(ls -1 -l ${TMPDIR}/${filenamebase}.kml 2>/dev/null | wc -l) - if [ $count -lt 1 ]; then - echo "ERROR: The output file name was mangled." - errorcount=`expr $errorcount + 1` - fi - -# test input file name mangling with gbfile stdapi - echo "testing input file name with gbfile stdapi" - rm -f ${TMPDIR}/test_encoding_file* - cp ${REFERENCE}/unicsv_subsec.csv ${TMPDIR}/${filenamebase}.csv - ${PNAME} -i unicsv -f ${TMPDIR}/${filenamebase}.csv -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { - echo "ERROR: The input file name was mangled." - errorcount=`expr $errorcount + 1` - } - -# test output file name mangling with gbfile stdapi - echo "testing output file name with gbfile stdapi" - rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/${filenamebase}.csv - count=$(ls -1 -l ${TMPDIR}/${filenamebase}.csv 2>/dev/null | wc -l) - if [ $count -lt 1 ]; then - echo "ERROR: The output file name was mangled." - errorcount=`expr $errorcount + 1` - fi - -# test input file name mangling with gbfile gzapi - echo "testing input file name with gbfile gzapi" - rm -f ${TMPDIR}/test_encoding_file* - cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/${filenamebase}.gtm.gz - ${PNAME} -i gtm -f ${TMPDIR}/${filenamebase}.gtm.gz -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { - echo "ERROR: The input file name was mangled." - errorcount=`expr $errorcount + 1` - } - -# test output file name mangling with gbfile gzapi - echo "testing output file name with gbfile gzapi" - rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o gtm -F ${TMPDIR}/${filenamebase}.gtm.gz - count=$(ls -1 -l ${TMPDIR}/${filenamebase}.gtm.gz 2>/dev/null | wc -l) - if [ $count -lt 1 ]; then - echo "ERROR: The output file name was mangled." - errorcount=`expr $errorcount + 1` - fi + # test output file name mangling with gpsbabel::File + echo "testing output file name with gpsbabel::File" + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/${filenamebase}.kml + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.kml 2>/dev/null | wc -l) + if [ $count -lt 1 ]; then + echo "ERROR: The output file name was mangled." + errorcount=`expr $errorcount + 1` + fi -# test input file name mangling with shape files - echo "testing input file name with shape files" - rm -f ${TMPDIR}/test_encoding_file* - for ext in cpg dbf prj shp shx - do - cp ${REFERENCE}/gis.osm_railways_free_1.${ext} ${TMPDIR}/${filenamebase}.${ext} - done - ${PNAME} -r -i shape -f ${TMPDIR}/${filenamebase}.shp -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { - echo "ERROR: The input file name was mangled." - errorcount=`expr $errorcount + 1` - } + # test input file name mangling with gbfile stdapi + echo "testing input file name with gbfile stdapi" + rm -f ${TMPDIR}/test_encoding_file* + cp ${REFERENCE}/unicsv_subsec.csv ${TMPDIR}/${filenamebase}.csv + ${PNAME} -i unicsv -f ${TMPDIR}/${filenamebase}.csv -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { + echo "ERROR: The input file name was mangled." + errorcount=`expr $errorcount + 1` + } -# test output file name mangling with shape files - echo "testing output file name with shape files" - rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -r -i gpx -f ${REFERENCE}/bounds-test.gpx -o shape -F ${TMPDIR}/${filenamebase}.shp - for ext in cpg dbf shp shx - do - count=$(ls -1 -l ${TMPDIR}/${filenamebase}.${ext} 2>/dev/null | wc -l) + # test output file name mangling with gbfile stdapi + echo "testing output file name with gbfile stdapi" + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/${filenamebase}.csv + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.csv 2>/dev/null | wc -l) if [ $count -lt 1 ]; then echo "ERROR: The output file name was mangled." errorcount=`expr $errorcount + 1` fi - done - rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -w -i gpx -f ${REFERENCE}/bounds-test.gpx -o shape -F ${TMPDIR}/${filenamebase}.shp - for ext in cpg dbf shp shx - do - count=$(ls -1 -l ${TMPDIR}/${filenamebase}.${ext} 2>/dev/null | wc -l) + + # test input file name mangling with gbfile gzapi + echo "testing input file name with gbfile gzapi" + rm -f ${TMPDIR}/test_encoding_file* + cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/${filenamebase}.gtm.gz + ${PNAME} -i gtm -f ${TMPDIR}/${filenamebase}.gtm.gz -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { + echo "ERROR: The input file name was mangled." + errorcount=`expr $errorcount + 1` + } + + # test output file name mangling with gbfile gzapi + echo "testing output file name with gbfile gzapi" + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o gtm -F ${TMPDIR}/${filenamebase}.gtm.gz + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.gtm.gz 2>/dev/null | wc -l) if [ $count -lt 1 ]; then echo "ERROR: The output file name was mangled." errorcount=`expr $errorcount + 1` fi - done - -# TODO: add tests to cover formats that use other open methods. + # test input file name mangling with shape files + echo "testing input file name with shape files" + rm -f ${TMPDIR}/test_encoding_file* + for ext in cpg dbf prj shp shx + do + cp ${REFERENCE}/gis.osm_railways_free_1.${ext} ${TMPDIR}/${filenamebase}.${ext} + done + ${PNAME} -r -i shape -f ${TMPDIR}/${filenamebase}.shp -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { + echo "ERROR: The input file name was mangled." + errorcount=`expr $errorcount + 1` + } + + # test output file name mangling with shape files + echo "testing output file name with shape files" + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -r -i gpx -f ${REFERENCE}/bounds-test.gpx -o shape -F ${TMPDIR}/${filenamebase}.shp + for ext in cpg dbf shp shx + do + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.${ext} 2>/dev/null | wc -l) + if [ $count -lt 1 ]; then + echo "ERROR: The output file name was mangled." + errorcount=`expr $errorcount + 1` + fi + done + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -w -i gpx -f ${REFERENCE}/bounds-test.gpx -o shape -F ${TMPDIR}/${filenamebase}.shp + for ext in cpg dbf shp shx + do + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.${ext} 2>/dev/null | wc -l) + if [ $count -lt 1 ]; then + echo "ERROR: The output file name was mangled." + errorcount=`expr $errorcount + 1` + fi + done + + # TODO: add tests to cover formats that use other open methods. + + else + echo "$0 cannot run, QTextCodec::codecForLocale not respecting LC_ALL" + fi else echo "$0 cannot run without the en_US.iso88591 locale." fi diff --git a/tools/Dockerfile_f32 b/tools/Dockerfile_f32 new file mode 100644 index 000000000..aefe405c7 --- /dev/null +++ b/tools/Dockerfile_f32 @@ -0,0 +1,23 @@ +# this file is used to build the image gpsbabel_build_environment used by travis. + +FROM fedora:32 + +LABEL maintainer="https://github.com/tsteven4" + +WORKDIR /app + +# basic tools to build +RUN dnf install --assumeyes git gperf make valgrind diffutils which findutils langpacks-en && \ + dnf clean all +# libraries used by gpsbabel. zlib and shapelib may or may not be used depending qmake options. +RUN dnf install --assumeyes libusb-devel zlib-devel shapelib-devel && \ + dnf clean all +# Qt used by gpsbabel, gpsbabelfe +RUN dnf install --assumeyes qt5-qtbase-devel qt5-qtwebengine-devel qt5-linguist qt5-qttranslations && \ + dnf clean all +# tools to build the docs +RUN dnf install --assumeyes expat desktop-file-utils libxslt docbook-style-xsl fop && \ + dnf clean all +# create a link as fedora uses the name qmake-qt5 for Qt5's qmake. +RUN alternatives --install /usr/bin/qmake qt /usr/lib64/qt5/bin/qmake 100 +