forked from ayehandsum/ayehandsum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathayecode-test
More file actions
44 lines (36 loc) · 959 Bytes
/
Copy pathayecode-test
File metadata and controls
44 lines (36 loc) · 959 Bytes
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
SELF="$(readlink -f "$0")"
# TODO: Let scripts decide if they're running in source environment
shift 1
encoder=${1}
decoder=${2}
echo Testing with encoder=${encoder}
echo Testing with decoder=${decoder}
eval $( cat | tee \
>( source ${encoder} "${algo}" |\
source ${decoder} "${algo}" |\
sed 's/^/tempvar1=/1'
)\
>( ${algo} |\
cut -d' ' -f1 |\
sed 's/^/tempvar2=/1'
)\
>/dev/null
)
if [ "${tempvar1}" = "${tempvar2}" ]
then
echo "AYETOYSUM:TEST:SUCCESS:t1=t2=${tempvar1}"
else
echo "AYETOYSUM:TEST:FAILED:t1:${tempvar1}:t2:${tempvar2}"
fi
# TODO: Enable the following sections for verbose results
# TODO: Enable better verbose debugging
if [ "${AYEVERBOSE}" = "AYEAYE" ]
then
(
echo options $@
echo algo ${algo}
echo terms ${terms}
echo sysmbols ${symbols}
echo iter ${iter}
) | sed 's/.*/AYETOYSUM:DEBUG:&/g' >/dev/stderr
fi