#!/bin/bash # # Usage: # ./run.sh set -o nounset set -o pipefail set -o errexit export CLANG_DIR=~/install/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04 all-tests() { local target=${1:-test} # or asantest make clean make allyesconfig #make mkdir -p _tmp local ts=$(date '+%Y-%m-%d__%H-%M-%S') local out="_tmp/${target}-${ts}.log" echo echo "Running toybox tests..." echo # Show diffs on failures time make VERBOSE=1 $target >$out 2>&1 || true echo "Wrote $out" } all-asan() { all-tests asantest } all-msan() { all-tests msantest } all-ubsan() { all-tests ubsantest } which-failed() { local log=$1 grep '^Some' $log } cp-setup() { echo src > file1 echo dest > file2 } test-cp() { cp-setup ./toybox cp file1 file2 head file* cp-setup ./toybox cp -i file1 file2 head file* cp-setup ./toybox cp -f file1 file2 head file* cp-setup ./toybox cp -n file1 file2 head file* } "$@"