File: TR_makeflow_040_sub_workflow_make.sh

package info (click to toggle)
cctools 1%3A7.14.5-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,956 kB
  • sloc: ansic: 114,614; python: 29,532; cpp: 20,313; sh: 13,675; perl: 4,056; xml: 3,688; makefile: 1,436
file content (68 lines) | stat: -rwxr-xr-x 1,274 bytes parent folder | download | duplicates (2)
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: