This repository was archived by the owner on May 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed
Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # #tests/00-self_file.sh: invoke testing function defined in `autobuild/test`
3+ # #Part of AB3 build-time package integrity check implementation.
4+ # #@copyright GPL-2.0+
5+
6+ . " $AB /tests" /_base.sh
7+
8+ abtest () {
9+ abwarn " ABTEST_TYPE is set to self, but no abtest() found in autobuild{,/\$ ARCH}/test"
10+ return 127
11+ }
12+
13+ abtest_unprivileged () {
14+ abwarn " ABTEST_TYPE is set to self, but no abtest_unprivileged() found in autobuild{,/\$ ARCH}/test"
15+ return 127
16+ }
17+
18+ # Redefine
19+ arch_loadfile " $SRCDIR " /test
20+
21+ abtest || abtest_non-zero-handler $1 " $SRCDIR " /test
22+ abtest_unprivileged || abtest_unprivileged_non-zero-handler $1 " $SRCDIR " /test
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # #tests/01-self_files.sh: invoke testing function defined in `autobuild/tests/T*.sh`
3+ # #Part of AB3 build-time package integrity check implementation.
4+ # #@copyright GPL-2.0+
5+
6+ . " $AB /tests" /_base.sh
7+
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
15+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # #tests/_base.sh: Basic functions of build-time package integrity check modules.
3+ # #@copyright GPL-2.0+
4+
5+ abtest_non-zero-handler () {
6+ case $1 in
7+ 0) return 0;;
8+ 127) abwarn " No abtest() available in file ${2} " ;;
9+ * ) abwarn " Non-zero returned: ${1} !" ;;
10+ esac
11+ }
12+
13+ abtest_unprivileged_non-zero-handler () {
14+ case $1 in
15+ 127) abwarn " No abtest_unprivileged() available in file ${2} " ;;
16+ * ) abtest_non-zero-handler $1 $2 ;;
17+ esac
18+ }
You can’t perform that action at this time.
0 commit comments