public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/9] metadata: improvements
@ 2024-01-04 20:46 Petr Vorel
  2024-01-04 21:23 ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 20:46 UTC (permalink / raw)
  To: ltp

Hi all,

there are 3 parts:

1) The main motivation is to avoid having to fix docs manually,
implemented in commit "metaparse: Add missing blank line on the list".

2) Add CI job for generating metadata, to catch the problem early
(we test metadata in docker/podman CI jobs, but error there is quite
hidden. Having special job (which is quick) will show the problem
immediately.

3) Minor verbose output improvements.

Kind regards,
Petr

Petr Vorel (9):
  metaparse: Print parsing file on verbose
  metadata: parse.sh: Allow to pass list of files
  metadata: parse.sh: Pass -v to metaparse on VERBOSE=1
  metadata: test.sh: Print more info on VERBOSE=1
  metaparse: Verbose output on V=1
  metaparse: Add missing blank line on the list
  metadata: Add test for missing blank line in list
  ci/debian: Allow to install packages only for docparse
  ci: Add job for building metadata

 .github/workflows/metadata.yml                | 58 +++++++++++++++++++
 ci/debian.sh                                  | 17 +++++-
 metadata/Makefile                             |  4 +-
 metadata/data_storage.h                       | 36 +++++++++++-
 metadata/metaparse.c                          |  3 +
 metadata/parse.sh                             | 13 ++++-
 metadata/tests/list_missing_blank_line.c      | 14 +++++
 metadata/tests/list_missing_blank_line.c.json | 18 ++++++
 metadata/tests/test.sh                        |  2 +
 9 files changed, 159 insertions(+), 6 deletions(-)
 create mode 100644 .github/workflows/metadata.yml
 create mode 100644 metadata/tests/list_missing_blank_line.c
 create mode 100644 metadata/tests/list_missing_blank_line.c.json

-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH 0/9] metadata: improvements
@ 2024-01-04 21:16 Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 1/9] metaparse: Print parsing file on verbose Petr Vorel
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:16 UTC (permalink / raw)
  To: ltp

From: Petr Vorel <pvorel@suse.cz>

Hi all,

there are 3 parts:

1) The main motivation is to avoid having to fix docs manually,
implemented in commit "metaparse: Add missing blank line on the list".

2) Add CI job for generating metadata, to catch the problem early
(we test metadata in docker/podman CI jobs, but error there is quite
hidden. Having special job (which is quick) will show the problem
immediately.

3) Minor verbose output improvements.

Kind regards,
Petr

Petr Vorel (9):
  metaparse: Print parsing file on verbose
  metadata: parse.sh: Allow to pass list of files
  metadata: parse.sh: Pass -v to metaparse on VERBOSE=1
  metadata: test.sh: Print more info on VERBOSE=1
  metaparse: Verbose output on V=1
  metaparse: Add missing blank line on the list
  metadata: Add test for missing blank line in list
  ci/debian: Allow to install packages only for docparse
  ci: Add job for building metadata

 .github/workflows/metadata.yml                | 58 +++++++++++++++++++
 ci/debian.sh                                  | 17 +++++-
 metadata/Makefile                             |  4 +-
 metadata/data_storage.h                       | 36 +++++++++++-
 metadata/metaparse.c                          |  3 +
 metadata/parse.sh                             | 13 ++++-
 metadata/tests/list_missing_blank_line.c      | 14 +++++
 metadata/tests/list_missing_blank_line.c.json | 18 ++++++
 metadata/tests/test.sh                        |  2 +
 9 files changed, 159 insertions(+), 6 deletions(-)
 create mode 100644 .github/workflows/metadata.yml
 create mode 100644 metadata/tests/list_missing_blank_line.c
 create mode 100644 metadata/tests/list_missing_blank_line.c.json

-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH 1/9] metaparse: Print parsing file on verbose
  2024-01-04 21:16 [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
@ 2024-01-04 21:16 ` Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 2/9] metadata: parse.sh: Allow to pass list of files Petr Vorel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:16 UTC (permalink / raw)
  To: ltp

From: Petr Vorel <pvorel@suse.cz>

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 metadata/metaparse.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/metadata/metaparse.c b/metadata/metaparse.c
index 2384c73c8..fe6d68911 100644
--- a/metadata/metaparse.c
+++ b/metadata/metaparse.c
@@ -862,6 +862,9 @@ int main(int argc, char *argv[])
 		return 1;
 	}
 
+	if (verbose)
+		fprintf(stderr, "\n=== %s ===\n", argv[optind]);
+
 	res = parse_file(argv[optind]);
 	if (!res)
 		return 0;
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH 2/9] metadata: parse.sh: Allow to pass list of files
  2024-01-04 21:16 [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 1/9] metaparse: Print parsing file on verbose Petr Vorel
@ 2024-01-04 21:16 ` Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 3/9] metadata: parse.sh: Pass -v to metaparse on VERBOSE=1 Petr Vorel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:16 UTC (permalink / raw)
  To: ltp

