From ca98c7e614c35c64cf717eaa95ebe9dafa5b02c1 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 16 Oct 2016 18:03:09 +0200 Subject: [PATCH] Update travis for autotools --- .travis.yml | 2 +- Makefile.am | 3 +++ configure.ac | 1 + travis/check-spelling.pl | 16 ++++++++-------- travis/clang-analyze.sh | 4 ++-- travis/debian-build.sh | 9 ++++++--- travis/run-tests.sh | 6 +++--- 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8a3de6f..f9744335 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ install: script: - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-safe-wrappers.sh - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-formatting.sh - - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC -e CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" ${BASENAME} make all mans -j ASAN=1 + - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"' - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST diff --git a/Makefile.am b/Makefile.am index 21f57e5b..57d5b019 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,8 @@ @CODE_COVERAGE_RULES@ +echo-version: + @echo "@I3_VERSION@" + bin_PROGRAMS = \ i3 \ i3bar/i3bar \ diff --git a/configure.ac b/configure.ac index 01b4d309..3c47c6b5 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,7 @@ AS_IF([test -d ${srcdir}/.git], I3_VERSION="$(cat ${srcdir}/I3_VERSION)" is_release="$(grep -q non-git ${srcdir}/I3_VERSION && echo no || echo yes)" ]) +AC_SUBST([I3_VERSION], [$I3_VERSION]) MAJOR_VERSION="$(echo ${VERSION} | cut -d '.' -f 1)" MINOR_VERSION="$(echo ${VERSION} | cut -d '.' -f 2)" PATCH_VERSION="$(echo ${VERSION} | cut -d '.' -f 3)" diff --git a/travis/check-spelling.pl b/travis/check-spelling.pl index 71feec31..6d070136 100755 --- a/travis/check-spelling.pl +++ b/travis/check-spelling.pl @@ -29,13 +29,13 @@ my $binary_spelling_exceptions = { 'betwen' => 1, # asan_flags.inc contains this spelling error. }; my @binaries = qw( - i3 - i3-config-wizard/i3-config-wizard - i3-dump-log/i3-dump-log - i3-input/i3-input - i3-msg/i3-msg - i3-nagbar/i3-nagbar - i3bar/i3bar + build/i3 + build/i3-config-wizard/i3-config-wizard + build/i3-dump-log/i3-dump-log + build/i3-input/i3-input + build/i3-msg/i3-msg + build/i3-nagbar/i3-nagbar + build/i3bar/i3bar ); for my $binary (@binaries) { check_spelling(slurp($binary), $binary_spelling_exceptions, sub { @@ -50,7 +50,7 @@ for my $binary (@binaries) { my $manpage_spelling_exceptions = { }; -for my $name (glob('man/*.1')) { +for my $name (glob('build/man/*.1')) { for my $line (split(/\n/, slurp($name))) { next if $line =~ /^\.\\\"/o; check_spelling($line, $manpage_spelling_exceptions, sub { diff --git a/travis/clang-analyze.sh b/travis/clang-analyze.sh index 05d54119..97c11fcc 100755 --- a/travis/clang-analyze.sh +++ b/travis/clang-analyze.sh @@ -3,7 +3,7 @@ set -e set -x -mkdir -p deb/DIST-clang +mkdir -p deb/DIST-clang/build tar xf *.tar.bz2 -C deb/DIST-clang --strip-components=1 -(cd deb/DIST-clang && scan-build -o ../CLANG --html-title="Analysis of i3 v$(git describe --tags)" make -j8) +(cd deb/DIST-clang/build && scan-build -o ../../CLANG ../configure && scan-build -o ../../CLANG --html-title="Analysis of i3 v$(git describe --tags)" make -j8) mv deb/CLANG/*/* deb/CLANG diff --git a/travis/debian-build.sh b/travis/debian-build.sh index 655bd5c4..9ce5a5af 100755 --- a/travis/debian-build.sh +++ b/travis/debian-build.sh @@ -5,12 +5,15 @@ set -x DEST=$1 -make store_git_version -make dist +mkdir -p build +cd build +../configure +make echo-version > ../I3_VERSION +make dist-bzip2 # unpack dist tarball mkdir -p "${DEST}" tar xf *.tar.bz2 -C "${DEST}" --strip-components=1 -cp -r debian "${DEST}" +cp -r ../debian "${DEST}" sed -i '/^\s*libxcb-xrm-dev/d' deb/ubuntu-*/DIST/debian/control || true cd "${DEST}" debchange -m -l+g$(git describe --tags) 'Automatically built' diff --git a/travis/run-tests.sh b/travis/run-tests.sh index d8a40d77..44df81d2 100755 --- a/travis/run-tests.sh +++ b/travis/run-tests.sh @@ -3,7 +3,7 @@ set -e set -x -cd testcases +cd build # TODO: remove this workaround once https://bugs.debian.org/836723 is fixed # Found at https://llvm.org/bugs/show_bug.cgi?id=27310#c8: @@ -26,7 +26,7 @@ fi # Try running the tests in parallel so that the common case (tests pass) is # quick, but fall back to running them in sequence to make debugging easier. -if ! xvfb-run ./complete-run.pl +if ! xvfb-run make check then - xvfb-run ./complete-run.pl --parallel=1 || (cat latest/complete-run.log; false) + xvfb-run ./testcases/complete-run.pl --parallel=1 || (cat latest/complete-run.log; false) fi -- 2.39.2