All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 ptest-runner 1/2] mem: Refactor ptest_list cleanup
@ 2021-08-17 12:38 ?ukasz Majewski
  2021-08-17 12:38 ` [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner ?ukasz Majewski
  0 siblings, 1 reply; 9+ messages in thread
From: ?ukasz Majewski @ 2021-08-17 12:38 UTC (permalink / raw)
  To: Anibal Limon; +Cc: yocto, Adrian Freihofer

From: Adrian Freihofer <adrian.freihofer@siemens.com>

Try to make memory management more robust by assigning always NULL to
struct ptest_list pointers. It's a refactoring which probably improves
the code but does not fix a concrete bug.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>

---
Changes for v2 [lukma]:
- Rebase from origin/dev to origin/master (the dev branch had
  some adjustments for timeout, which shall be discarded as not
  needed anymore.
---
 main.c             |  9 +++++----
 ptest_list.c       | 13 ++++---------
 ptest_list.h       |  8 +-------
 tests/ptest_list.c | 13 +++++++------
 tests/utils.c      | 22 +++++++++++-----------
 utils.c            |  6 +++---
 6 files changed, 31 insertions(+), 40 deletions(-)

diff --git a/main.c b/main.c
index 2b13ef5..890bc6a 100644
--- a/main.c
+++ b/main.c
@@ -117,7 +117,8 @@ main(int argc, char *argv[])
 	mtrace();
 #endif
 
-	struct ptest_list *head, *run;
+	struct ptest_list *head = NULL;
+	struct ptest_list *run = NULL;
 	__attribute__ ((__cleanup__(cleanup_ptest_opts))) struct ptest_options opts;
 
 	opts.dirs = malloc(sizeof(char **) * 1);
@@ -176,7 +177,7 @@ main(int argc, char *argv[])
 
 	head = NULL;
 	for (i = 0; i < opts.dirs_no; i ++) {
-		struct ptest_list *tmp;
+		struct ptest_list *tmp = NULL;
 
 		tmp = get_available_ptests(opts.dirs[i]);
 		if (tmp == NULL) {
@@ -212,7 +213,7 @@ main(int argc, char *argv[])
 
 		run = filter_ptests(head, opts.ptests, ptest_num);
 		CHECK_ALLOCATION(run, (size_t) ptest_num, 1);
-		ptest_list_free_all(head);
+		ptest_list_free_all(&head);
 	}
 
 	for (i = 0; i < ptest_exclude_num; i++)
@@ -220,7 +221,7 @@ main(int argc, char *argv[])
 
 	rc = run_ptests(run, opts, argv[0], stdout, stderr);
 
-	ptest_list_free_all(run);
+	ptest_list_free_all(&run);
 
 	return rc;
 }
diff --git a/ptest_list.c b/ptest_list.c
index 917ef4f..0c0e5b2 100644
--- a/ptest_list.c
+++ b/ptest_list.c
@@ -69,24 +69,19 @@ ptest_list_free(struct ptest_list *p)
 	free(p);
 }
 
-int
-ptest_list_free_all(struct ptest_list *head)
+void
+ptest_list_free_all(struct ptest_list **head)
 {
-	int i = 0;
 	struct ptest_list *p, *q;
 
-	VALIDATE_PTR_RINT(head);
-
-	p = head;
+	p = *head;
 	while (p != NULL) {
 		q = p;
 		p = p->next;
 
 		ptest_list_free(q);
-		i++;
 	}
-
-	return i;
+	*head = NULL;
 }
 
 int
diff --git a/ptest_list.h b/ptest_list.h
index 02a64bb..658a07a 100644
--- a/ptest_list.h
+++ b/ptest_list.h
@@ -36,12 +36,6 @@
 		x = NULL; \
 	} while (0)
 
-#define PTEST_LIST_FREE_ALL_CLEAN(x) \
-	do { \
-		ptest_list_free_all(x); \
-		x = NULL; \
-	} while (0)
-
 #define PTEST_LIST_ITERATE_START(head, p) for (p = head->next; p != NULL; p = p->next) {
 #define PTEST_LIST_ITERATE_END }
 
@@ -57,7 +51,7 @@ struct ptest_list {
 
 extern struct ptest_list *ptest_list_alloc(void);
 extern void ptest_list_free(struct ptest_list *);
-extern int ptest_list_free_all(struct ptest_list *);
+extern void ptest_list_free_all(struct ptest_list **);
 
 extern int ptest_list_length(struct ptest_list *);
 extern struct ptest_list *ptest_list_search(struct ptest_list *, char *);
diff --git a/tests/ptest_list.c b/tests/ptest_list.c
index 081f027..fc15acb 100644
--- a/tests/ptest_list.c
+++ b/tests/ptest_list.c
@@ -53,7 +53,7 @@ START_TEST(test_add)
 {
 	struct ptest_list *head = ptest_list_alloc();
 	ck_assert(ptest_list_add(head, strdup("perl"), NULL) != NULL);
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
@@ -62,14 +62,15 @@ START_TEST(test_free_all)
 	struct ptest_list *head = NULL;
 	int i;
  
-	ck_assert(ptest_list_free_all(head) == -1);
+ 	ptest_list_free_all(&head);
+	ck_assert(head == NULL);
 	ck_assert(errno == EINVAL);
 
 	head = ptest_list_alloc();
 	for (i = 0; i < ptests_num; i++)
 		ptest_list_add(head, strdup(ptest_names[i]), NULL);
 
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
@@ -87,7 +88,7 @@ START_TEST(test_length)
 		ptest_list_add(head, strdup(ptest_names[i]), NULL);
 
 	ck_assert_int_eq(ptest_list_length(head), ptests_num);
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
@@ -109,7 +110,7 @@ START_TEST(test_search)
 	for (i = ptests_num - 1; i >= 0; i--)
 		ck_assert(ptest_list_search(head, ptest_names[i]) != NULL);
 
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
@@ -141,7 +142,7 @@ START_TEST(test_remove)
 	ck_assert_int_eq(ptest_list_length(head), n);
 
 	ck_assert(ptest_list_search(head, "busybox") != NULL);
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
diff --git a/tests/utils.c b/tests/utils.c
index 8fffc18..0a51cec 100644
--- a/tests/utils.c
+++ b/tests/utils.c
@@ -88,13 +88,13 @@ START_TEST(test_get_available_ptests)
 	for (i = 0; ptests_not_found[i] != NULL; i++)
 		ck_assert(ptest_list_search(head, ptests_not_found[i]) == NULL);
 
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
 START_TEST(test_print_ptests)
 {
-	struct ptest_list *head;
+	struct ptest_list *head = NULL;
 
 	char *buf;
 	size_t size = PRINT_PTEST_BUF_SIZE;
@@ -116,14 +116,14 @@ START_TEST(test_print_ptests)
 
 	head = ptest_list_alloc();
 	ck_assert(print_ptests(head, fp) == 1);
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 	line = fgets(line_buf, PRINT_PTEST_BUF_SIZE, fp);
 	ck_assert(line != NULL);
 	ck_assert(strcmp(line, PRINT_PTESTS_NOT_FOUND) == 0);
 
 	head = get_available_ptests(opts_directory);
 	ck_assert(print_ptests(head, fp) == 0);
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 	line = fgets(line_buf, PRINT_PTEST_BUF_SIZE, fp);
 	ck_assert(line != NULL);
 	ck_assert(strcmp(line, PRINT_PTESTS_AVAILABLE) == 0);
@@ -144,7 +144,7 @@ END_TEST
 START_TEST(test_filter_ptests)
 {
 	struct ptest_list *head = get_available_ptests(opts_directory);
-	struct ptest_list *head_new;
+	struct ptest_list *head_new = NULL;
 	char *ptest_not_exists[] = {
 		"glib",
 	};
@@ -161,8 +161,8 @@ START_TEST(test_filter_ptests)
 	ck_assert(head_new != NULL);
 	ck_assert(ptest_list_length(head_new) == 3);
 
-	ptest_list_free_all(head);
-	ptest_list_free_all(head_new);
+	ptest_list_free_all(&head);
+	ptest_list_free_all(&head_new);
 }
 END_TEST
 
@@ -191,7 +191,7 @@ START_TEST(test_run_ptests)
 
 	rc = run_ptests(head, opts, "test_run_ptests", fp_stdout, fp_stderr);
 	ck_assert(rc == 0);
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 
 	fclose(fp_stdout);
 	free(buf_stdout);
@@ -227,7 +227,7 @@ START_TEST(test_run_timeout_duration_ptest)
 
 	test_ptest_expected_failure(head, timeout, "hang", search_for_timeout_and_duration);
 
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
@@ -255,7 +255,7 @@ START_TEST(test_run_fail_ptest)
 
 	test_ptest_expected_failure(head, timeout, "fail", search_for_fail);
 
-	ptest_list_free_all(head);
+	ptest_list_free_all(&head);
 }
 END_TEST
 
@@ -354,7 +354,7 @@ test_ptest_expected_failure(struct ptest_list *head, const unsigned int timeout,
 			fp_stdout
 		);
 
-		PTEST_LIST_FREE_ALL_CLEAN(filtered);
+		ptest_list_free_all(&filtered);
 	}
 
 	fclose(fp_stdout);
diff --git a/utils.c b/utils.c
index 128ff61..0f80357 100644
--- a/utils.c
+++ b/utils.c
@@ -92,7 +92,7 @@ check_allocation1(void *p, size_t size, char *file, int line, int exit_on_null)
 struct ptest_list *
 get_available_ptests(const char *dir)
 {
-	struct ptest_list *head;
+	struct ptest_list *head = NULL;
 	struct stat st_buf;
 
 	int n, i;
@@ -189,7 +189,7 @@ get_available_ptests(const char *dir)
 		free(namelist);
 
 		if (fail) {
-			PTEST_LIST_FREE_ALL_CLEAN(head);
+			ptest_list_free_all(&head);
 			errno = saved_errno;
 			break;
 		}
@@ -257,7 +257,7 @@ filter_ptests(struct ptest_list *head, char **ptests, int ptest_num)
 		}
 
 		if (fail) {
-			PTEST_LIST_FREE_ALL_CLEAN(head_new);
+			ptest_list_free_all(&head_new);
 			errno = saved_errno;
 		} 
 	} while (0);
-- 
2.20.1


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

* [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-08-17 12:38 [PATCH v2 ptest-runner 1/2] mem: Refactor ptest_list cleanup ?ukasz Majewski
@ 2021-08-17 12:38 ` ?ukasz Majewski
  2021-08-27 10:43   ` ?ukasz Majewski
  0 siblings, 1 reply; 9+ messages in thread
From: ?ukasz Majewski @ 2021-08-17 12:38 UTC (permalink / raw)
  To: Anibal Limon; +Cc: yocto, Adrian Freihofer, Lukasz Majewski

Up till now ptest-runner2 returns number of failed tests with its
exit status code. Such use case is not recommended [1] and may cause
issues when there are more than 256 tests to be executed.

To alleviate this issue the number of total tests with number of failed
ones is printed before exit. To be more specific - failure of tests (one
or more) causes ptest-runner to provide exit code of 1.

One can test this change with executing:
./ptest-runner -d tests/data fail

Links:
[1] - https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- When number of failed tests is N, the ptest-runner returns value of 1
  to indicate error in the execution
---
 main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/main.c b/main.c
index 890bc6a..bcec844 100644
--- a/main.c
+++ b/main.c
@@ -220,6 +220,9 @@ main(int argc, char *argv[])
 		ptest_list_remove(run, opts.exclude[i], 1);
 
 	rc = run_ptests(run, opts, argv[0], stdout, stderr);
+	fprintf(stdout, "TOTAL: %d FAIL: %d\n", ptest_list_length(run), rc);
+	if (rc > 0)
+		rc = 1;
 
 	ptest_list_free_all(&run);
 
-- 
2.20.1


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

* Re: [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-08-17 12:38 ` [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner ?ukasz Majewski
@ 2021-08-27 10:43   ` ?ukasz Majewski
  2021-09-20  9:18     ` ?ukasz Majewski
  0 siblings, 1 reply; 9+ messages in thread
From: ?ukasz Majewski @ 2021-08-27 10:43 UTC (permalink / raw)
  To: Anibal Limon; +Cc: yocto, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]

Hi Anibal,

> Up till now ptest-runner2 returns number of failed tests with its
> exit status code. Such use case is not recommended [1] and may cause
> issues when there are more than 256 tests to be executed.
> 
> To alleviate this issue the number of total tests with number of
> failed ones is printed before exit. To be more specific - failure of
> tests (one or more) causes ptest-runner to provide exit code of 1.
> 
> One can test this change with executing:
> ./ptest-runner -d tests/data fail

Gentle ping on this patch.

> 
> Links:
> [1] -
> https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes for v2:
> - When number of failed tests is N, the ptest-runner returns value of
> 1 to indicate error in the execution
> ---
>  main.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/main.c b/main.c
> index 890bc6a..bcec844 100644
> --- a/main.c
> +++ b/main.c
> @@ -220,6 +220,9 @@ main(int argc, char *argv[])
>  		ptest_list_remove(run, opts.exclude[i], 1);
>  
>  	rc = run_ptests(run, opts, argv[0], stdout, stderr);
> +	fprintf(stdout, "TOTAL: %d FAIL: %d\n",
> ptest_list_length(run), rc);
> +	if (rc > 0)
> +		rc = 1;
>  
>  	ptest_list_free_all(&run);
>  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

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

* Re: [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-08-27 10:43   ` ?ukasz Majewski
@ 2021-09-20  9:18     ` ?ukasz Majewski
  2021-09-20  9:23       ` [yocto] " Alexander Kanavin
  0 siblings, 1 reply; 9+ messages in thread
From: ?ukasz Majewski @ 2021-09-20  9:18 UTC (permalink / raw)
  To: Anibal Limon; +Cc: yocto, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]

Hi Anibal,

> Hi Anibal,
> 
> > Up till now ptest-runner2 returns number of failed tests with its
> > exit status code. Such use case is not recommended [1] and may cause
> > issues when there are more than 256 tests to be executed.
> > 
> > To alleviate this issue the number of total tests with number of
> > failed ones is printed before exit. To be more specific - failure of
> > tests (one or more) causes ptest-runner to provide exit code of 1.
> > 
> > One can test this change with executing:
> > ./ptest-runner -d tests/data fail  
> 
> Gentle ping on this patch.
> 

Gentle ping on this patch.

Is it OK to be applied?

> > 
> > Links:
> > [1] -
> > https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > Changes for v2:
> > - When number of failed tests is N, the ptest-runner returns value
> > of 1 to indicate error in the execution
> > ---
> >  main.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/main.c b/main.c
> > index 890bc6a..bcec844 100644
> > --- a/main.c
> > +++ b/main.c
> > @@ -220,6 +220,9 @@ main(int argc, char *argv[])
> >  		ptest_list_remove(run, opts.exclude[i], 1);
> >  
> >  	rc = run_ptests(run, opts, argv[0], stdout, stderr);
> > +	fprintf(stdout, "TOTAL: %d FAIL: %d\n",
> > ptest_list_length(run), rc);
> > +	if (rc > 0)
> > +		rc = 1;
> >  
> >  	ptest_list_free_all(&run);
> >    
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma@denx.de




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

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

* Re: [yocto] [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-09-20  9:18     ` ?ukasz Majewski
@ 2021-09-20  9:23       ` Alexander Kanavin
  2021-09-23 16:18         ` Anibal Limon
  2021-09-27  8:09         ` Lukasz Majewski
  0 siblings, 2 replies; 9+ messages in thread
From: Alexander Kanavin @ 2021-09-20  9:23 UTC (permalink / raw)
  To: ?ukasz Majewski; +Cc: Anibal Limon, Yocto-mailing-list, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 2376 bytes --]

I think we might be having an 'unresponsive maintainer' situation? How can
Anibal be reached?

Alex

On Mon, 20 Sept 2021 at 11:19, ?ukasz Majewski <lukma@denx.de> wrote:

> Hi Anibal,
>
> > Hi Anibal,
> >
> > > Up till now ptest-runner2 returns number of failed tests with its
> > > exit status code. Such use case is not recommended [1] and may cause
> > > issues when there are more than 256 tests to be executed.
> > >
> > > To alleviate this issue the number of total tests with number of
> > > failed ones is printed before exit. To be more specific - failure of
> > > tests (one or more) causes ptest-runner to provide exit code of 1.
> > >
> > > One can test this change with executing:
> > > ./ptest-runner -d tests/data fail
> >
> > Gentle ping on this patch.
> >
>
> Gentle ping on this patch.
>
> Is it OK to be applied?
>
> > >
> > > Links:
> > > [1] -
> > > https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
> > >
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > ---
> > > Changes for v2:
> > > - When number of failed tests is N, the ptest-runner returns value
> > > of 1 to indicate error in the execution
> > > ---
> > >  main.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/main.c b/main.c
> > > index 890bc6a..bcec844 100644
> > > --- a/main.c
> > > +++ b/main.c
> > > @@ -220,6 +220,9 @@ main(int argc, char *argv[])
> > >             ptest_list_remove(run, opts.exclude[i], 1);
> > >
> > >     rc = run_ptests(run, opts, argv[0], stdout, stderr);
> > > +   fprintf(stdout, "TOTAL: %d FAIL: %d\n",
> > > ptest_list_length(run), rc);
> > > +   if (rc > 0)
> > > +           rc = 1;
> > >
> > >     ptest_list_free_all(&run);
> > >
> >
> >
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma@denx.de
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 3504 bytes --]

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

* Re: [yocto] [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-09-20  9:23       ` [yocto] " Alexander Kanavin
@ 2021-09-23 16:18         ` Anibal Limon
  2021-09-27  8:09         ` Lukasz Majewski
  1 sibling, 0 replies; 9+ messages in thread
From: Anibal Limon @ 2021-09-23 16:18 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: ?ukasz Majewski, Yocto-mailing-list, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 2683 bytes --]

