This repository was archived by the owner on Feb 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,13 @@ | ||
build_packages=${work_path}/dgr | ||
errcheck=0 | ||
|
||
pre-build() { | ||
[ -f ${work_path}/${target_name}/templater ] || ${work_path}/bin-templater/build.sh | ||
[ -f ${work_path}/${target_name}/bindata/aci-tester.aci ] || ${work_path}/aci-tester/build.sh | ||
[ -f ${work_path}/${target_name}/bindata/aci-builder.aci ] || ${work_path}/aci-builder/build.sh | ||
} | ||
|
||
execute_tests() { | ||
fdir=$1 | ||
[ -d "$fdir" ] || return 0 | ||
|
||
for file in $fdir/*; do | ||
filename=$(basename $file) | ||
[ "$filename" == "wait.sh" ] && continue | ||
[ -d "$file" ] && continue | ||
|
||
echo -e "\e[1m\e[32mRunning test file -> $filename\e[0m" | ||
bats -p $file | ||
done | ||
} | ||
|
||
test() { | ||
if [ "$(id -u)" != "0" ]; then | ||
echo "Sorry, you are not root." | ||
exit 1 | ||
fi | ||
|
||
|
||
#templater | ||
${work_path}/bin-templater/tests.sh | ||
|
||
#dgr | ||
command -v rkt >/dev/null 2>&1 || { echo >&2 "rkt not found in path"; exit 1; } | ||
command -v bats >/dev/null 2>&1 || { echo >&2 "bats not found in path"; exit 1; } | ||
export DGR_PATH="../${work_path}/${target_name}/$(targetBinaryPath ${osarchi})" | ||
cd "${work_path}/tests" | ||
execute_tests "." | ||
|
||
sudo DGR_PATH="../${work_path}/${target_name}/$(targetBinaryPath ${osarchi})" ${work_path}/tests/test.sh | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
if [ "$(id -u)" != "0" ]; then | ||
echo "Sorry, you are not root." | ||
exit 1 | ||
fi | ||
|
||
execute_tests() { | ||
fdir=$1 | ||
[ -d "$fdir" ] || return 0 | ||
|
||
for file in $fdir/*; do | ||
filename=$(basename $file) | ||
[ "$filename" == "wait.sh" ] && continue | ||
[ -d "$file" ] && continue | ||
[ "$filename" == "test.sh" ] && continue | ||
|
||
echo -e "\e[1m\e[32mRunning test file -> $filename\e[0m" | ||
bats -p $file | ||
done | ||
} | ||
|
||
#dgr | ||
command -v rkt >/dev/null 2>&1 || { echo >&2 "rkt not found in path"; exit 1; } | ||
command -v bats >/dev/null 2>&1 || { echo >&2 "bats not found in path"; exit 1; } | ||
dir=$( dirname $0 ) | ||
cd ${dir} | ||
execute_tests "." |