This repository was archived by the owner on May 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +84
-21
lines changed
Expand file tree Collapse file tree 6 files changed +84
-21
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- # #tests/_base .sh: Basic functions of build-time package integrity check modules.
2+ # #lib/tests .sh: Basic functions of build-time package integrity check modules.
33# #@copyright GPL-2.0+
44
55abtest_non-zero-handler () {
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # #proc/81-test_probe.sh: TBF
3+ # #FIXME: is there a better name for this?
4+ # #@copyright GPL-2.0+
5+
6+ . " $AB /lib/tests.sh"
7+
8+ if bool $ABTEST_ENABLED ; then
9+ if [ -z " $ABTEST_TYPE " ]; then
10+ for i in $ABTEST_TESTPROBES ; do
11+ if abtest_${i} _probe; then
12+ ABTEST_TYPE=$i
13+ break
14+ fi
15+ done
16+ fi
17+ else
18+ abinfo " Build-time package integrity check is disabled. Skipping ..."
19+ fi
20+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # #proc/81-check.sh: TBF
3+ # #@copyright GPL-2.0+
4+
5+ abtrylib tests || ablibret
6+
7+ cd " $SRCDIR "
8+
9+ abtest_${ABTEST_TYPE} _test || \
10+ abwarn " Test exited with non-zero status: $? "
Original file line number Diff line number Diff line change 33# #Part of AB3 build-time package integrity check implementation.
44# #@copyright GPL-2.0+
55
6- . " $AB / tests" /_base.sh
6+ abtrylib arch tests || ablibret
77
8- abtest () {
9- abwarn " ABTEST_TYPE is set to self, but no abtest() found in autobuild{,/\$ ARCH}/test"
10- return 127
8+ abtest_self_file_probe () {
9+ [ -f " $( arch_trymore=1 arch_findfile test) " ]
1110}
1211
13- abtest_unprivileged () {
14- abwarn " ABTEST_TYPE is set to self, but no abtest_unprivileged() found in autobuild{,/\$ ARCH}/test"
15- return 127
16- }
12+ abtest_self_file_test () {
13+ . " $AB /lib/tests.sh"
14+
15+ abtest () {
16+ abwarn " ABTEST_TYPE is set to self, but no abtest() found in autobuild{,/\$ ARCH}/test"
17+ return 127
18+ }
19+
20+ abtest_unprivileged () {
21+ abwarn " ABTEST_TYPE is set to self, but no abtest_unprivileged() found in autobuild{,/\$ ARCH}/test"
22+ return 127
23+ }
1724
18- # Redefine
19- arch_loadfile " $SRCDIR " /test
25+ # Redefine
26+ arch_loadfile " $SRCDIR " /test
27+
28+ abtest || abtest_non-zero-handler $1 " $SRCDIR " /test
29+ abtest_unprivileged || abtest_unprivileged_non-zero-handler $1 " $SRCDIR " /test
30+ }
2031
21- abtest || abtest_non-zero-handler $1 " $SRCDIR " /test
22- abtest_unprivileged || abtest_unprivileged_non-zero-handler $1 " $SRCDIR " /test
32+ ABTEST_TESTPROBES+=' self_file'
Original file line number Diff line number Diff line change 33# #Part of AB3 build-time package integrity check implementation.
44# #@copyright GPL-2.0+
55
6- . " $AB / tests" /_base.sh
6+ abtrylib tests || ablibret
77
8- for i in " $SRCDIR " /tests/T* .sh
9- do
10- arch_loadfile $i
11- abtest || abtest_non-zero-handler $? $i
12- abtest_unprivileged || abtest_non-zero-handler $? $i
13- unset abtest abtest_unprivileged
14- done
8+ abtest_self_files_probe () {
9+ [ -d " $SRCDIR " /autobuild/tests ]
10+ }
1511
12+ abtest_self_files_test () {
13+ . " $AB /lib/tests.sh"
14+
15+ for i in " $SRCDIR " /tests/T* .sh
16+ do
17+ arch_loadfile $i
18+ abtest || abtest_non-zero-handler $? $i
19+ abtest_unprivileged || abtest_non-zero-handler $? $i
20+ unset abtest abtest_unprivileged
21+ done
22+ }
23+
24+ ABTEST_TESTPROBES+=' self_files'
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # #tests/99-notest.sh: Dummy file indicates that test is not available.
3+ # #Part of AB3 build-time package integrity check implementation.
4+ # #@copyright GPL-2.0+
5+
6+ abtest_notest_probe () {
7+ true
8+ }
9+
10+ abtest_notest_test (){
11+ abinfo " ABTEST_TYPE is set to 'notest'. Skipping..."
12+ }
13+
14+ ABTEST_TESTPROBES+=' notest'
You can’t perform that action at this time.
0 commit comments