On Mon, 20 Sept 2021 at 04:23, Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> I think we might be having an 'unresponsive maintainer' situation? How can
> Anibal be reached?
>

I was OOO for futher you can find me with nickname alimon at #yocto at
Libera.


>
> Alex
>
> On Mon, 20 Sept 2021 at 11:19, ?ukasz Majewski <lukma@denx.de> wrote:
>
>> Hi Anibal,
>>
>> > Hi Anibal,
>> >
>> > > Up till now ptest-runner2 returns number of failed tests with its
>> > > exit status code. Such use case is not recommended [1] and may cause
>> > > issues when there are more than 256 tests to be executed.
>> > >
>> > > To alleviate this issue the number of total tests with number of
>> > > failed ones is printed before exit. To be more specific - failure of
>> > > tests (one or more) causes ptest-runner to provide exit code of 1.
>> > >
>> > > One can test this change with executing:
>> > > ./ptest-runner -d tests/data fail
>> >
>> > Gentle ping on this patch.
>> >
>>
>> Gentle ping on this patch.
>>
>> Is it OK to be applied?
>>
>
Applied,

Thanks,
Anibal


>
>> > >
>> > > Links:
>> > > [1] -
>> > > https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
>> > >
>> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
>> > > ---
>> > > Changes for v2:
>> > > - When number of failed tests is N, the ptest-runner returns value
>> > > of 1 to indicate error in the execution
>> > > ---
>> > >  main.c | 3 +++
>> > >  1 file changed, 3 insertions(+)
>> > >
>> > > diff --git a/main.c b/main.c
>> > > index 890bc6a..bcec844 100644
>> > > --- a/main.c
>> > > +++ b/main.c
>> > > @@ -220,6 +220,9 @@ main(int argc, char *argv[])
>> > >             ptest_list_remove(run, opts.exclude[i], 1);
>> > >
>> > >     rc = run_ptests(run, opts, argv[0], stdout, stderr);
>> > > +   fprintf(stdout, "TOTAL: %d FAIL: %d\n",
>> > > ptest_list_length(run), rc);
>> > > +   if (rc > 0)
>> > > +           rc = 1;
>> > >
>> > >     ptest_list_free_all(&run);
>> > >
>> >
>> >
>> >
>> >
>> > Best regards,
>> >
>> > Lukasz Majewski
>> >
>> > --
>> >
>> > DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
>> > lukma@denx.de
>>
>>
>>
>>
>> Best regards,
>>
>> Lukasz Majewski
>>
>> --
>>
>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
>>
>> 
>>
>>

