-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gdbstub test improvements: pytest fixtures, parametrization and expected pattern matching on outputs from GDB and the test application. Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
- Loading branch information
Showing
7 changed files
with
104 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
CONFIG_GDBSTUB=y | ||
CONFIG_GDBSTUB_SERIAL_BACKEND=y | ||
CONFIG_NO_OPTIMIZATIONS=y | ||
CONFIG_USERSPACE=y | ||
CONFIG_KOBJECT_TEXT_AREA=4096 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (c) 2023 intel Corporation. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
import pytest | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption('--gdb_timeout') | ||
parser.addoption('--gdb_script') | ||
|
||
@pytest.fixture() | ||
def gdb_script(request): | ||
return request.config.getoption('--gdb_script') | ||
|
||
@pytest.fixture() | ||
def gdb_timeout(request): | ||
return int(request.config.getoption('--gdb_timeout', default=60)) | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
set pagination off | ||
set trace-commands on | ||
set logging enabled on | ||
|
||
target remote :5678 | ||
|
||
b test | ||
b main.c:29 | ||
c | ||
|
||
# break at test() | ||
s | ||
set var a = 2 | ||
c | ||
|
||
# break at main() | ||
if ret == 6 | ||
printf "GDB:PASSED\n" | ||
quit 0 | ||
else | ||
printf "GDB:FAILED\n" | ||
quit 1 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# | ||
# Copyright (c) 2020 intel Corporation. | ||
# Copyright (c) 2020,2023 intel Corporation. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
tests: | ||
debug.gdbstub.sample: | ||
debug.gdbstub.breakpoints: | ||
platform_allow: qemu_x86 | ||
harness: pytest | ||
harness_config: | ||
pytest_root: | ||
- "pytest/test_gdbstub.py" | ||
pytest_args: ["--gdb_timeout", "20", "--gdb_script", "test_breakpoints.gdbinit"] | ||
tags: | ||
- debug | ||
- gdbstub | ||
- pytest |