gnucash master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Sat Sep 2 10:18:51 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/c0f3147a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/28668ec5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1e7c721e (commit)
	from  https://github.com/Gnucash/gnucash/commit/098c1950 (commit)



commit c0f3147a3e9cb5dcc8088f5f6d4ae9bbd6b03c43
Merge: 098c195 28668ec
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Sep 2 16:18:23 2017 +0200

    Merge branch 'maint'
    
    Resolved conflicts:
            .travis.yml

diff --cc .travis.yml
index 15fe146,ee692a4..64e6636
--- a/.travis.yml
+++ b/.travis.yml
@@@ -13,40 -8,9 +13,14 @@@ env
    - BUILDTYPE=cmake-ninja
    - BUILDTYPE=autotools
  before_install:
 +#  - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
    - sudo apt-get update -qq
 +install:
 +#  - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.9; export CXX="g++-4.9" CC="gcc-4.9"; fi
    - sudo apt-get build-dep -qq gnucash
    - sudo apt-get install -qq swig xsltproc libdbd-sqlite3 cmake3 texinfo ninja-build
 +  - sudo apt-get install -qq libboost-all-dev libgtk-3-dev libwebkit2gtk-3.0-dev
    - sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
 +  - git clone https://github.com/google/googletest -b release-1.8.0 ~/gtest
- script: |
-   # The -e here says that if any line below fails, the whole script fails
-   set -ev
- 
-   # First, do the cmake build using the default Makefile generator
-   if [[ "$BUILDTYPE" == "cmake-make" ]]; then
-     mkdir /tmp/gnucash-build-cmake-make
-     cd /tmp/gnucash-build-cmake-make
-     GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock cmake $TRAVIS_BUILD_DIR
-     make -j 4
-     TZ="America/Los_Angeles" make check
- 
-   # Next, do cmake again, using the Ninja generator this time
-   elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
-     mkdir /tmp/gnucash-build-cmake-ninja
-     cd /tmp/gnucash-build-cmake-ninja
-     GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock cmake -G Ninja $TRAVIS_BUILD_DIR
-     ninja
-     TZ="America/Los_Angeles" ninja check
- 
-   # Finally, do the autotools build
-   elif [[ "$BUILDTYPE" == "autotools" ]]; then
-     cd $TRAVIS_BUILD_DIR
-     ./autogen.sh
-     ./configure --enable-python GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock
-     make
-     TZ="America/Los_Angeles" make check
-   fi
+ script: ./util/travis-script.sh
+ after_failure:  ./util/travis-after-failure.sh
diff --cc util/travis-script.sh
index 0000000,18dc80f..8e14edd
mode 000000,100755..100755
--- a/util/travis-script.sh
+++ b/util/travis-script.sh
@@@ -1,0 -1,30 +1,30 @@@
+ #! /bin/bash -ev
+ # The -e above says that if any line below fails, the whole script fails
+ 
+ # Run tests in different build configurations depending on the
+ # value of the BUILDTYPE environment variable
+ # 1. cmake build using the default Makefile generator
+ if [[ "$BUILDTYPE" == "cmake-make" ]]; then
+   mkdir /tmp/gnucash-build-cmake-make
+   cd /tmp/gnucash-build-cmake-make
 -  cmake $TRAVIS_BUILD_DIR
++  GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock cmake $TRAVIS_BUILD_DIR
+   make -j 4
 -  make check
++  TZ="America/Los_Angeles" make check
+ 
+ # 2. cmake build using the Ninja generator
+ elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
+   mkdir /tmp/gnucash-build-cmake-ninja
+   cd /tmp/gnucash-build-cmake-ninja
 -  cmake -G Ninja $TRAVIS_BUILD_DIR
++  GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock cmake -G Ninja $TRAVIS_BUILD_DIR
+   ninja
 -  ninja check
++  TZ="America/Los_Angeles" ninja check
+ 
+ # 3. autotools build
+ elif [[ "$BUILDTYPE" == "autotools" ]]; then
+   cd $TRAVIS_BUILD_DIR
+   ./autogen.sh
 -  ./configure
++  ./configure --enable-python GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock
+   make
 -  make check
++  TZ="America/Los_Angeles" make check
+ fi
+ 

commit 28668ec5947cc775dc5ce2f80c16ca0d0013a486
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Sep 2 16:03:46 2017 +0200

    Fix deliberate test failure on previous commit

