summaryrefslogtreecommitdiffstats
path: root/menu/tests/tet_menutest
blob: 1aae67e12b56f12028a6b8dd5753c7e9da2140df (plain)
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
#!/bin/bash
TET_RUN="asdf"
export MENUTESTDIR="${MENUTESTDIR:-/tmp/menutest}"
. menutest
# hack, figure out the var to use here

tpstart() {
	tet_infoline "$*"
	FAIL=N
}

tet_startup=''
tet_cleanup=''
declare -i count=1
iclist=''
echo $TESTS
for TESTCASE in ${TESTS}; do
	[ ! -e "tests/${TESTCASE}/test" ] && continue;
	# this basically curries the arg to run_test.
	eval "tp${count}() {
		. tests/${TESTCASE}/test
		tpstart \"$(. tests/${TESTCASE}/test; echo ${TEST_PURPOSE-none stated})\";
		if ! run_test tests/\"$TESTCASE\"; then
			tet_result FAIL;
		else
			tet_result PASS;
		fi
		set +x
	}";
	iclist="${iclist} ic${count}"
	eval "ic${count}=tp${count}"
	# force subshelling, so that it doesn't pull a die on us
	((count+=1))
done
tet_iclist=iclist
. /opt/lsb-tet3-lite/lib/posix_sh/tcm.sh
tet_outputline 100 "xdg menu test"
tet_tcm_main $tet_iclist