]>
git.saurik.com Git - apt.git/blob - test/libapt/run-tests
4 DIR
=$(readlink -f $(dirname $0))
5 echo "Compiling the tests …"
7 echo "Running all testcases …"
8 LDPATH
="$DIR/../../build/bin"
11 # detect if output is on a terminal (colorful) or better not
12 if expr match
"$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev
/null
; then
15 TESTOKAY
='\033[1;32mOKAY\033[0m'
16 TESTFAIL
='\033[1;31mFAILED\033[0m'
21 TESTFAIL
='###FAILED###'
24 for testapp
in $(ls ${LDPATH}/*$EXT)
26 name
=$(basename ${testapp})
27 NAME
="${COLHIGH}${name}${COLRESET}"
30 if [ $name = "GetListOfFilesInDir${EXT}" ]; then
31 # TODO: very-low: move env creation to the actual test-app
33 touch "${tmppath}/anormalfile" \
34 "${tmppath}/01yet-anothernormalfile" \
35 "${tmppath}/anormalapt.conf" \
36 "${tmppath}/01yet-anotherapt.conf" \
37 "${tmppath}/anormalapt.list" \
38 "${tmppath}/01yet-anotherapt.list" \
39 "${tmppath}/wrongextension.wron" \
40 "${tmppath}/wrong-extension.wron" \
41 "${tmppath}/strangefile." \
42 "${tmppath}/s.t.r.a.n.g.e.f.i.l.e" \
43 "${tmppath}/.hiddenfile" \
44 "${tmppath}/.hiddenfile.conf" \
45 "${tmppath}/.hiddenfile.list" \
46 "${tmppath}/multi..dot" \
47 "${tmppath}/multi.dot.conf" \
48 "${tmppath}/multi.dot.list" \
49 "${tmppath}/disabledfile.disabled" \
50 "${tmppath}/disabledfile.conf.disabled" \
51 "${tmppath}/disabledfile.list.disabled" \
52 "${tmppath}/invälid.conf" \
53 "${tmppath}/invalíd" \
54 "${tmppath}/01invalíd"
55 mkdir "${tmppath}/invaliddir" \
56 "${tmppath}/directory.conf" \
57 "${tmppath}/directory.list" \
58 "${tmppath}/directory.wron" \
59 "${tmppath}/directory.list.disabled"
60 ln -s "${tmppath}/anormalfile" "${tmppath}/linkedfile.list"
61 ln -s "${tmppath}/non-existing-file" "${tmppath}/brokenlink.list"
62 elif [ $name = "getLanguages${EXT}" ]; then
64 touch "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-tr" \
65 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-pt" \
66 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-se~" \
67 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-st.bak" \
68 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-ast_DE"
69 elif [ $name = "HashSums${EXT}" ]; then
72 echo -n "Testing with \033[1;35m${name}\033[0m ... "
73 LD_LIBRARY_PATH
=${LDPATH} ${testapp} $TMP $(md5sum $TMP | cut -d' ' -f 1) $(sha1sum $TMP | cut -d' ' -f 1) $(sha256sum $TMP | cut -d' ' -f 1) $(sha512sum $TMP | cut -d' ' -f 1) && echo "\033[1;32mOKAY\033[0m" || echo "\033[1;31mFAILED\033[0m"
76 elif [ $name = "CompareVersion${EXT}" ]; then
77 tmppath
="${DIR}/versions.lst"
80 echo -n "Testing with ${NAME} "
81 LD_LIBRARY_PATH
=${LDPATH} ${testapp} ${tmppath} && echo "$TESTOKAY" || echo "$TESTFAIL"
83 if [ -n "$tmppath" -a -d "$tmppath" ]; then