run-all-extension-tests revision 2ebfcf72203f94f579931a9cfe6658a65ca5027d
4e10d188042815c5285edf00ea96896b862e0863aurium#!/bin/bash
4e10d188042815c5285edf00ea96896b862e0863aurium
2ebfcf72203f94f579931a9cfe6658a65ca5027dauriumecho -e "\n##### Extension Tests #####"
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumcd "$(dirname "$0")"
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumhas_py_coverage=false
4e10d188042815c5285edf00ea96896b862e0863auriumpy_cover_files=$( mktemp )
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumif coverage.py -e >/dev/null 2>/dev/null; then
4e10d188042815c5285edf00ea96896b862e0863aurium has_py_coverage=true
4e10d188042815c5285edf00ea96896b862e0863aurium cover_py_cmd=coverage.py
4e10d188042815c5285edf00ea96896b862e0863auriumelse
4e10d188042815c5285edf00ea96896b862e0863aurium if coverage -e >/dev/null 2>/dev/null; then
4e10d188042815c5285edf00ea96896b862e0863aurium has_py_coverage=true
4e10d188042815c5285edf00ea96896b862e0863aurium cover_py_cmd=coverage
4e10d188042815c5285edf00ea96896b862e0863aurium fi
4e10d188042815c5285edf00ea96896b862e0863auriumfi
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863aurium#if $has_py_coverage; then
4e10d188042815c5285edf00ea96896b862e0863aurium# $cover_py_cmd -e
4e10d188042815c5285edf00ea96896b862e0863aurium#fi
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumfunction run_py_test() {
4e10d188042815c5285edf00ea96896b862e0863aurium echo -e "\n>> Testing $1"
4e10d188042815c5285edf00ea96896b862e0863aurium if $has_py_coverage; then
4e10d188042815c5285edf00ea96896b862e0863aurium $cover_py_cmd -x "$1.test.py"
4e10d188042815c5285edf00ea96896b862e0863aurium echo "../$1.py" >> $py_cover_files
4e10d188042815c5285edf00ea96896b862e0863aurium else
4e10d188042815c5285edf00ea96896b862e0863aurium python "$1.test.py"
4e10d188042815c5285edf00ea96896b862e0863aurium fi
4e10d188042815c5285edf00ea96896b862e0863aurium}
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumrun_py_test svgcalendar
4e10d188042815c5285edf00ea96896b862e0863auriumrun_py_test foldablebox
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumecho ""
4e10d188042815c5285edf00ea96896b862e0863auriumif $has_py_coverage; then
4e10d188042815c5285edf00ea96896b862e0863aurium cat $py_cover_files | xargs $cover_py_cmd -r
4e10d188042815c5285edf00ea96896b862e0863auriumfi
4e10d188042815c5285edf00ea96896b862e0863aurium
4e10d188042815c5285edf00ea96896b862e0863auriumrm $py_cover_files