Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
meta: test module renaming; More comments; Strip unneeded library loa…
Browse files Browse the repository at this point in the history
…ding

Signed-off-by: Camber Huang <[email protected]>
  • Loading branch information
CamberLoid committed Jun 7, 2022
1 parent 2940f3e commit 4d95aeb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion lib/tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
##lib/tests.sh: Basic functions of build-time package integrity check modules.
##lib/tests.sh: Functions for test modules.
##Part of AB3 integrated package test module
##@copyright GPL-2.0+

abtest_non-zero-handler() {
Expand Down
6 changes: 5 additions & 1 deletion proc/81-test_funcs.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
##proc/build_funcs: Loads the tests/ functions
##proc/81-test_funcs: Loads the tests/ functions
##Part of AB3 integrated package build-time test module
##@copyright GPL-2.0+

if bool $ABTEST_ENABLED; then
for i in "$AB/tests"/*.sh
do
. "$i"
done
else
abinfo "Build-time package integrity check is disabled. Skipping ..."
fi
9 changes: 2 additions & 7 deletions proc/82-test_probe.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash
##proc/81-test_probe.sh: TBF
##FIXME: is there a better name for this?
##proc/82-test_probe.sh: Determining test type
##Part of AB3 integrated package build-time test module
##@copyright GPL-2.0+

. "$AB/lib/tests.sh"

if bool $ABTEST_ENABLED; then
if [ -z "$ABTEST_TYPE"]; then
abinfo "No $ABTEST_TYPE set, automatically determining ..."
Expand All @@ -16,7 +14,4 @@ if bool $ABTEST_ENABLED; then
fi
done
fi
else
abinfo "Build-time package integrity check is disabled. Skipping ..."
fi

5 changes: 2 additions & 3 deletions proc/83-test_exec.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash
##proc/81-check.sh: TBF
##proc/83-test_exec.sh: Perform test
##Part of AB3 integrated package build-time test module
##@copyright GPL-2.0+

abtrylib tests || ablibret

if bool $ABTEST_ENABLED; then
cd "$SRCDIR"
# FIXME: use a non-zero handler?
Expand Down
5 changes: 3 additions & 2 deletions tests/00-self_file.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/bin/bash
##tests/00-self_file.sh: invoke testing function defined in `autobuild/test`
##Part of AB3 build-time package integrity check implementation.
##Part of AB3 integrated package build-time test module
##@copyright GPL-2.0+

##FIXME: implement unprivileged tests

abtrylib arch tests || ablibret

abtest_self_file_probe() {
[ -f "$(arch_trymore=1 arch_findfile test)" ]
}

abtest_self_file_test() {
. "$AB/lib/tests.sh"

abtest() {
abwarn "ABTEST_TYPE is set to self_file, but no abtest() found in autobuild{,/\$ARCH}/test"
Expand Down
4 changes: 3 additions & 1 deletion tests/01-self_files.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash
##tests/01-self_files.sh: invoke testing function defined in `autobuild/tests/T*.sh`
##Part of AB3 build-time package integrity check implementation.
##Part of AB3 integrated package build-time test module
##@copyright GPL-2.0+

##FIXME: implement unprivileged tests

abtrylib tests || ablibret

abtest_self_files_probe() {
Expand Down
4 changes: 2 additions & 2 deletions tests/99-notest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
##tests/99-notest.sh: Dummy file indicates that test is not available.
##Part of AB3 build-time package integrity check implementation.
##tests/99-notest.sh: Dummy file indicates that test is not available or skipped.
##Part of AB3 integrated package build-time test module
##@copyright GPL-2.0+

abtest_notest_probe() {
Expand Down

0 comments on commit 4d95aeb

Please sign in to comment.