[-- Attachment #2: Type: text/html, Size: 4579 bytes --]

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

* Re: [yocto] [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-09-20  9:23       ` [yocto] " Alexander Kanavin
  2021-09-23 16:18         ` Anibal Limon
@ 2021-09-27  8:09         ` Lukasz Majewski
  2021-09-27  8:35           ` Alexander Kanavin
  1 sibling, 1 reply; 9+ messages in thread
From: Lukasz Majewski @ 2021-09-27  8:09 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Anibal Limon, Yocto-mailing-list, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 3466 bytes --]

Hi Alexander,

> I think we might be having an 'unresponsive maintainer' situation?
> How can Anibal be reached?

I saw recenlty your patches on this topic. Is there a chance that
Anibal will pull/review them soon?

It looks like those are crucial for ptest-runner operation.

> 
> Alex
> 
> On Mon, 20 Sept 2021 at 11:19, ?ukasz Majewski <lukma@denx.de> wrote:
> 
> > Hi Anibal,
> >  
> > > Hi Anibal,
> > >  
> > > > Up till now ptest-runner2 returns number of failed tests with
> > > > its exit status code. Such use case is not recommended [1] and
> > > > may cause issues when there are more than 256 tests to be
> > > > executed.
> > > >
> > > > To alleviate this issue the number of total tests with number of
> > > > failed ones is printed before exit. To be more specific -
> > > > failure of tests (one or more) causes ptest-runner to provide
> > > > exit code of 1.
> > > >
> > > > One can test this change with executing:
> > > > ./ptest-runner -d tests/data fail  
> > >
> > > Gentle ping on this patch.
> > >  
> >
> > Gentle ping on this patch.
> >
> > Is it OK to be applied?
> >  
> > > >
> > > > Links:
> > > > [1] -
> > > > https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
> > > >
> > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > ---
> > > > Changes for v2:
> > > > - When number of failed tests is N, the ptest-runner returns
> > > > value of 1 to indicate error in the execution
> > > > ---
> > > >  main.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/main.c b/main.c
> > > > index 890bc6a..bcec844 100644
> > > > --- a/main.c
> > > > +++ b/main.c
> > > > @@ -220,6 +220,9 @@ main(int argc, char *argv[])
> > > >             ptest_list_remove(run, opts.exclude[i], 1);
> > > >
> > > >     rc = run_ptests(run, opts, argv[0], stdout, stderr);
> > > > +   fprintf(stdout, "TOTAL: %d FAIL: %d\n",
> > > > ptest_list_length(run), rc);
> > > > +   if (rc > 0)
> > > > +           rc = 1;
> > > >
> > > >     ptest_list_free_all(&run);
> > > >  
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > (+49)-8142-66989-80 Email: lukma@denx.de  
> >
> >
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma@denx.de
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#54769):
> > https://lists.yoctoproject.org/g/yocto/message/54769
> > Mute This Topic: https://lists.yoctoproject.org/mt/84946492/1686489
> > Group Owner: yocto+owner@lists.yoctoproject.org
> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> > alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
> >  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [yocto] [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-09-27  8:09         ` Lukasz Majewski
@ 2021-09-27  8:35           ` Alexander Kanavin
  2021-09-27 18:59             ` Anibal Limon
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2021-09-27  8:35 UTC (permalink / raw)
  To: Lukasz Majewski; +Cc: Anibal Limon, Yocto-mailing-list, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 3671 bytes --]

I think they're already in git?

Alex

On Mon, 27 Sept 2021 at 10:09, Lukasz Majewski <lukma@denx.de> wrote:

> Hi Alexander,
>
> > I think we might be having an 'unresponsive maintainer' situation?
> > How can Anibal be reached?
>
> I saw recenlty your patches on this topic. Is there a chance that
> Anibal will pull/review them soon?
>
> It looks like those are crucial for ptest-runner operation.
>
> >
> > Alex
> >
> > On Mon, 20 Sept 2021 at 11:19, ?ukasz Majewski <lukma@denx.de> wrote:
> >
> > > Hi Anibal,
> > >
> > > > Hi Anibal,
> > > >
> > > > > Up till now ptest-runner2 returns number of failed tests with
> > > > > its exit status code. Such use case is not recommended [1] and
> > > > > may cause issues when there are more than 256 tests to be
> > > > > executed.
> > > > >
> > > > > To alleviate this issue the number of total tests with number of
> > > > > failed ones is printed before exit. To be more specific -
> > > > > failure of tests (one or more) causes ptest-runner to provide
> > > > > exit code of 1.
> > > > >
> > > > > One can test this change with executing:
> > > > > ./ptest-runner -d tests/data fail
> > > >
> > > > Gentle ping on this patch.
> > > >
> > >
> > > Gentle ping on this patch.
> > >
> > > Is it OK to be applied?
> > >
> > > > >
> > > > > Links:
> > > > > [1] -
> > > > >
> https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
> > > > >
> > > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > > ---
> > > > > Changes for v2:
> > > > > - When number of failed tests is N, the ptest-runner returns
> > > > > value of 1 to indicate error in the execution
> > > > > ---
> > > > >  main.c | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > >
> > > > > diff --git a/main.c b/main.c
> > > > > index 890bc6a..bcec844 100644
> > > > > --- a/main.c
> > > > > +++ b/main.c
> > > > > @@ -220,6 +220,9 @@ main(int argc, char *argv[])
> > > > >             ptest_list_remove(run, opts.exclude[i], 1);
> > > > >
> > > > >     rc = run_ptests(run, opts, argv[0], stdout, stderr);
> > > > > +   fprintf(stdout, "TOTAL: %d FAIL: %d\n",
> > > > > ptest_list_length(run), rc);
> > > > > +   if (rc > 0)
> > > > > +           rc = 1;
> > > > >
> > > > >     ptest_list_free_all(&run);
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Lukasz Majewski
> > > >
> > > > --
> > > >
> > > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > (+49)-8142-66989-80 Email: lukma@denx.de
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > lukma@denx.de
> > >
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > Links: You receive all messages sent to this group.
> > > View/Reply Online (#54769):
> > > https://lists.yoctoproject.org/g/yocto/message/54769
> > > Mute This Topic: https://lists.yoctoproject.org/mt/84946492/1686489
> > > Group Owner: yocto+owner@lists.yoctoproject.org
> > > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> > > alex.kanavin@gmail.com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > >
> > >
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
>

[-- Attachment #2: Type: text/html, Size: 6131 bytes --]

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

* Re: [yocto] [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner
  2021-09-27  8:35           ` Alexander Kanavin
@ 2021-09-27 18:59             ` Anibal Limon
  0 siblings, 0 replies; 9+ messages in thread
From: Anibal Limon @ 2021-09-27 18:59 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Lukasz Majewski, Yocto-mailing-list, Adrian Freihofer

[-- Attachment #1: Type: text/plain, Size: 4005 bytes --]

On Mon, 27 Sept 2021 at 03:35, Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> I think they're already in git?
>

Hi,

Yes they are.


>
> Alex
>
> On Mon, 27 Sept 2021 at 10:09, Lukasz Majewski <lukma@denx.de> wrote:
>
>> Hi Alexander,
>>
>> > I think we might be having an 'unresponsive maintainer' situation?
>> > How can Anibal be reached?
>>
>> I saw recenlty your patches on this topic. Is there a chance that
>> Anibal will pull/review them soon?
>>
>
I just send recipe upgrade to OE-Core, the patches are already in git.

Regards,
Anibal


>
>> It looks like those are crucial for ptest-runner operation.
>>
>> >
>> > Alex
>> >
>> > On Mon, 20 Sept 2021 at 11:19, ?ukasz Majewski <lukma@denx.de> wrote:
>> >
>> > > Hi Anibal,
>> > >
>> > > > Hi Anibal,
>> > > >
>> > > > > Up till now ptest-runner2 returns number of failed tests with
>> > > > > its exit status code. Such use case is not recommended [1] and
>> > > > > may cause issues when there are more than 256 tests to be
>> > > > > executed.
>> > > > >
>> > > > > To alleviate this issue the number of total tests with number of
>> > > > > failed ones is printed before exit. To be more specific -
>> > > > > failure of tests (one or more) causes ptest-runner to provide
>> > > > > exit code of 1.
>> > > > >
>> > > > > One can test this change with executing:
>> > > > > ./ptest-runner -d tests/data fail
>> > > >
>> > > > Gentle ping on this patch.
>> > > >
>> > >
>> > > Gentle ping on this patch.
>> > >
>> > > Is it OK to be applied?
>> > >
>> > > > >
>> > > > > Links:
>> > > > > [1] -
>> > > > >
>> https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
>> > > > >
>> > > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
>> > > > > ---
>> > > > > Changes for v2:
>> > > > > - When number of failed tests is N, the ptest-runner returns
>> > > > > value of 1 to indicate error in the execution
>> > > > > ---
>> > > > >  main.c | 3 +++
>> > > > >  1 file changed, 3 insertions(+)
>> > > > >
>> > > > > diff --git a/main.c b/main.c
>> > > > > index 890bc6a..bcec844 100644
>> > > > > --- a/main.c
>> > > > > +++ b/main.c
>> > > > > @@ -220,6 +220,9 @@ main(int argc, char *argv[])
>> > > > >             ptest_list_remove(run, opts.exclude[i], 1);
>> > > > >
>> > > > >     rc = run_ptests(run, opts, argv[0], stdout, stderr);
>> > > > > +   fprintf(stdout, "TOTAL: %d FAIL: %d\n",
>> > > > > ptest_list_length(run), rc);
>> > > > > +   if (rc > 0)
>> > > > > +           rc = 1;
>> > > > >
>> > > > >     ptest_list_free_all(&run);
>> > > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > Best regards,
>> > > >
>> > > > Lukasz Majewski
>> > > >
>> > > > --
>> > > >
>> > > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
>> > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
>> > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
>> > > > (+49)-8142-66989-80 Email: lukma@denx.de
>> > >
>> > >
>> > >
>> > >
>> > > Best regards,
>> > >
>> > > Lukasz Majewski
>> > >
>> > > --
>> > >
>> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
>> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
>> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
>> > > lukma@denx.de
>> > >
>> > > -=-=-=-=-=-=-=-=-=-=-=-
>> > > Links: You receive all messages sent to this group.
>> > > View/Reply Online (#54769):
>> > > https://lists.yoctoproject.org/g/yocto/message/54769
>> > > Mute This Topic: https://lists.yoctoproject.org/mt/84946492/1686489
>> > > Group Owner: yocto+owner@lists.yoctoproject.org
>> > > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>> > > alex.kanavin@gmail.com]
>> > > -=-=-=-=-=-=-=-=-=-=-=-
>> > >
>> > >
>>
>>
>>
>>
>> Best regards,
>>
>> Lukasz Majewski
>>
>> --
>>
>> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
>>
>

[-- Attachment #2: Type: text/html, Size: 7233 bytes --]

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

end of thread, other threads:[~2021-09-27 18:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 12:38 [PATCH v2 ptest-runner 1/2] mem: Refactor ptest_list cleanup ?ukasz Majewski
2021-08-17 12:38 ` [PATCH v2 ptest-runner 2/2] main: Do not return number of failed tests when calling ptest-runner ?ukasz Majewski
2021-08-27 10:43   ` ?ukasz Majewski
2021-09-20  9:18     ` ?ukasz Majewski
2021-09-20  9:23       ` [yocto] " Alexander Kanavin
2021-09-23 16:18         ` Anibal Limon
2021-09-27  8:09         ` Lukasz Majewski
2021-09-27  8:35           ` Alexander Kanavin
2021-09-27 18:59             ` Anibal Limon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.