From e3b75ebb143ae4826b63e7b6396435e207e8693c Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Sun, 13 Nov 2016 08:07:52 +0100 Subject: [PATCH 1/4] Print STL exceptions' what() when thrown from test This improves on the previous logic of just printing a generic statement that an unexpected exception was caught. --- include/BALL/CONCEPT/classTest.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/BALL/CONCEPT/classTest.h b/include/BALL/CONCEPT/classTest.h index 00d361624d..d803ed5229 100644 --- a/include/BALL/CONCEPT/classTest.h +++ b/include/BALL/CONCEPT/classTest.h @@ -297,6 +297,22 @@ int main(int argc, char **argv)\ std::cout << " (message is: " << e.getMessage() << ")" << std::endl;\ }\ }\ + catch (std::exception& e)\ + {\ + TEST::this_test = false;\ + TEST::test = false;\ + TEST::all_tests = false;\ + if ((TEST::verbose > 1) || (!TEST::this_test && (TEST::verbose > 0)))\ + {\ + if (!TEST::newline) \ + {\ + TEST::newline = true;\ + std::cout << std::endl;\ + }\ + std::cout << " (caught STL exception!)" << std::endl;\ + std::cout << " (what(): " << e.what() << ")" << std::endl;\ + }\ + }\ catch (...)\ {\ TEST::this_test = false;\ From a0e990262607b05ee1c7bd1a136376044b0b4be9 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Sun, 13 Nov 2016 10:12:17 +0100 Subject: [PATCH 2/4] latex: use nonstopmode during build In case of errors, latex by default prompts the user and blocks on stdin. This is unsuitable for automatic building in a makefile. With nonstopmode, latex will exit with an error code if something goes wrong, but still output enough information to figure out why. --- cmake/BALLDoc.cmake | 6 +++--- doc/tools/makedoc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/BALLDoc.cmake b/cmake/BALLDoc.cmake index 4b98a0ada9..1fe12c7d6c 100644 --- a/cmake/BALLDoc.cmake +++ b/cmake/BALLDoc.cmake @@ -111,11 +111,11 @@ IF (LATEX_COMPILER AND DVIPS_CONVERTER) COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" COMMAND ${CMAKE_COMMAND} -E echo "Creating BALL pdf tutorial" COMMAND ${CMAKE_COMMAND} -E echo "" - COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${PDFLATEX_COMPILER} tutorial.tex + COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${PDFLATEX_COMPILER} -interaction=nonstopmode tutorial.tex COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${BIBTEX_COMPILER} tutorial COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${MAKEINDEX_COMPILER} tutorial.idx - COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${PDFLATEX_COMPILER} tutorial.tex - COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${PDFLATEX_COMPILER} tutorial.tex + COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${PDFLATEX_COMPILER} -interaction=nonstopmode tutorial.tex + COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/ ${PDFLATEX_COMPILER} -interaction=nonstopmode tutorial.tex COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/tutorial.pdf doc/tutorial.pdf COMMAND ${CMAKE_COMMAND} -E echo "" COMMAND ${CMAKE_COMMAND} -E echo "The BALL tutorial in PDF format has been successfully created:" diff --git a/doc/tools/makedoc b/doc/tools/makedoc index e468259542..a79801a00d 100755 --- a/doc/tools/makedoc +++ b/doc/tools/makedoc @@ -128,8 +128,8 @@ build_tex_docu () $DOCPP_PATH $DOCPP_TEX_OPTIONS $BALL_PATH/doc/tex/BALL.tex $BALL_PATH/include/BALL/BALL.doc\ && cd $BALL_PATH/doc/tex/\ - && latex BALL\ - && latex BALL\ + && latex -interaction=nonstopmode BALL\ + && latex -interaction=nonstopmode BALL\ && dvipdf BALL.dvi\ && mv BALL.pdf .. } From f0a819a55d2d473e197234851d7a29bea7920368 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Sun, 13 Nov 2016 08:16:07 +0100 Subject: [PATCH 3/4] PoseClustering_test: Deserialize from old archive Trying to read the new v13 archive on boost-1.55 (which is the highest in Ubuntu 14.04 official repositories, and otherwise supported) resulted in 'unsupported version' error. Since boost::serialization is backwards-compatible, the newer versions can still read the old file. This commit effectively restores the serialized file as it was at 9fa1e6d44dec2ff836321d7058ff6363dc574a58 --- source/TEST/data/PoseClustering_wardtree.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/TEST/data/PoseClustering_wardtree.dat b/source/TEST/data/PoseClustering_wardtree.dat index 064a09eb22..bac55923d9 100644 --- a/source/TEST/data/PoseClustering_wardtree.dat +++ b/source/TEST/data/PoseClustering_wardtree.dat @@ -1 +1 @@ -22 serialization::archive 13 0 0 15 14 0 0 1 0 0 1 0.000000000e+00 1 0 1 1 0.000000000e+00 1 0 2 1 0.000000000e+00 1 0 3 1 0.000000000e+00 1 0 4 1 0.000000000e+00 1 0 5 1 0.000000000e+00 1 0 6 1 0.000000000e+00 1 0 7 1 0.000000000e+00 0 0 2 2.930124538e-05 0 0 3 1.017511487e+00 0 0 4 2.349177122e+00 0 0 2 9.453108311e-01 0 0 2 1.095688367e-05 0 0 4 5.062472916e+01 0 0 8 5.839497375e+01 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14 +22 serialization::archive 10 0 0 15 14 0 0 1 0 0 1 0 1 0 1 1 0 1 0 2 1 0 1 0 3 1 0 1 0 4 1 0 1 0 5 1 0 1 0 6 1 0 1 0 7 1 0 0 0 2 2.9301245e-05 0 0 3 1.0175115 0 0 4 2.3491771 0 0 2 0.94531083 0 0 2 1.0956884e-05 0 0 4 50.624729 0 0 8 58.394974 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14 From 4eb8aed59633e7b1d5f27ddd84dc7a96b31120d0 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Sat, 12 Nov 2016 21:57:32 +0100 Subject: [PATCH 4/4] Add a .travis.yml file for Ubuntu building This adds a travis-ci configuration file, enabling automatic CI building, well integrated with GitHub. All required library dependencies are pulled from the official Ubuntu repositories, using the 14.04 "trusty" distribution. Note that this currently builds without QT_WEBENGINE support, because it is not (yet) available in Ubuntu or Debian. Travis' ccache integration is enabled to reduce build times as much as possible. --- .travis.yml | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..a18b9bafd1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,110 @@ +language: cpp + +# Activate ccache. +# This setting adjusts PATH automatically, so CMake will use it. +cache: ccache + +# Precise is too old for Qt5 applications, so request a trusty image. +dist: trusty + +# While sudo commands are not used during the build, not all packages +# are yet (2016/11) on the whitelist for container-based trusty images. +# +# Once all packages listed below are on the whitelist, consider +# changing this to "false" for speedups. +sudo: required + +# Install dependencies using the addons.apt.packages syntax. +# This syntax will also work for container-based images, as soon as all +# packages are on the whitelist. +# +# The dependency list is mainly inspired by the Debian packaging of ball. +addons: + apt: + packages: + - build-essential + - debhelper + - dh-python + - cmake + - flex + - bison + - python-dev + - python-sip-dev + - libfftw3-dev + - libeigen3-dev + - libgsl0-dev + - libxrender-dev + - libxmu-dev + - libglew-dev + - libx11-dev + - tidy + - chrpath + - qtbase5-dev + - qttools5-dev + - qttools5-dev-tools + - libqt5opengl5-dev + # Remove boost 1.54 + - libboost-all-dev- + # And install 1.55 instead + - libboost1.55-all-dev + # Also enable building the docs + - doxygen + - graphviz + - ghostscript + - texlive-latex-base + - texlive-latex-recommended + - texlive-latex-extra + # latex-xcolor is only *recommended* by + # texlive-latex-recommended and thus must be + # installed explicitly. + - latex-xcolor + # Same for texlive-fonts-recommended + - texlive-fonts-recommended + +# Dependency installation and compilation step. +# +# If this fails, the build will be marked as 'errored'. +install: + # set ball data path while we're at the source + # toplevel directory. The unit tests will later + # need this variable. + - export BALL_DATA_PATH=$(pwd)/data + # create build/ folder + - mkdir build + - cd build + # Configure the software with CMake + # + # TODO: QtWebEngine is not yet packaged in Debian/Ubuntu, + # so we cannot build using it. Change this flag once + # it is packaged. + # + # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832420 + - cmake .. -DUSE_QTWEBENGINE=OFF + # Now build all the targets, including installation, which pulls + # in the tool binaries. + - make -j2 BALL VIEW BALLView doc_dot doc_tutorial build_tests + install DESTDIR=/tmp/target/ + +# Execute the unittests as the main job. +# +# If this fails, the build will be marked as 'failed'. +script: + - ctest --output-on-failure + +# Show ccache effectiveness after running the unittests +after_script: + - ccache -s + +# If the build succeeded, pack up the generated files +# and print the total size. +# +# In the future, this could be uploaded somewhereâ„¢ to +# act as a reference compile and speed up binary bisecting. +after_success: + - REVISION=$(git rev-parse --short HEAD) + - tar --create --auto-compress --owner root --group root + --file /tmp/ball-$REVISION.tar.bz2 + --directory /tmp/target ./ + # Replace this ls by an upload, once a destination + # is available. + - ls -lh /tmp/ball-$REVISION.tar.bz2