1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#!/bin/sh
# Test recursive invocation of a makeflow.
# The top level makeflow creates a simple workflow, and then
# sends it to be executed completely at the worker side.
# Recursive makeflow requires that you have makeflow in your path.
export PATH=`pwd`/../../makeflow/src:$PATH
. ../../dttools/test/test_runner_common.sh
PORT_FILE="makeflow.port"
WORKER_LOG="worker.log"
STATUS_FILE="makeflow.status"
prepare()
{
clean
cat > input.txt <<EOF
hello
EOF
cat > toplevel.makeflow <<EOF
MAKEFLOW_INPUTS=input.txt
MAKEFLOW_OUTPUTS=out.actual
out.actual: input.txt
MAKEFLOW sublevel.makeflow
EOF
cat > sublevel.makeflow <<EOF
MAKEFLOW_INPUTS=input.txt
MAKEFLOW_OUTPUTS=out.actual
out.1: input.txt
cat input.txt > out.1
out.2:
echo world > out.2
out.actual: out.1 out.2
cat out.1 out.2 > out.actual
EOF
cat > out.expected <<EOF
hello
world
EOF
}
run()
{
../src/makeflow -Z "$PORT_FILE" toplevel.makeflow
require_identical_files out.actual out.expected
}
clean()
{
../src/makeflow -Z "$PORT_FILE" sublevel.makeflow -c
../src/makeflow -Z "$PORT_FILE" toplevel.makeflow -c
rm -f $MAKE_FILE $PORT_FILE $WORKER_LOG input.txt out.1 out.2 out.actual out.expected toplevel.makeflow sublevel.makeflow worker.log
}
dispatch "$@"
# vim: set noexpandtab tabstop=4:
|