From 31520717d3701c98ca80d77e3f8a60e9bc6abf04 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 7 Jul 2016 17:17:30 -0700 Subject: [PATCH] Include parser tests in the test-all.sh script. Move test-all.sh to the top level directory, and also run the parser tests from this script. Use a release build of cton-util to run the parser tests. As we accumulate many tests in the tests directory tree, this will mean they can still be run quickly. Point Travis config to the new test script. --- .travis.yml | 2 +- cranelift/src/test-all.sh | 12 ------------ cranelift/test-all.sh | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 13 deletions(-) delete mode 100755 cranelift/src/test-all.sh create mode 100755 cranelift/test-all.sh diff --git a/.travis.yml b/.travis.yml index 041073c206..1e6f291c4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ rust: - stable - beta - nightly -script: src/test-all.sh +script: test-all.sh diff --git a/cranelift/src/test-all.sh b/cranelift/src/test-all.sh deleted file mode 100755 index c0d9977ed1..0000000000 --- a/cranelift/src/test-all.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Exit immediately on errors. -set -e - -# Run from the src/tools directory which includes all our crates. -cd $(dirname "$0")/tools - -PKGS="-p cretonne -p cretonne-reader -p cretonne-tools" -cargo build $PKGS -cargo doc $PKGS -cargo test $PKGS diff --git a/cranelift/test-all.sh b/cranelift/test-all.sh new file mode 100755 index 0000000000..502966e55d --- /dev/null +++ b/cranelift/test-all.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# This is the top-level test script: +# +# - Build documentation for Rust code in 'src/tools/target/doc'. +# - Run unit tests for all Rust crates. +# - Make a debug build of all crates. +# - Make a release build of cton-util. +# - Run file-level tests with the release build of cton-util. +# +# All tests run by this script should be passing at all times. + +# Exit immediately on errors. +set -e + +# Repository top-level directory. +cd $(dirname "$0") +topdir=$(pwd) + +# Run cargo from the src/tools directory which includes all our crates for +# building cton-util. +cd "$topdir/src/tools" +PKGS="-p cretonne -p cretonne-reader -p cretonne-tools" +echo ====== Rust unit tests and debug build ====== +cargo test $PKGS +cargo build $PKGS +cargo doc + +echo ====== Rust release build ====== +cargo build --release + +export CTONUTIL="$topdir/src/tools/target/release/cton-util" + +# Run the parser tests. +echo ====== Parser tests ====== +cd "$topdir/tests" +parser/run.sh + +echo ====== OK ======