From f8d02e30f24fb1a0c4c707bd4d7f996d93bf2c87 Mon Sep 17 00:00:00 2001 From: Ngie Cooper Date: Sun, 2 Apr 2017 13:03:06 -0700 Subject: [PATCH] Add necessary integration pieces for Travis CI - .travis.yml: provides the metadata for describing how the project should be built and tested. - travis/build.sh: builds the project. - travis/test.sh: tests the project. This commit adds support for the following matrix: - Ubuntu 16.04 LTS (xenial) x {clang,gcc} x {ext4} Support for OS X will be added once runtime issues with it have been resolved. Some administrative switches need to be flipped in order for this change to be made effective, but this has proven successful on my fork (yaneurabeya/pjdfstest). Capture client information for FreeBSD, Linux, and OS X FreeBSD isn't supported with Travis CI, but Linux definitely is, and OS X is partially supported. Fixes GitHub issue #12. --- .travis.yml | 15 +++++++++++++++ travis/build.sh | 6 ++++++ travis/test.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .travis.yml create mode 100755 travis/build.sh create mode 100755 travis/test.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..f2a4ccc5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: c +sudo: required + +matrix: + include: + - os: linux + compiler: clang + dist: xenial + - os: linux + compiler: gcc + dist: xenial + +script: + - ./travis/build.sh + - ./travis/test.sh diff --git a/travis/build.sh b/travis/build.sh new file mode 100755 index 00000000..e6be5bf1 --- /dev/null +++ b/travis/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +cd $(dirname $0)/.. +make diff --git a/travis/test.sh b/travis/test.sh new file mode 100755 index 00000000..ee9ddf9e --- /dev/null +++ b/travis/test.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -ex + +cd $(dirname $0)/.. + +df . +uname -a + +case "$(uname)" in +Darwin) + sw_vers -productVersion + mount + ;; +FreeBSD) + mount -p + ;; +Linux) + for release_file in /etc/lsb-release /etc/os-release; do + echo "$release_file.. ->" + cat $release_file + done + mount + ;; +esac + +sudo prove -rv .