From 1cfb9e24d95f2f4da0b28be90756cd2ed2768368 Mon Sep 17 00:00:00 2001 From: Gang Wei Date: Mon, 17 Oct 2016 15:11:10 +0800 Subject: [PATCH] Add travis ci support Add .travis.yml to support travis ci auto build & test. Remove the user input demands in the test/test_all.sh to avoid blocking the test in failure case. Add build status indicator in README.md. Track this change in ChangeLog. --- .travis.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ ChangeLog | 1 + README.md | 2 ++ test/test_all.sh | 4 ++-- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..dfce1522b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +language: cpp +compiler: + - gcc + +# This is a lie: we don't need sudo but this is required to get an +# Ubuntu image with a libc that isn't ancient, and with cmocka libs. +sudo: required +dist: trusty + +addons: + apt: + packages: + - autoconf-archive + - libcmocka0 + - libcmocka-dev + - openssl + - libssl-dev + - libcurl4-openssl-dev + +install: + - wget http://downloads.sourceforge.net/project/ibmswtpm2/ibmtpm532.tar + - mkdir ibmtpm532 && pushd ibmtpm532 && tar xzf ../ibmtpm532.tar && pushd ./src && make + - ./tpm_server & + - popd && popd + - git clone https://github.com/01org/TPM2.0-TSS.git + - pushd TPM2.0-TSS && ./bootstrap && CONFIG_SITE=./lib/default_config.site ./configure && make -j$(nproc) && sudo make install && popd + - sudo ldconfig /usr/local/lib + - resourcemgr -sim -tpmhost 127.0.0.1 & + +before_script: + - ./bootstrap + +script: + - mkdir ./build + - pushd ./build + - ../configure --enable-unit + - make -j$(nproc) + - make -j$(nproc) check + - sudo make install + - popd + - pushd ./test + - ./test_all.sh + - popd diff --git a/ChangeLog b/ChangeLog index 579adebab..f9cf1419a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Unreleased Added +* travis ci support. * Allow for unit tests to be enabled selectively. * tpm2_rc_decode tool: Decode TPM_RC error codes. * Android Make file diff --git a/README.md b/README.md index 17fa9fea3..efe8552ef 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/01org/tpm2.0-tools.svg?branch=master)](https://travis-ci.org/01org/tpm2.0-tools) + **This site contains the code for the TPM (Trusted Platform Module) 2.0 tools based on TPM2.0-TSS** Below is the name list of the implemented tools: diff --git a/test/test_all.sh b/test/test_all.sh index 777ea447f..7ea98bf84 100755 --- a/test/test_all.sh +++ b/test/test_all.sh @@ -47,9 +47,9 @@ $1 sleep 1 echo "$1 pass" >>test_all_pass.log else - echo -e "\033[31m $1 Fail, press any key to continue.... \033[0m" + echo -e "\033[31m $1 Fail \033[0m" echo "$1 fail" >>test_all_fail.log - read + sleep 1 fi }