[LTP] [PATCH v3 0/4] Shell test library v3

Cyril Hrubis
2024-08-27T12:04:13Z

Changes in v4:

- Added fix for MUSL build failures (new patch)
(as reported by Peter Vorel)

- Fixes requested by Ritchie

- Constified the first tst_run_shell() parameter

- Added GP_JSON_ATTR_IDX() macro so that we can make sure
the order is not broken when parsing JSON environment metadata

- Changed tst_run_shell() to tst_run_script()

- Changed the format of the metadata comment and added support
for documentation support, now it looks like:

# ---
# doc
#
# [Description]
#
# Test description ...
# ---
#
# ---
# env
#
# {
# "some_key": "some_value"
# ...
# }
# ---

Cyril Hrubis (4):
include: tst_clone.h: Fix possible MUSL build failures
Add support for mixing C and shell code
libs: Vendor ujson library
testcaes/lib: Add shell loader

include/old/test.h | 1 -
include/tst_clone.h | 2 +
include/tst_test.h | 39 +-
include/ujson.h | 13 +
include/ujson_common.h | 69 ++
include/ujson_reader.h | 543 +++++++++
include/ujson_utf.h | 168 +++
include/ujson_writer.h | 224 ++++
lib/tst_test.c | 51 +
libs/ujson/Makefile | 12 +
libs/ujson/ujson_common.c | 38 +
libs/ujson/ujson_reader.c | 1081 +++++++++++++++++
libs/ujson/ujson_utf.c | 105 ++
libs/ujson/ujson_writer.c | 491 ++++++++
testcases/kernel/syscalls/clone/clone02.c | 1 +
testcases/lib/.gitignore | 2 +
testcases/lib/Makefile | 8 +-
testcases/lib/run_tests.sh | 32 +
testcases/lib/tests/.gitignore | 6 +
testcases/lib/tests/Makefile | 11 +
testcases/lib/tests/shell_loader.sh | 26 +
.../lib/tests/shell_loader_all_filesystems.sh | 27 +
.../lib/tests/shell_loader_filesystems.sh | 33 +
.../lib/tests/shell_loader_invalid_block.sh | 26 +
.../tests/shell_loader_invalid_metadata.sh | 15 +
testcases/lib/tests/shell_loader_kconfigs.sh | 12 +
.../lib/tests/shell_loader_no_metadata.sh | 8 +
.../lib/tests/shell_loader_supported_archs.sh | 12 +
testcases/lib/tests/shell_loader_tags.sh | 15 +
testcases/lib/tests/shell_loader_tcnt.sh | 15 +
.../lib/tests/shell_loader_wrong_metadata.sh | 15 +
testcases/lib/tests/shell_test01.c | 17 +
testcases/lib/tests/shell_test02.c | 18 +
testcases/lib/tests/shell_test03.c | 25 +
testcases/lib/tests/shell_test04.c | 18 +
testcases/lib/tests/shell_test05.c | 27 +
testcases/lib/tests/shell_test06.c | 16 +
testcases/lib/tests/shell_test_brk.sh | 6 +
testcases/lib/tests/shell_test_check_argv.sh | 23 +
testcases/lib/tests/shell_test_checkpoint.sh | 7 +
testcases/lib/tests/shell_test_pass.sh | 6 +
testcases/lib/tst_env.sh | 25 +
testcases/lib/tst_loader.sh | 11 +
testcases/lib/tst_res_.c | 58 +
testcases/lib/tst_run_shell.c | 491 ++++++++
45 files changed, 3845 insertions(+), 4 deletions(-)
create mode 100644 include/ujson.h
create mode 100644 include/ujson_common.h
create mode 100644 include/ujson_reader.h
create mode 100644 include/ujson_utf.h
create mode 100644 include/ujson_writer.h
create mode 100644 libs/ujson/Makefile
create mode 100644 libs/ujson/ujson_common.c
create mode 100644 libs/ujson/ujson_reader.c
create mode 100644 libs/ujson/ujson_utf.c
create mode 100644 libs/ujson/ujson_writer.c
create mode 100755 testcases/lib/run_tests.sh
create mode 100644 testcases/lib/tests/.gitignore
create mode 100644 testcases/lib/tests/Makefile
create mode 100755 testcases/lib/tests/shell_loader.sh
create mode 100755 testcases/lib/tests/shell_loader_all_filesystems.sh
create mode 100755 testcases/lib/tests/shell_loader_filesystems.sh
create mode 100755 testcases/lib/tests/shell_loader_invalid_block.sh
create mode 100755 testcases/lib/tests/shell_loader_invalid_metadata.sh
create mode 100755 testcases/lib/tests/shell_loader_kconfigs.sh
create mode 100755 testcases/lib/tests/shell_loader_no_metadata.sh
create mode 100755 testcases/lib/tests/shell_loader_supported_archs.sh
create mode 100755 testcases/lib/tests/shell_loader_tags.sh
create mode 100755 testcases/lib/tests/shell_loader_tcnt.sh
create mode 100755 testcases/lib/tests/shell_loader_wrong_metadata.sh
create mode 100644 testcases/lib/tests/shell_test01.c
create mode 100644 testcases/lib/tests/shell_test02.c
create mode 100644 testcases/lib/tests/shell_test03.c
create mode 100644 testcases/lib/tests/shell_test04.c
create mode 100644 testcases/lib/tests/shell_test05.c
create mode 100644 testcases/lib/tests/shell_test06.c
create mode 100755 testcases/lib/tests/shell_test_brk.sh
create mode 100755 testcases/lib/tests/shell_test_check_argv.sh
create mode 100755 testcases/lib/tests/shell_test_checkpoint.sh
create mode 100755 testcases/lib/tests/shell_test_pass.sh
create mode 100644 testcases/lib/tst_env.sh
create mode 100644 testcases/lib/tst_loader.sh
create mode 100644 testcases/lib/tst_res_.c
create mode 100644 testcases/lib/tst_run_shell.c

--
2.44.2