commit - 33de5889e9067573cb46e089a1530129b609e4de
commit + 909825343bd0a4b5ad4580a687a43abf6989761a
blob - /dev/null
blob + 03bdd10d309befc1eb5d2126842bbe7b1339aac1 (mode 755)
--- /dev/null
+++ tests/exercise/flag/D.t
+#!/bin/sh
+
+set -e
+
+
+h=$PWD
+cd `dirname $0`
+wd=`basename $0`.wd
+trap "rmdir $wd" EXIT
+mkdir -p $wd
+
+$h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ <<EOF
+#!/bin/sh
+ # (sanity check base case)
+ # found as $wd/foo.tst
+ # called as $wd/foo.tst from outside $wd
+ exit 0
+EOF
+$h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ -D $wd <<EOF
+#!/bin/sh
+ # found as $wd/foo.tst
+ # called from inside $wd
+ test -f foo.tst
+EOF
+pth=`basename $wd`/foo.tst $h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ -D$wd/.. <<EOF
+#!/bin/sh
+ # found as `basename $wd`/foo.tst
+ # called as $wd/foo.tst from `dirname $wd`
+ test -f `basename $wd`/foo.tst
+EOF
+pth=foo.tst $h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ -C $wd -D.. <<EOF
+#!/bin/sh
+ # found as foo.tst
+ # called as $wd/foo.tst from `dirname $wd`
+ test -f `basename $wd`/foo.tst
+EOF
blob - /dev/null
blob + d00c4a03409760312ab0c4f6ab1e0c44096c9041 (mode 755)
--- /dev/null
+++ tests/exercise/env/EXERCISEDIR.t
+#!/bin/sh
+
+set -e
+
+
+h=$PWD
+cd `dirname $0`
+wd=`basename $0`.wd
+trap "rmdir $wd" EXIT
+mkdir -p $wd
+
+$h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ <<EOF
+#!/bin/sh
+ # (sanity check base case)
+ # found as $wd/foo.tst
+ # called as $wd/foo.tst from outside $wd
+ exit 0
+EOF
+
+env="EXERCISEDIR=$wd" \
+$h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ <<EOF
+#!/bin/sh
+ # found as $wd/foo.tst
+ # called from inside $wd
+ test -f foo.tst
+EOF
+
+env="EXERCISEDIR=$wd/.." \
+pth=`basename $wd`/foo.tst \
+$h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ <<EOF
+#!/bin/sh
+ # found as `basename $wd`/foo.tst
+ # called as $wd/foo.tst from `dirname $wd`
+ test -f `basename $wd`/foo.tst
+EOF
+
+env="EXERCISEDIR=.." \
+pth=foo.tst \
+$h/assert-exercise $wd/foo \
+ "run 1 ok 1 fail 0 error 0\n" \
+ '' \
+ -C $wd <<EOF
+#!/bin/sh
+ # found as foo.tst
+ # called as $wd/foo.tst from `dirname $wd`
+ test -f `basename $wd`/foo.tst
+EOF
blob - 39902fa1ebd9f8ff0801014f6a96b920af323606
blob + 663923e2c024331d2519d136e27dd878eafc9597
--- tests/helpers/assert-exercise
+++ tests/helpers/assert-exercise
# execute & compare
shift 3
unset EXERCISEDIR # clean environment
-$exe "$@" $pth 1>$out 2>$err
+env $env $exe "$@" $pth 1>$out 2>$err
test "$?" = "127" && exit 127
diff -u $experr $err >&2 && \
diff -u $expout $out >&2