12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #!/bin/bash
-
- . /usr/share/beakerlib/beakerlib.sh
-
- . <(ffoom init)
- ffoo import ini
-
- enum_tests() {
- echo "both_keys_and_sections"
- echo "games_with_spaces"
- echo "keys_only"
- echo "keys_sections_spaces"
- echo "merge"
- echo "merge_strict"
- echo "path"
- echo "plain"
- echo "plain_strict"
- echo "sections_only"
- echo "tricks_with_strange_naming"
- echo "strict_and_space"
- echo "strict_and_tab"
- # echo "list_keys" # not implemented
- # echo "list_paths" # not implemented
- # echo "list_sections" # not implemented
- }
-
- do_test() {
- local name=$1
- local head=$(cat "$name" | head -1 | sed -e 's/\s*#\s*/#/g')
- local desc=$(cut -d\# -f 2 <<<"$head")
- local args=$(cut -d\# -f 3 <<<"$head")
- local env=$(cat $name.env 2>/dev/null)
- rlPhaseStartTest "$desc"
- rlRun "$env iniread $args - < $name > $name.result"
- rlRun "diff -u $name.oracle $name.result"
- rlPhaseEnd
- }
-
-
- rlJournalStart
-
- rlPhaseStartSetup
- tmp=$(mktemp -d)
- cp -r $(dirname $0)/data/ini/iniread/* $tmp
- pushd $tmp
- rlPhaseEnd
-
- for name in $(enum_tests);
- do
- do_test $name
- done
-
- rlPhaseStartCleanup
- popd
- rm -rf $tmp
- rlPhaseEnd
-
- rlJournalEnd
|