Files
rdlink/test/totest.sh
2022-03-18 21:48:39 +01:00

71 lines
1.2 KiB
Bash

#!/usr/bin/env bash
########## Competition Block ##########
# Each competition link is given to both tools
# and the output is compared
# [0] = Title
# [1] = path for competition
# [2] = path for competition
# ...
compete_links=( "Test - Valid links"
"/dev/stdin"
"$test_dir/tmp/a"*
"$test_dir/tmp/a 3"
"/bin/adb"
)
compete_all=( "Test - everything starting from /"
/**/*
)
tocompete_init() {
# TODO initialize custom test structure
# Add tests to global test array from test_rdlink
tocompete+=(
compete_links
)
}
tocompete_clean() {
# TODO clean custom test structure
echo "tocompete_clean"
}
tocompete_init
########## Assertion Block ##########
# Assertion string compare test
# [0] = Title
# [1] expected == [2] input
# [3] expected == [4] input
# ...
assert_string=( "Assert - invalid files"
"/opt/rdlink/test/a" "a"
"/opt/rdlink/test/b" "b"
"/opt/rdlink/test/c" "c"
)
toassert_init() {
# TODO initilaize custom test structure
# Add test arrays to global test array from test_rdlink
toassert+=(
assert_string
)
}
toassert_clean() {
# TODO clean
echo "toassert_clean"
}
totest_cleanall() {
echo
tocompete_clean
toassert_clean
}
trap totest_cleanall EXIT
toassert_init