run-all-extension-tests revision d4d3743f0388af16b07b640a8b145eee32f36f73
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# TODO: check for GNU mktemp and sed (from coreutils), else exit
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# ---------------------------------------------------------------------
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# solution below is based on
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# <http://www.ooblick.com/weblog/2011/05/12/a-couple-of-shell-quickies/>
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# Wrapper function for GNU mktemp
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# Wrapper function for BSD mktemp
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# Try to figure out which wrapper to use
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanisif mktemp -V | grep version >/dev/null 2>&1; then
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis#mytmpfile=`$MKTEMP`
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanisecho "MKTEMP to be used: $MKTEMP"
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# ---------------------------------------------------------------------
2ebfcf72203f94f579931a9cfe6658a65ca5027dauriumecho -e "\n##### Extension Tests #####"
4e10d188042815c5285edf00ea96896b862e0863aurium#if $has_py_coverage; then
4e10d188042815c5285edf00ea96896b862e0863aurium# $cover_py_cmd -e
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# TODO: check for GNU mktemp and sed (from coreutils), else exit
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# ---------------------------------------------------------------------
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# solution below is based on
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# <http://notmuchmail.org/pipermail/notmuch/2011/004579.html>
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanisif [ `sed --version >/dev/null 2>/dev/null && echo 1` ]; then
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis SED_EXTENDED='sed -r' # GNU sed (e.g. on Linux)
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis SED_EXTENDED='sed -E' # BSD sed (e.g. on Mac OS X)
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanisecho "sed regex command: $SED_EXTENDED"
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis# ---------------------------------------------------------------------
d4d3743f0388af16b07b640a8b145eee32f36f73Alex Valavanis if ! run_py_test $( echo $testFile | $SED_EXTENDED 's/^([^.]+)..*$/\1/' ); then
83aaf46c9feab529aeb9add871c05c3d1177afccaurium echo -e "\n>> Coverage Report:"
4b20bf95123c697a0635b14433d183b02d8b8781aurium echo -e "\nFailed $( cat $failed_tests | wc -l ) of $( ls -1 *.test.py | wc -l ) extension tests:"