diff --git a/src/import-export/test/test-import-parse.c b/src/import-export/test/test-import-parse.c
index cb30b47..e75cd44 100644
--- a/src/import-export/test/test-import-parse.c
+++ b/src/import-export/test/test-import-parse.c
@@ -52,7 +52,7 @@ my_ymd_t dates_ydm_vals[] = { {1999, 12, 31}, {2001, 6, 17}, {2001, 11, 23}, {0,
 const char* dates_mdy[] = { "1/16/2001", "12-31-1999", "01171983", NULL };
 my_ymd_t dates_mdy_vals[] = { {2001, 1, 16}, {1999, 12, 31}, {1983, 1, 17}, {0, 0, 0} };
 const char* dates_dmy[] = { "16/1/2001", "31-12-1999", "17011976", NULL };
-my_ymd_t dates_dmy_vals[] = { {2000, 1, 16}, {1999, 12, 31}, {1976, 1, 17}, {0, 0, 0} };
+my_ymd_t dates_dmy_vals[] = { {2001, 1, 16}, {1999, 12, 31}, {1976, 1, 17}, {0, 0, 0} };
 
 const char* dates_yxx[] = { "99/1/6", "1999-12'10", "20010306", NULL };
 const char* dates_xxy[] = { "1/3/99", "12-10'1999", "03062001", NULL };

commit 1e7c721e8d2f61d1b90c5400eb9bfe042544a960
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Sep 2 12:35:28 2017 +0200

    Have Travis print out build logs in case of test failures
    
    To get the after_failure line work, I had to move the inline
    build script to a separate script (util/travis-script.sh)
    
    The second script (util/travis-after-failure.sh) will output
    LastTest.log for cmake based builds and all files named
    test*.log for an autotools based build.
    
    Note: this commit also comes with a delibarate test failure
    to illustrate the Travis behaviour. It will be removed in the
    next commit.

diff --git a/.travis.yml b/.travis.yml
index cd1626a..ee692a4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,31 +12,5 @@ before_install:
   - sudo apt-get build-dep -qq gnucash
   - sudo apt-get install -qq swig xsltproc libdbd-sqlite3 cmake3 texinfo ninja-build
   - sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
-script: |
-  # The -e here says that if any line below fails, the whole script fails
-  set -ev
-
-  # First, do the cmake build using the default Makefile generator
-  if [[ "$BUILDTYPE" == "cmake-make" ]]; then
-    mkdir /tmp/gnucash-build-cmake-make
-    cd /tmp/gnucash-build-cmake-make
-    cmake $TRAVIS_BUILD_DIR
-    make -j 4
-    make check
-
-  # Next, do cmake again, using the Ninja generator this time
-  elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
-    mkdir /tmp/gnucash-build-cmake-ninja
-    cd /tmp/gnucash-build-cmake-ninja
-    cmake -G Ninja $TRAVIS_BUILD_DIR
-    ninja
-    ninja check
-
-  # Finally, do the autotools build
-  elif [[ "$BUILDTYPE" == "autotools" ]]; then
-    cd $TRAVIS_BUILD_DIR
-    ./autogen.sh
-    ./configure
-    make
-    make check
-  fi
+script: ./util/travis-script.sh
+after_failure:  ./util/travis-after-failure.sh
diff --git a/src/import-export/test/test-import-parse.c b/src/import-export/test/test-import-parse.c
index e75cd44..cb30b47 100644
--- a/src/import-export/test/test-import-parse.c
+++ b/src/import-export/test/test-import-parse.c
@@ -52,7 +52,7 @@ my_ymd_t dates_ydm_vals[] = { {1999, 12, 31}, {2001, 6, 17}, {2001, 11, 23}, {0,
 const char* dates_mdy[] = { "1/16/2001", "12-31-1999", "01171983", NULL };
 my_ymd_t dates_mdy_vals[] = { {2001, 1, 16}, {1999, 12, 31}, {1983, 1, 17}, {0, 0, 0} };
 const char* dates_dmy[] = { "16/1/2001", "31-12-1999", "17011976", NULL };
-my_ymd_t dates_dmy_vals[] = { {2001, 1, 16}, {1999, 12, 31}, {1976, 1, 17}, {0, 0, 0} };
+my_ymd_t dates_dmy_vals[] = { {2000, 1, 16}, {1999, 12, 31}, {1976, 1, 17}, {0, 0, 0} };
 
 const char* dates_yxx[] = { "99/1/6", "1999-12'10", "20010306", NULL };
 const char* dates_xxy[] = { "1/3/99", "12-10'1999", "03062001", NULL };
diff --git a/util/travis-after-failure.sh b/util/travis-after-failure.sh
new file mode 100755
index 0000000..64957de
--- /dev/null
+++ b/util/travis-after-failure.sh
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+# Build logs are located in different places depending on the build environment used
+if [[ "$BUILDTYPE" == "cmake-make" ]] || [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
+  echo "##### LastTest.log #####"
+  echo "#########################"
+  cat /tmp/gnucash-build-${BUILDTYPE}/Testing/Temporary/LastTest.log
+elif [[ "$BUILDTYPE" == "autotools" ]]; then
+  for logfile in $( find . -name 'test*.log' ); do
+    SIZE=$((${#logfile} + 12))
+    HRULE=$(head -c $SIZE < /dev/zero | tr '\0' '#')
+    echo $HRULE
+    echo "##### ${logfile} #####"
+    echo $HRULE
+    cat -- "$logfile"
+    echo -e "\n\n"
+  done
+fi
+
diff --git a/util/travis-script.sh b/util/travis-script.sh
new file mode 100755
index 0000000..18dc80f
--- /dev/null
+++ b/util/travis-script.sh
@@ -0,0 +1,30 @@
+#! /bin/bash -ev
+# The -e above says that if any line below fails, the whole script fails
+
+# Run tests in different build configurations depending on the
+# value of the BUILDTYPE environment variable
+# 1. cmake build using the default Makefile generator
+if [[ "$BUILDTYPE" == "cmake-make" ]]; then
+  mkdir /tmp/gnucash-build-cmake-make
+  cd /tmp/gnucash-build-cmake-make
+  cmake $TRAVIS_BUILD_DIR
+  make -j 4
+  make check
+
+# 2. cmake build using the Ninja generator
+elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
+  mkdir /tmp/gnucash-build-cmake-ninja
+  cd /tmp/gnucash-build-cmake-ninja
+  cmake -G Ninja $TRAVIS_BUILD_DIR
+  ninja
+  ninja check
+
+# 3. autotools build
+elif [[ "$BUILDTYPE" == "autotools" ]]; then
+  cd $TRAVIS_BUILD_DIR
+  ./autogen.sh
+  ./configure
+  make
+  make check
+fi
+



Summary of changes:
 .travis.yml                  | 30 ++----------------------------
 util/travis-after-failure.sh | 19 +++++++++++++++++++
 util/travis-script.sh        | 30 ++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 28 deletions(-)
 create mode 100755 util/travis-after-failure.sh
 create mode 100755 util/travis-script.sh



More information about the gnucash-changes mailing list