move everything to 'old' directory before merge
This commit is contained in:
34
old/scripts/KiBoM/tests/common.bash
Normal file
34
old/scripts/KiBoM/tests/common.bash
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
# Common functions for running various tests
|
||||
|
||||
PASSED=0
|
||||
FAILED=0
|
||||
|
||||
# Results
|
||||
result() {
|
||||
echo "--- Results ---"
|
||||
echo "${PASSED}/$((PASSED+FAILED))"
|
||||
if (( FAILED == 0 )); then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Runs a command, increments test passed/failed
|
||||
# Args: Command
|
||||
cmd() {
|
||||
# Run command
|
||||
echo "CMD: $@"
|
||||
$@
|
||||
local RET=$?
|
||||
|
||||
# Check command
|
||||
if [[ ${RET} -ne 0 ]]; then
|
||||
((FAILED++))
|
||||
else
|
||||
((PASSED++))
|
||||
fi
|
||||
|
||||
return ${RET}
|
||||
}
|
21
old/scripts/KiBoM/tests/sanity.bash
Normal file
21
old/scripts/KiBoM/tests/sanity.bash
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Basic run-time sanity check for KiBoM
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Common functions
|
||||
source ${SCRIPT_DIR}/common.bash
|
||||
|
||||
# Start in kll top-level directory
|
||||
cd ${SCRIPT_DIR}/..
|
||||
|
||||
|
||||
## Tests
|
||||
|
||||
cmd ./KiBOM_CLI.py --help
|
||||
|
||||
## Tests complete
|
||||
|
||||
|
||||
result
|
||||
exit $?
|
Reference in New Issue
Block a user