diff options
author | lanius <lanius> | 2003-09-03 21:24:48 +0000 |
---|---|---|
committer | lanius <lanius> | 2003-09-03 21:24:48 +0000 |
commit | bdb6e49586babb43eae371ebc7b895e3b9887dd6 (patch) | |
tree | 80fdad59da5d7bb412ee33b9fda2dfb3f46f7889 /menu/tests/menutest | |
parent | cd3f8b4a7987d23c9af7aa6a6b3e37b9ac2b2253 (diff) | |
download | xdg-specs-bdb6e49586babb43eae371ebc7b895e3b9887dd6.tar.xz |
more teeeeeests
Diffstat (limited to 'menu/tests/menutest')
-rwxr-xr-x | menu/tests/menutest | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/menu/tests/menutest b/menu/tests/menutest index da1319e..c5eb4aa 100755 --- a/menu/tests/menutest +++ b/menu/tests/menutest @@ -24,27 +24,21 @@ fi export MENUTESTDIR -TESTS=$* - if [ "x${TESTS}" == "x" ]; then - TESTS=$(eval echo "test-*[^~]") - if [ "x${TESTS}" == "xtest-*[^~]" ]; then - echo No tests found in ${PWD} - exit 1 - fi + TESTS=`ls tests` fi - for TEST in ${TESTS}; do + echo rm -rf ${MENUTESTDIR} 2> /dev/null mkdir ${MENUTESTDIR} - RESULT=$(echo ${TEST}|sed -e 's^test-^result-^') + RESULT=tests/${TEST}/result if [ ! -e ${RESULT} ]; then - echo 'Result file ('${RESULT}') for '${TEST}' missing' + echo '!!! Result file ('${RESULT}') for '${TEST}' missing' else ( - echo Running: ${TEST} + echo ">>> Running test ${TEST}" # Some predefined values XDG_CONFIG_HOME=${MENUTESTDIR}/xdg_config_home @@ -61,21 +55,21 @@ for TEST in ${TESTS}; do export XDG_CONFIG_DIRS export XDG_DATA_DIRS - . ${TEST} + . tests/${TEST}/test $MENUTEST > ${MENUTESTDIR}/result1 2> ${MENUTESTDIR}/log ./expand ${RESULT} > ${MENUTESTDIR}/result2 ) if diff -q ${MENUTESTDIR}/result1 ${MENUTESTDIR}/result2 > /dev/null; then - echo ${TEST}' OK' + echo '>>> OK' else sort ${MENUTESTDIR}/result1 > ${MENUTESTDIR}/result1.sorted sort ${MENUTESTDIR}/result2 > ${MENUTESTDIR}/result2.sorted if diff -u ${MENUTESTDIR}/result1.sorted ${MENUTESTDIR}/result2.sorted > ${MENUTESTDIR}/result.diff; then - echo ${TEST}' OK (different order)' + echo '>>> OK (different order)' else - echo ${TEST}' Failed' + echo '>>> Failed' cat ${MENUTESTDIR}/result.diff fi fi |