From: Petr Vorel <pvorel@suse.cz>

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 metadata/parse.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/metadata/parse.sh b/metadata/parse.sh
index 69bf5db65..9dd097153 100755
--- a/metadata/parse.sh
+++ b/metadata/parse.sh
@@ -2,6 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (c) 2019 Cyril Hrubis <chrubis@suse.cz>
 # Copyright (c) 2020 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) Linux Test Project, 2022-2024
 set -e
 
 top_builddir=$PWD/..
@@ -29,7 +30,13 @@ echo ' "tests": {'
 
 first=1
 
-for test in `find testcases/ -name '*.c'|sort`; do
+if [ $# -gt 0 ]; then
+	tests=$*
+else
+	tests=$(find testcases/ -name '*.c' | sort)
+fi
+
+for test in $tests; do
 	a=$($top_builddir/metadata/metaparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
 	if [ -n "$a" ]; then
 		if [ -z "$first" ]; then
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH 3/9] metadata: parse.sh: Pass -v to metaparse on VERBOSE=1
  2024-01-04 21:16 [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 1/9] metaparse: Print parsing file on verbose Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 2/9] metadata: parse.sh: Allow to pass list of files Petr Vorel
@ 2024-01-04 21:16 ` Petr Vorel
  2024-01-04 21:16 ` [LTP] [PATCH 4/9] metadata: test.sh: Print more info " Petr Vorel
  2024-01-04 21:22 ` [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:16 UTC (permalink / raw)
  To: ltp

From: Petr Vorel <pvorel@suse.cz>

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 metadata/parse.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/metadata/parse.sh b/metadata/parse.sh
index 9dd097153..83a3683b5 100755
--- a/metadata/parse.sh
+++ b/metadata/parse.sh
@@ -36,8 +36,10 @@ else
 	tests=$(find testcases/ -name '*.c' | sort)
 fi
 
+[ "$VERBOSE" ] && v="-v"
+
 for test in $tests; do
-	a=$($top_builddir/metadata/metaparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
+	a=$($top_builddir/metadata/metaparse $v -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
 	if [ -n "$a" ]; then
 		if [ -z "$first" ]; then
 			echo ','
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH 4/9] metadata: test.sh: Print more info on VERBOSE=1
  2024-01-04 21:16 [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
                   ` (2 preceding siblings ...)
  2024-01-04 21:16 ` [LTP] [PATCH 3/9] metadata: parse.sh: Pass -v to metaparse on VERBOSE=1 Petr Vorel
@ 2024-01-04 21:16 ` Petr Vorel
  2024-01-04 21:22 ` [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:16 UTC (permalink / raw)
  To: ltp

From: Petr Vorel <pvorel@suse.cz>

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 metadata/tests/test.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/metadata/tests/test.sh b/metadata/tests/test.sh
index 475d721df..a00e32bb4 100755
--- a/metadata/tests/test.sh
+++ b/metadata/tests/test.sh
@@ -3,6 +3,7 @@
 fail=0
 
 for i in *.c; do
+	[ "$VERBOSE" ] && echo "$0: testing $i"
 	../metaparse $i > tmp.json
 	if ! diff tmp.json $i.json >/dev/null 2>&1; then
 		echo "***"
@@ -15,4 +16,5 @@ done
 
 rm -f tmp.json
 
+[ "$VERBOSE" ] && echo "$fail"
 exit $fail
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH 0/9] metadata: improvements
  2024-01-04 21:16 [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
                   ` (3 preceding siblings ...)
  2024-01-04 21:16 ` [LTP] [PATCH 4/9] metadata: test.sh: Print more info " Petr Vorel
@ 2024-01-04 21:22 ` Petr Vorel
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:22 UTC (permalink / raw)
  To: ltp

Hi,

I'm very sorry for the noise (I sent part of this patchset 2x).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH 0/9] metadata: improvements
  2024-01-04 20:46 Petr Vorel
@ 2024-01-04 21:23 ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2024-01-04 21:23 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi,

tested:

https://github.com/pevik/ltp/actions/runs/7414522840
https://github.com/pevik/ltp/actions/runs/7414522847

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-04 21:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 21:16 [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
2024-01-04 21:16 ` [LTP] [PATCH 1/9] metaparse: Print parsing file on verbose Petr Vorel
2024-01-04 21:16 ` [LTP] [PATCH 2/9] metadata: parse.sh: Allow to pass list of files Petr Vorel
2024-01-04 21:16 ` [LTP] [PATCH 3/9] metadata: parse.sh: Pass -v to metaparse on VERBOSE=1 Petr Vorel
2024-01-04 21:16 ` [LTP] [PATCH 4/9] metadata: test.sh: Print more info " Petr Vorel
2024-01-04 21:22 ` [LTP] [PATCH 0/9] metadata: improvements Petr Vorel
  -- strict thread matches above, loose matches on Subject: below --
2024-01-04 20:46 Petr Vorel
2024-01-04 21:23 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox