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

Commit 0d10b8b

Browse files
committed
tests: bugfix for previous commits
- tests/*: fix wrong usage of arch_loadfile - procs: - New script 81-test_funcs.sh to load functions in "$AB"/tests/* - rename previous scripts and minor bugfix - ab3_defcfg.sh: minor bugfix Signed-off-by: Camber Huang <camber@aosc.io>
1 parent d7c7313 commit 0d10b8b

File tree

7 files changed

+22
-14
lines changed

7 files changed

+22
-14
lines changed

etc/autobuild/ab3_defcfg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,6 @@ abassigngroup() {
170170
ABHOST_GROUP="$(abassigngroup $ABHOST)"
171171

172172
# Default configurations for ab3 package integrity check module.
173-
[ ! -v $ABTEST_ENABLED ] || ABTEST_ENABLED=0 # Disabled during current development cycle
173+
[ -v $ABTEST_ENABLED ] || ABTEST_ENABLED=0 # Disabled during current development cycle
174174

175175
unset -f abdetectarch abassigngroup

proc/81-test_funcs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
##proc/build_funcs: Loads the tests/ functions
3+
##@copyright GPL-2.0+
4+
for i in "$AB/tests"/*.sh
5+
do
6+
. "$i"
7+
done

proc/82-test_exec.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

proc/81-test_probe.sh renamed to proc/82-test_probe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if bool $ABTEST_ENABLED; then
99
if [ -z "$ABTEST_TYPE"]; then
1010
for i in $ABTEST_TESTPROBES; do
1111
if abtest_${i}_probe; then
12-
ABTEST_TYPE=$i
12+
export ABTEST_TYPE=$i
1313
break
1414
fi
1515
done

proc/83-test_exec.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
##proc/81-check.sh: TBF
3+
##@copyright GPL-2.0+
4+
5+
abtrylib tests || ablibret
6+
7+
if bool $ABTEST_ENABLED; then
8+
cd "$SRCDIR"
9+
abtest_${ABTEST_TYPE}_test || \
10+
abwarn "Test exited with non-zero status: $?"
11+
fi

tests/00-self_file.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abtest_self_file_test() {
2323
}
2424

2525
# Redefine
26-
arch_loadfile "$SRCDIR"/test
26+
arch_loadfile test
2727

2828
abtest || abtest_non-zero-handler $1 "$SRCDIR"/test
2929
abtest_unprivileged || abtest_unprivileged_non-zero-handler $1 "$SRCDIR"/test

tests/01-self_files.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abtest_self_files_probe() {
1212
abtest_self_files_test() {
1313
. "$AB/lib/tests.sh"
1414

15-
for i in "$SRCDIR"/tests/T*.sh
15+
for i in "$SRCDIR"/autobuild/tests/T*.sh
1616
do
1717
arch_loadfile $i
1818
abtest || abtest_non-zero-handler $? $i

0 commit comments

Comments
 (0)