summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2020-02-17 03:10:13 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2020-02-17 03:29:54 +0100
commit6b5887ef6a0000f8bc97487c847f37f8df32827b (patch)
tree4a4de25e1f648c20ddeeba5c18f48edfd6e4d121
parent2d6e5d91af58aa50a623c707c59072d3c89b9d69 (diff)
downloadlibgphoto2-6b5887ef6a0000f8bc97487c847f37f8df32827b.tar.gz
travis-ci: Move builds to separate script file
The handling of failing build steps has become too involved to put it into a single command line in a ".travis.yml". The new build script does a few things differently: * No sudo use. * Builds for and installs into separate root --prefix * Builds as out of tree builds per build The new things the new build script does: * Print config.log and the test-suite.log files if the configure or the "make check" stages have failed. * Print the version information, both short and verbose. * Print a list of the installed files. The things the new build script does NOT do: * Run "make clean" or "make uninstall" We are keeping the old script lines around for the time being. I cannot see a difference, but someone more familiar with "vusb" and "examples/sample-afl" might.
-rw-r--r--.travis-script.sh59
-rw-r--r--.travis.yml2
2 files changed, 61 insertions, 0 deletions
diff --git a/.travis-script.sh b/.travis-script.sh
new file mode 100644
index 000000000..c3a95daa8
--- /dev/null
+++ b/.travis-script.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+buildid="${1:?"need buildid"}"
+
+date
+ls -l configure
+
+shift
+
+properdir="$(pwd)"
+
+mkdir "_build-${buildid}"
+
+set -e
+set -x
+
+cd "_build-${buildid}"
+
+if ../configure --prefix="$(cd ".." && pwd)/_root-${buildid}" "$@"
+then
+ echo "Configure successful."
+else
+ s="$?"
+ echo "### BEGIN LOG: config.log ###"
+ cat config.log
+ echo "### END LOG: config.log ###"
+ exit "$?"
+fi
+
+make -j2
+
+if make check
+then
+ echo "\"make check\" successful."
+else
+ s="$?"
+ for log in libgphoto2_port/test/test-suite.log test/test-suite.log
+ do
+ echo "### BEGIN LOG: $log ###"
+ cat "$log"
+ echo "### END LOG: $log ###"
+ done
+ exit "$?"
+fi
+
+if test -f tests/print-libgphoto2-version
+then
+ tests/print-libgphoto2-version
+fi
+
+make install
+
+examples/sample-afl
+
+cd "$properdir"
+
+find "_root-${buildid}" -type f | sort
+
+# (cd "_build-${buildid}" && make uninstall clean)
diff --git a/.travis.yml b/.travis.yml
index 0de1c210c..7fbb1da55 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,6 +24,8 @@ compiler:
script:
- PATH=/usr/local/opt/gettext/bin:$PATH autoreconf -i -f && sleep 2
+ - sh .travis-script.sh standard-test --enable-vusb
+ - sh .travis-script.sh everything-test --enable-vusb --with-camlibs=everything
- date; ls -l configure
- ./configure --enable-vusb && make && if make check; then :; else cat libgphoto2_port/test/test-suite.log test/test-suite.log; false; fi && sudo PATH=$PATH make install && examples/sample-afl && make clean
- date; ls -l configure