]> git.saurik.com Git - apt.git/blame - test/libapt/run-tests.sh
merge from the debian-sid branch
[apt.git] / test / libapt / run-tests.sh
CommitLineData
e4a30974 1#!/bin/sh
e29a6bb1
DK
2set -e
3
e4a30974
DK
4echo "Compiling the tests ..."
5make
6echo "Running all testcases ..."
e29a6bb1
DK
7LDPATH=$(pwd)/../../build/bin
8EXT="_libapt_test"
9for testapp in $(ls ${LDPATH}/*$EXT)
e4a30974 10do
e29a6bb1
DK
11 name=$(basename ${testapp})
12 tmppath=""
13
14 if [ $name = "GetListOfFilesInDir${EXT}" ]; then
15 # TODO: very-low: move env creation to the actual test-app
16 echo "Prepare Testarea for \033[1;35m$name\033[0m ..."
17 tmppath=$(mktemp -d)
18 touch "${tmppath}/anormalfile" \
19 "${tmppath}/01yet-anothernormalfile" \
20 "${tmppath}/anormalapt.conf" \
21 "${tmppath}/01yet-anotherapt.conf" \
22 "${tmppath}/anormalapt.list" \
23 "${tmppath}/01yet-anotherapt.list" \
24 "${tmppath}/wrongextension.wron" \
25 "${tmppath}/wrong-extension.wron" \
26 "${tmppath}/strangefile." \
27 "${tmppath}/s.t.r.a.n.g.e.f.i.l.e" \
28 "${tmppath}/.hiddenfile" \
29 "${tmppath}/.hiddenfile.conf" \
30 "${tmppath}/.hiddenfile.list" \
31 "${tmppath}/multi..dot" \
32 "${tmppath}/multi.dot.conf" \
33 "${tmppath}/multi.dot.list" \
34 "${tmppath}/disabledfile.disabled" \
35 "${tmppath}/disabledfile.conf.disabled" \
36 "${tmppath}/disabledfile.list.disabled" \
37 "${tmppath}/invälid.conf" \
38 "${tmppath}/invalíd" \
39 "${tmppath}/01invalíd"
40 ln -s "${tmppath}/anormalfile" "${tmppath}/linkedfile.list"
41 ln -s "${tmppath}/non-existing-file" "${tmppath}/brokenlink.list"
3f2d77b5
DK
42 elif [ $name = "getLanguages${EXT}" ]; then
43 echo "Prepare Testarea for \033[1;35m$name\033[0m ..."
44 tmppath=$(mktemp -d)
45 touch "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-tr" \
46 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-pt" \
47 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-se~" \
48 "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-st.bak"
e29a6bb1
DK
49 fi
50
51 echo -n "Testing with \033[1;35m${name}\033[0m ... "
52 LD_LIBRARY_PATH=${LDPATH} ${testapp} ${tmppath} && echo "\033[1;32mOKAY\033[0m" || echo "\033[1;31mFAILED\033[0m"
53
54 if [ -n "$tmppath" -a -d "$tmppath" ]; then
55 echo "Cleanup Testarea after \033[1;35m$name\033[0m ..."
56 rm -rf "$tmppath"
57 fi
58
e4a30974 59done