mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-20 21:26:30 +00:00
Check if we truly pass the tests in auto test
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e3cb4d25e3
commit
63be797c2d
18
Makefile
18
Makefile
@ -26,12 +26,10 @@ BUILD_SYSCALL_TEST := 1
|
|||||||
CARGO_OSDK_ARGS += --kcmd_args="SYSCALL_TEST_DIR=$(SYSCALL_TEST_DIR)"
|
CARGO_OSDK_ARGS += --kcmd_args="SYSCALL_TEST_DIR=$(SYSCALL_TEST_DIR)"
|
||||||
CARGO_OSDK_ARGS += --kcmd_args="EXTRA_BLOCKLISTS_DIRS=$(EXTRA_BLOCKLISTS_DIRS)"
|
CARGO_OSDK_ARGS += --kcmd_args="EXTRA_BLOCKLISTS_DIRS=$(EXTRA_BLOCKLISTS_DIRS)"
|
||||||
CARGO_OSDK_ARGS += --init_args="/opt/syscall_test/run_syscall_test.sh"
|
CARGO_OSDK_ARGS += --init_args="/opt/syscall_test/run_syscall_test.sh"
|
||||||
endif
|
else ifeq ($(AUTO_TEST), regression)
|
||||||
ifeq ($(AUTO_TEST), regression)
|
|
||||||
CARGO_OSDK_ARGS += --init_args="/regression/run_regression_test.sh"
|
CARGO_OSDK_ARGS += --init_args="/regression/run_regression_test.sh"
|
||||||
endif
|
else ifeq ($(AUTO_TEST), boot)
|
||||||
ifeq ($(AUTO_TEST), boot)
|
CARGO_OSDK_ARGS += --init_args="/regression/boot_hello.sh"
|
||||||
CARGO_OSDK_ARGS += --init_args="-c exit 0"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(RELEASE_MODE), 1)
|
ifeq ($(RELEASE_MODE), 1)
|
||||||
@ -122,7 +120,7 @@ initramfs:
|
|||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: initramfs $(CARGO_OSDK)
|
build: initramfs $(CARGO_OSDK)
|
||||||
cargo osdk build $(CARGO_OSDK_ARGS)
|
@cargo osdk build $(CARGO_OSDK_ARGS)
|
||||||
|
|
||||||
.PHONY: tools
|
.PHONY: tools
|
||||||
tools:
|
tools:
|
||||||
@ -131,6 +129,14 @@ tools:
|
|||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: build
|
run: build
|
||||||
@cargo osdk run $(CARGO_OSDK_ARGS)
|
@cargo osdk run $(CARGO_OSDK_ARGS)
|
||||||
|
# Check the running status of auto tests from the QEMU log
|
||||||
|
ifeq ($(AUTO_TEST), syscall)
|
||||||
|
@tail --lines 100 qemu.log | grep -q "^.* of .* test cases passed." || (echo "Syscall test failed" && exit 1)
|
||||||
|
else ifeq ($(AUTO_TEST), regression)
|
||||||
|
@tail --lines 100 qemu.log | grep -q "^All regression tests passed." || (echo "Regression test failed" && exit 1)
|
||||||
|
else ifeq ($(AUTO_TEST), boot)
|
||||||
|
@tail --lines 100 qemu.log | grep -q "^Successfully booted." || (echo "Boot test failed" && exit 1)
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: gdb_server
|
.PHONY: gdb_server
|
||||||
gdb_server: build
|
gdb_server: build
|
||||||
|
7
regression/apps/scripts/boot_hello.sh
Normal file
7
regression/apps/scripts/boot_hello.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Successfully booted."
|
@ -10,3 +10,5 @@ cd ${SCRIPT_DIR}
|
|||||||
./shell_cmd.sh
|
./shell_cmd.sh
|
||||||
./process.sh
|
./process.sh
|
||||||
./network.sh
|
./network.sh
|
||||||
|
|
||||||
|
echo "All regression tests passed."
|
||||||
|
@ -65,10 +65,10 @@ for syscall_test in $(find $TEST_BIN_DIR/. -name \*_test) ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "$GREEN$PASSED_TESTS$NC of $GREEN$TESTS$NC test cases are passed."
|
echo -e "$GREEN$PASSED_TESTS$NC of $GREEN$TESTS$NC test cases passed."
|
||||||
[ $PASSED_TESTS -ne $TESTS ] && RESULT=1
|
[ $PASSED_TESTS -ne $TESTS ] && RESULT=1
|
||||||
if [ $TESTS != $PASSED_TESTS ]; then
|
if [ $TESTS != $PASSED_TESTS ]; then
|
||||||
echo -e "The $RED$(($TESTS-$PASSED_TESTS))$NC failed test cases in this run are as follows:"
|
echo -e "The $RED$(($TESTS-$PASSED_TESTS))$NC failed test cases are as follows:"
|
||||||
cat $FAIL_CASES
|
cat $FAIL_CASES
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user