All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers
@ 2019-02-19  7:57 Daniel Vetter
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled Daniel Vetter
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Daniel Vetter @ 2019-02-19  7:57 UTC (permalink / raw)
  To: IGT development; +Cc: Daniel Vetter

Start with internal_assert, more will follow. While at it, use
internal_assert everywhere (except where we check exit status, those
will get dedicated assert checks).

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/tests/igt_assert.c          |  9 +-------
 lib/tests/igt_can_fail.c        | 12 +++++------
 lib/tests/igt_can_fail_simple.c |  4 ++--
 lib/tests/igt_exit_handler.c    | 21 +++++++++---------
 lib/tests/igt_fork.c            |  9 +-------
 lib/tests/igt_segfault.c        |  9 +-------
 lib/tests/igt_simulation.c      |  9 +-------
 lib/tests/igt_subtest_group.c   | 19 +++++++++--------
 lib/tests/igt_tests_common.h    | 38 +++++++++++++++++++++++++++++++++
 9 files changed, 71 insertions(+), 59 deletions(-)
 create mode 100644 lib/tests/igt_tests_common.h

diff --git a/lib/tests/igt_assert.c b/lib/tests/igt_assert.c
index 0082fda14851..e3c1ec49daf2 100644
--- a/lib/tests/igt_assert.c
+++ b/lib/tests/igt_assert.c
@@ -22,7 +22,6 @@
  *
  */
 
-#include <assert.h>
 #include <errno.h>
 #include <float.h>
 #include <limits.h>
@@ -36,13 +35,7 @@
 
 #include "igt_core.h"
 
-/*
- * We need to hide assert from the cocci igt test refactor spatch.
- *
- * IMPORTANT: Test infrastructure tests are the only valid places where using
- * assert is allowed.
- */
-#define internal_assert assert
+#include "igt_tests_common.h"
 
 char test[] = "test";
 char *argv_run[] = { test };
diff --git a/lib/tests/igt_can_fail.c b/lib/tests/igt_can_fail.c
index 566682422b64..1e3d9558728f 100644
--- a/lib/tests/igt_can_fail.c
+++ b/lib/tests/igt_can_fail.c
@@ -22,23 +22,23 @@
  *
  */
 
-#include <assert.h>
 #include "igt_core.h"
 
+#include "igt_tests_common.h"
 
 igt_main
 {
-	assert(igt_can_fail() == false);
+	internal_assert(igt_can_fail() == false);
 
 	igt_fixture {
-		assert(igt_can_fail());
+		internal_assert(igt_can_fail());
 	}
 
-	assert(igt_can_fail() == false);
+	internal_assert(igt_can_fail() == false);
 
 	igt_subtest("subtest") {
-		assert(igt_can_fail());
+		internal_assert(igt_can_fail());
 	}
 
-	assert(igt_can_fail() == false);
+	internal_assert(igt_can_fail() == false);
 }
diff --git a/lib/tests/igt_can_fail_simple.c b/lib/tests/igt_can_fail_simple.c
index 0d9f6dd4076c..8ff43d15fa6b 100644
--- a/lib/tests/igt_can_fail_simple.c
+++ b/lib/tests/igt_can_fail_simple.c
@@ -22,11 +22,11 @@
  *
  */
 
-#include <assert.h>
 #include "igt_core.h"
 
+#include "igt_tests_common.h"
 
 igt_simple_main
 {
-	assert(igt_can_fail());
+	internal_assert(igt_can_fail());
 }
diff --git a/lib/tests/igt_exit_handler.c b/lib/tests/igt_exit_handler.c
index f2997bd13633..7546fde6d6f8 100644
--- a/lib/tests/igt_exit_handler.c
+++ b/lib/tests/igt_exit_handler.c
@@ -21,19 +21,20 @@
  * IN THE SOFTWARE.
  */
 
-#include <assert.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include "igt_core.h"
 
+#include "igt_tests_common.h"
+
 int test;
 int pipes[2];
 
 static void exit_handler1(int sig)
 {
-	assert(test == 1);
+	internal_assert(test == 1);
 	test++;
 }
 
@@ -42,12 +43,12 @@ static void exit_handler2(int sig)
 	char tmp = 1;
 
 	/* ensure exit handlers are called in reverse */
-	assert(test == 0);
+	internal_assert(test == 0);
 	test++;
 
 	/* we need to get a side effect to the parent to make sure exit handlers
 	 * actually run. */
-	assert(write(pipes[1], &tmp, 1) == 1);
+	internal_assert(write(pipes[1], &tmp, 1) == 1);
 }
 
 enum test_type {
@@ -67,7 +68,7 @@ static int testfunc(enum test_type test_type)
 	int status;
 	char tmp = 0;
 
-	assert(pipe2(pipes, O_NONBLOCK) == 0);
+	internal_assert(pipe2(pipes, O_NONBLOCK) == 0);
 
 	pid = fork();
 
@@ -100,10 +101,10 @@ static int testfunc(enum test_type test_type)
 		igt_exit();
 	}
 
-	assert(waitpid(pid, &status, 0) != -1);
+	internal_assert(waitpid(pid, &status, 0) != -1);
 
-	assert(read(pipes[0], &tmp, 1) == 1);
-	assert(tmp == 1);
+	internal_assert(read(pipes[0], &tmp, 1) == 1);
+	internal_assert(tmp == 1);
 
 	return status;
 }
@@ -112,9 +113,9 @@ int main(int argc, char **argv)
 {
 	int status;
 
-	assert(testfunc(SUC) == 0);
+	internal_assert(testfunc(SUC) == 0);
 
-	assert(testfunc(NORMAL) == 0);
+	internal_assert(testfunc(NORMAL) == 0);
 
 	status = testfunc(FAIL);
 	assert(WIFEXITED(status) && WEXITSTATUS(status) == 1);
diff --git a/lib/tests/igt_fork.c b/lib/tests/igt_fork.c
index fa5bb7701c09..38c55d11f7ec 100644
--- a/lib/tests/igt_fork.c
+++ b/lib/tests/igt_fork.c
@@ -22,7 +22,6 @@
  *
  */
 
-#include <assert.h>
 #include <errno.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -32,13 +31,7 @@
 
 #include "igt_core.h"
 
-/*
- * We need to hide assert from the cocci igt test refactor spatch.
- *
- * IMPORTANT: Test infrastructure tests are the only valid places where using
- * assert is allowed.
- */
-#define internal_assert assert
+#include "igt_tests_common.h"
 
 char test[] = "test";
 char *argv_run[] = { test };
diff --git a/lib/tests/igt_segfault.c b/lib/tests/igt_segfault.c
index 86fee5354d67..bfbbff564fac 100644
--- a/lib/tests/igt_segfault.c
+++ b/lib/tests/igt_segfault.c
@@ -38,19 +38,12 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <sys/types.h>
-#include <assert.h>
 #include <errno.h>
 
 #include "drmtest.h"
 #include "igt_core.h"
 
-/*
- * We need to hide assert from the cocci igt test refactor spatch.
- *
- * IMPORTANT: Test infrastructure tests are the only valid places where using
- * assert is allowed.
- */
-#define internal_assert assert
+#include "igt_tests_common.h"
 
 bool simple;
 bool runa;
diff --git a/lib/tests/igt_simulation.c b/lib/tests/igt_simulation.c
index 2efccac4e390..3f3cd88fd058 100644
--- a/lib/tests/igt_simulation.c
+++ b/lib/tests/igt_simulation.c
@@ -28,19 +28,12 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <sys/types.h>
-#include <assert.h>
 #include <errno.h>
 
 #include "drmtest.h"
 #include "igt_core.h"
 
-/*
- * We need to hide assert from the cocci igt test refactor spatch.
- *
- * IMPORTANT: Test infrastructure tests are the only valid places where using
- * assert is allowed.
- */
-#define internal_assert assert
+#include "igt_tests_common.h"
 
 bool simple;
 bool list_subtests;
diff --git a/lib/tests/igt_subtest_group.c b/lib/tests/igt_subtest_group.c
index c2364d799f36..7783d021e5a2 100644
--- a/lib/tests/igt_subtest_group.c
+++ b/lib/tests/igt_subtest_group.c
@@ -22,9 +22,10 @@
  *
  */
 
-#include <assert.h>
 #include "igt_core.h"
 
+#include "igt_tests_common.h"
+
 igt_main
 {
 	bool t1 = false;
@@ -41,7 +42,7 @@ igt_main
 			}
 
 			igt_subtest("not-run") {
-				assert(0);
+				internal_assert(0);
 			}
 
 			igt_subtest_group {
@@ -49,35 +50,35 @@ igt_main
 				 * restore to "run testcases" when an outer
 				 * group is already in SKIP state. */
 				igt_subtest("still-not-run") {
-					assert(0);
+					internal_assert(0);
 				}
 			}
 		}
 
 		igt_subtest("run") {
 			t1 = true;
-			assert(1);
+			internal_assert(1);
 		}
 	}
 
 	igt_subtest_group {
 		igt_fixture {
-			assert(t2 == 0);
+			internal_assert(t2 == 0);
 			t2 = 1;
 		}
 
 		igt_subtest("run-again") {
-			assert(t2 == 1);
+			internal_assert(t2 == 1);
 			t2 = 2;
 		}
 
 		igt_fixture {
-			assert(t2 == 2);
+			internal_assert(t2 == 2);
 			t2 = 3;
 
 		}
 	}
 
-	assert(t1);
-	assert(t2 == 3);
+	internal_assert(t1);
+	internal_assert(t2 == 3);
 }
diff --git a/lib/tests/igt_tests_common.h b/lib/tests/igt_tests_common.h
new file mode 100644
index 000000000000..9b347a4565d9
--- /dev/null
+++ b/lib/tests/igt_tests_common.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef IGT_LIB_TESTS_COMMON_H
+#define IGT_LIB_TESTS_COMMON_H
+
+#include <assert.h>
+
+/*
+ * We need to hide assert from the cocci igt test refactor spatch.
+ *
+ * IMPORTANT: Test infrastructure tests are the only valid places where using
+ * assert is allowed.
+ */
+#define internal_assert assert
+
+#endif
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
@ 2019-02-19  7:57 ` Daniel Vetter
  2019-02-19  8:52   ` Chris Wilson
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 3/5] tests: drop invalid name build checks Daniel Vetter
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2019-02-19  7:57 UTC (permalink / raw)
  To: IGT development

And convert everything over.

igt_segfault needed a bit of care to differentiate between a real
death-by-signal and igt_exit mapping a child process signal death to
an exit code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/tests/igt_assert.c       |  4 ++--
 lib/tests/igt_exit_handler.c |  6 +++---
 lib/tests/igt_fork.c         | 10 +++++-----
 lib/tests/igt_segfault.c     | 14 +++++---------
 lib/tests/igt_tests_common.h | 11 +++++++++++
 5 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/lib/tests/igt_assert.c b/lib/tests/igt_assert.c
index e3c1ec49daf2..632e15978978 100644
--- a/lib/tests/igt_assert.c
+++ b/lib/tests/igt_assert.c
@@ -151,7 +151,7 @@ igt_main
 	test_to_run = test_cmpint_negative;
 	ret = do_fork();
 	igt_subtest("igt_cmpint_negative")
-		internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
+		internal_assert_wexited(ret, IGT_EXIT_FAILURE);
 
 	igt_subtest("igt_assert_fd")
 		test_fd();
@@ -159,5 +159,5 @@ igt_main
 	test_to_run = test_fd_negative;
 	ret = do_fork();
 	igt_subtest("igt_assert_fd_negative")
-		internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
+		internal_assert_wexited(ret, IGT_EXIT_FAILURE);
 }
diff --git a/lib/tests/igt_exit_handler.c b/lib/tests/igt_exit_handler.c
index 7546fde6d6f8..f8a747862c01 100644
--- a/lib/tests/igt_exit_handler.c
+++ b/lib/tests/igt_exit_handler.c
@@ -118,11 +118,11 @@ int main(int argc, char **argv)
 	internal_assert(testfunc(NORMAL) == 0);
 
 	status = testfunc(FAIL);
-	assert(WIFEXITED(status) && WEXITSTATUS(status) == 1);
+	internal_assert_wexited(status, 1);
 
 	status = testfunc(SKIP);
-	assert(WIFEXITED(status) && WEXITSTATUS(status) == IGT_EXIT_SKIP);
+	internal_assert_wexited(status, IGT_EXIT_SKIP);
 
 	status = testfunc(SIG);
-	assert(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM);
+	internal_assert_wsignaled(status, SIGTERM);
 }
diff --git a/lib/tests/igt_fork.c b/lib/tests/igt_fork.c
index 38c55d11f7ec..100031207461 100644
--- a/lib/tests/igt_fork.c
+++ b/lib/tests/igt_fork.c
@@ -113,21 +113,21 @@ int main(int argc, char **argv)
 
 	/* check that igt_assert is forwarded */
 	ret = do_fork(igt_fork_vs_assert);
-	internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
+	internal_assert_wexited(ret, IGT_EXIT_FAILURE);
 
 	/* check that igt_skip within a fork blows up */
 	ret = do_fork(igt_fork_vs_skip);
-	internal_assert(WEXITSTATUS(ret) == SIGABRT + 128);
+	internal_assert_wexited(ret, SIGABRT + 128);
 
 	/* check that failure to clean up fails */
 	ret = do_fork(igt_fork_leak);
-	internal_assert(WTERMSIG(ret) == SIGABRT);
+	internal_assert_wsignaled(ret, SIGABRT);
 
 	/* check that igt_waitchildren_timeout cleans up*/
 	ret = do_fork(igt_fork_timeout_leak);
-	internal_assert(WEXITSTATUS(ret) == SIGKILL + 128);
+	internal_assert_wexited(ret, SIGKILL + 128);
 
 	/* check that any other process leaks are caught*/
 	ret = do_fork(plain_fork_leak);
-	internal_assert(WTERMSIG(ret) == SIGABRT);
+	internal_assert_wsignaled(ret, SIGABRT);
 }
diff --git a/lib/tests/igt_segfault.c b/lib/tests/igt_segfault.c
index bfbbff564fac..2a24531aaa8c 100644
--- a/lib/tests/igt_segfault.c
+++ b/lib/tests/igt_segfault.c
@@ -94,10 +94,7 @@ static int do_fork(void)
 		       errno == EINTR)
 			;
 
-		if(WIFSIGNALED(status))
-			return WTERMSIG(status) + 128;
-
-		return WEXITSTATUS(status);
+		return status;
 	}
 }
 
@@ -109,20 +106,20 @@ int main(int argc, char **argv)
 	runc=false;
 	igt_info("Simple test.\n");
 	fflush(stdout);
-	internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
+	internal_assert_wsignaled(do_fork(), SIGSEGV);
 
 	/* Test crash in a single subtest is reported */
 	simple = false;
 	igt_info("Single subtest.\n");
 	fflush(stdout);
-	internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
+	internal_assert_wexited(do_fork(), SIGSEGV + 128);
 
 	/* Test crash in a subtest following a pass is reported */
 	simple = false;
 	runa=true;
 	igt_info("Passing then crashing subtest.\n");
 	fflush(stdout);
-	internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
+	internal_assert_wexited(do_fork(), SIGSEGV + 128);
 
 	/* Test crash in a subtest preceeding a pass is reported */
 	simple = false;
@@ -130,8 +127,7 @@ int main(int argc, char **argv)
 	runc=true;
 	igt_info("Crashing then passing subtest.\n");
 	fflush(stdout);
-	internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
+	internal_assert_wexited(do_fork(), SIGSEGV + 128);
 
 	return 0;
 }
-
diff --git a/lib/tests/igt_tests_common.h b/lib/tests/igt_tests_common.h
index 9b347a4565d9..e66ee37c0331 100644
--- a/lib/tests/igt_tests_common.h
+++ b/lib/tests/igt_tests_common.h
@@ -35,4 +35,15 @@
  */
 #define internal_assert assert
 
+static inline void internal_assert_wexited(int wstatus, int exitcode)
+{
+	internal_assert(WIFEXITED(wstatus) &&
+			WEXITSTATUS(wstatus) == exitcode);
+}
+
+static inline void internal_assert_wsignaled(int wstatus, int signal)
+{
+	internal_assert(WIFSIGNALED(wstatus) &&
+			WTERMSIG(wstatus) == signal);
+}
 #endif
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 3/5] tests: drop invalid name build checks
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled Daniel Vetter
@ 2019-02-19  7:57 ` Daniel Vetter
  2019-02-19  9:06   ` Arkadiusz Hiler
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 4/5] lib/tests: Convert no_exit tests into positive tests Daniel Vetter
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2019-02-19  7:57 UTC (permalink / raw)
  To: IGT development; +Cc: Petri Latvala, Daniel Vetter

They're causing troubles because this runs all the igt_fixtures, and
doing that on a build machine is at best surprising.

The main aim for this is catching testcases which fail to call
igt_exit. But just enumerating subtests does that too, and we have
library unit tests to make sure that's the case (with igt_no_exit and
igt_no_exit_list_only).

Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 tests/igt_command_line.sh | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index e05ec34ce321..92643c4d5e16 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -94,10 +94,6 @@ check_test ()
 			fail $test
 		fi
 	fi
-
-	# check invalid subtest handling
-	echo "  Checking invalid subtest handling..."
-	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
 }
 
 TESTLISTFILE="$tests_dir/test-list.txt"
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 4/5] lib/tests: Convert no_exit tests into positive tests
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled Daniel Vetter
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 3/5] tests: drop invalid name build checks Daniel Vetter
@ 2019-02-19  7:57 ` Daniel Vetter
  2019-02-20 11:10   ` Arkadiusz Hiler
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name Daniel Vetter
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2019-02-19  7:57 UTC (permalink / raw)
  To: IGT development; +Cc: Daniel Vetter

This way we can make sure they die with an assert, which is what we
want.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/tests/igt_no_exit.c           | 50 ++++++++++++++++++++++++++++++-
 lib/tests/igt_no_exit_list_only.c | 41 -------------------------
 lib/tests/meson.build             | 17 +++++------
 3 files changed, 57 insertions(+), 51 deletions(-)
 delete mode 100644 lib/tests/igt_no_exit_list_only.c

diff --git a/lib/tests/igt_no_exit.c b/lib/tests/igt_no_exit.c
index dc89b8302a71..4a777412b6a9 100644
--- a/lib/tests/igt_no_exit.c
+++ b/lib/tests/igt_no_exit.c
@@ -25,9 +25,26 @@
  *
  */
 
+#include <sys/wait.h>
+
 #include "drmtest.h"
 
-int main(int argc, char **argv)
+#include "igt_tests_common.h"
+
+static void no_exit_list_only(void)
+{
+	char prog[] = "igt_list_only";
+	char arg[] = "--list-subtests";
+	char *fake_argv[] = {prog, arg};
+	int fake_argc = 2;
+
+	igt_subtest_init(fake_argc, fake_argv);
+
+	igt_subtest("A")
+		;
+}
+
+static void no_exit(void)
 {
 	char prog[] = "igt_no_exit";
 	char *fake_argv[] = {prog};
@@ -38,3 +55,34 @@ int main(int argc, char **argv)
 	igt_subtest("A")
 		;
 }
+
+static int do_fork(void (*test_to_run)(void))
+{
+	int pid, status;
+
+	switch (pid = fork()) {
+	case -1:
+		internal_assert(0);
+	case 0:
+		test_to_run();
+	default:
+		while (waitpid(pid, &status, 0) == -1 &&
+		       errno == EINTR)
+			;
+
+		return status;
+	}
+}
+
+int main(int argc, char **argv)
+{
+	int ret;
+
+	ret = do_fork(no_exit);
+	internal_assert_wsignaled(ret, SIGABRT);
+
+	ret = do_fork(no_exit_list_only);
+	internal_assert_wsignaled(ret, SIGABRT);
+
+	return 0;
+}
diff --git a/lib/tests/igt_no_exit_list_only.c b/lib/tests/igt_no_exit_list_only.c
deleted file mode 100644
index add3fc257e66..000000000000
--- a/lib/tests/igt_no_exit_list_only.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright © 2013 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- *    Daniel Vetter <daniel.vetter@ffwll.ch>
- *
- */
-
-#include "drmtest.h"
-
-int main(int argc, char **argv)
-{
-	char prog[] = "igt_list_only";
-	char arg[] = "--list-subtests";
-	char *fake_argv[] = {prog, arg};
-	int fake_argc = 2;
-
-	igt_subtest_init(fake_argc, fake_argv);
-
-	igt_subtest("A")
-		;
-}
diff --git a/lib/tests/meson.build b/lib/tests/meson.build
index 665ad4a0fbcc..776b63ed1fd4 100644
--- a/lib/tests/meson.build
+++ b/lib/tests/meson.build
@@ -1,21 +1,20 @@
 lib_tests = [
-	'igt_fork_helper',
+	'igt_assert',
+	'igt_can_fail',
+	'igt_can_fail_simple',
+	'igt_exit_handler',
 	'igt_fork',
+	'igt_fork_helper',
+	'igt_hdmi_inject',
 	'igt_list_only',
+	'igt_no_exit',
+	'igt_segfault',
 	'igt_simulation',
 	'igt_stats',
-	'igt_segfault',
 	'igt_subtest_group',
-	'igt_assert',
-	'igt_exit_handler',
-	'igt_hdmi_inject',
-	'igt_can_fail',
-	'igt_can_fail_simple',
 ]
 
 lib_fail_tests = [
-	'igt_no_exit',
-	'igt_no_exit_list_only',
 	'igt_no_subtest',
 	'igt_simple_test_subtests',
 	'igt_timeout',
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
                   ` (2 preceding siblings ...)
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 4/5] lib/tests: Convert no_exit tests into positive tests Daniel Vetter
@ 2019-02-19  7:57 ` Daniel Vetter
  2019-02-20 11:22   ` Arkadiusz Hiler
  2019-02-19  8:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/tests: Add header for common helpers Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2019-02-19  7:57 UTC (permalink / raw)
  To: IGT development; +Cc: Daniel Vetter

While at it, convert the existing testcase for invalid subtest names
to a positive one.

This is the only thing the invalid subtest checking for all tests did
cover, which wasn't covered through some other checks already.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/tests/igt_invalid_subtest_name.c | 62 +++++++++++++++++++++++++++-
 lib/tests/meson.build                |  2 +-
 2 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/lib/tests/igt_invalid_subtest_name.c b/lib/tests/igt_invalid_subtest_name.c
index 418071da0591..f962e0df0121 100644
--- a/lib/tests/igt_invalid_subtest_name.c
+++ b/lib/tests/igt_invalid_subtest_name.c
@@ -21,11 +21,71 @@
  * IN THE SOFTWARE.
  */
 
+#include <errno.h>
+#include <sys/wait.h>
+
 #include "igt_core.h"
 
-igt_main
+#include "igt_tests_common.h"
+
+static void invalid_subtest_name(void)
 {
+	char prog[] = "igt_no_exit";
+	char *fake_argv[] = {prog};
+	int fake_argc = 1;
+
+	igt_subtest_init(fake_argc, fake_argv);
+
 	igt_subtest("# invalid name !") {
 		igt_info("Invalid subtest name test\n");
 	}
+
+	igt_exit();
+}
+
+static void nonexisting_subtest(void)
+{
+	char prog[] = "igt_no_exit";
+	char arg1[] = "--run-subtest";
+	char arg2[] = "invalid-subtest";
+	char *fake_argv[] = {prog, arg1, arg2};
+	int fake_argc = 3;
+
+	igt_subtest_init(fake_argc, fake_argv);
+
+	igt_subtest("some-subtest")
+		;
+
+	igt_exit();
+}
+
+static int do_fork(void (*test_to_run)(void))
+{
+	int pid, status;
+
+	switch (pid = fork()) {
+	case -1:
+		internal_assert(0);
+	case 0:
+		test_to_run();
+	default:
+		while (waitpid(pid, &status, 0) == -1 &&
+		       errno == EINTR)
+			;
+
+		return status;
+	}
+}
+
+int main(int argc, char **argv)
+{
+	int ret;
+
+	ret = do_fork(invalid_subtest_name);
+	internal_assert_wsignaled(ret, SIGABRT);
+
+	ret = do_fork(nonexisting_subtest);
+	internal_assert_wexited(ret, IGT_EXIT_INVALID);
+
+	return 0;
 }
diff --git a/lib/tests/meson.build b/lib/tests/meson.build
index 776b63ed1fd4..74efce396cec 100644
--- a/lib/tests/meson.build
+++ b/lib/tests/meson.build
@@ -7,6 +7,7 @@ lib_tests = [
 	'igt_fork_helper',
 	'igt_hdmi_inject',
 	'igt_list_only',
+	'igt_invalid_subtest_name',
 	'igt_no_exit',
 	'igt_segfault',
 	'igt_simulation',
@@ -18,7 +19,6 @@ lib_fail_tests = [
 	'igt_no_subtest',
 	'igt_simple_test_subtests',
 	'igt_timeout',
-	'igt_invalid_subtest_name',
 ]
 
 foreach lib_test : lib_tests
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/tests: Add header for common helpers
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
                   ` (3 preceding siblings ...)
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name Daniel Vetter
@ 2019-02-19  8:41 ` Patchwork
  2019-02-19  9:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2019-02-20 11:09 ` [igt-dev] [PATCH i-g-t 1/5] " Arkadiusz Hiler
  6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2019-02-19  8:41 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/5] lib/tests: Add header for common helpers
URL   : https://patchwork.freedesktop.org/series/56878/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5629 -> IGTPW_2440
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56878/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2440 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       PASS -> FAIL [fdo#109485]

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-kbl-7560u:       PASS -> FAIL [fdo#103375]

  
#### Possible fixes ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-kbl-7567u:       DMESG-WARN [fdo#105602] / [fdo#108529] -> PASS +1

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7567u:       DMESG-FAIL [fdo#105079] -> PASS

  * igt@kms_chamelium@hdmi-crc-fast:
    - fi-kbl-7500u:       FAIL -> PASS

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
    - fi-kbl-7567u:       {SKIP} [fdo#109271] -> PASS +33

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS +1

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
    - fi-ivb-3770:        {SKIP} [fdo#109271] -> PASS

  * igt@pm_rpm@module-reload:
    - fi-kbl-7567u:       DMESG-WARN [fdo#108529] -> PASS
    - {fi-icl-y}:         INCOMPLETE [fdo#108840] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108529]: https://bugs.freedesktop.org/show_bug.cgi?id=108529
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485


Participating hosts (46 -> 41)
------------------------------

  Additional (1): fi-pnv-d510 
  Missing    (6): fi-kbl-soraka fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan 


Build changes
-------------

    * IGT: IGT_4836 -> IGTPW_2440

  CI_DRM_5629: e5bd5364ce58650dc664ee250629aa902dfe64ac @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2440: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2440/
  IGT_4836: 51d069e07b3f7697f06fa8947ee92a196356d8b3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2440/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled Daniel Vetter
@ 2019-02-19  8:52   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2019-02-19  8:52 UTC (permalink / raw)
  To: Daniel Vetter, IGT development

Quoting Daniel Vetter (2019-02-19 07:57:13)
> And convert everything over.
> 
> igt_segfault needed a bit of care to differentiate between a real
> death-by-signal and igt_exit mapping a child process signal death to
> an exit code.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  lib/tests/igt_assert.c       |  4 ++--
>  lib/tests/igt_exit_handler.c |  6 +++---
>  lib/tests/igt_fork.c         | 10 +++++-----
>  lib/tests/igt_segfault.c     | 14 +++++---------
>  lib/tests/igt_tests_common.h | 11 +++++++++++
>  5 files changed, 26 insertions(+), 19 deletions(-)
> 
> diff --git a/lib/tests/igt_assert.c b/lib/tests/igt_assert.c
> index e3c1ec49daf2..632e15978978 100644
> --- a/lib/tests/igt_assert.c
> +++ b/lib/tests/igt_assert.c
> @@ -151,7 +151,7 @@ igt_main
>         test_to_run = test_cmpint_negative;
>         ret = do_fork();
>         igt_subtest("igt_cmpint_negative")
> -               internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
> +               internal_assert_wexited(ret, IGT_EXIT_FAILURE);
>  
>         igt_subtest("igt_assert_fd")
>                 test_fd();
> @@ -159,5 +159,5 @@ igt_main
>         test_to_run = test_fd_negative;
>         ret = do_fork();
>         igt_subtest("igt_assert_fd_negative")
> -               internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
> +               internal_assert_wexited(ret, IGT_EXIT_FAILURE);

Ok, exit -> exit.

>  }
> diff --git a/lib/tests/igt_exit_handler.c b/lib/tests/igt_exit_handler.c
> index 7546fde6d6f8..f8a747862c01 100644
> --- a/lib/tests/igt_exit_handler.c
> +++ b/lib/tests/igt_exit_handler.c
> @@ -118,11 +118,11 @@ int main(int argc, char **argv)
>         internal_assert(testfunc(NORMAL) == 0);
>  
>         status = testfunc(FAIL);
> -       assert(WIFEXITED(status) && WEXITSTATUS(status) == 1);
> +       internal_assert_wexited(status, 1);
>  
>         status = testfunc(SKIP);
> -       assert(WIFEXITED(status) && WEXITSTATUS(status) == IGT_EXIT_SKIP);
> +       internal_assert_wexited(status, IGT_EXIT_SKIP);
>  
>         status = testfunc(SIG);
> -       assert(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM);
> +       internal_assert_wsignaled(status, SIGTERM);
>  }

Ok.

> diff --git a/lib/tests/igt_fork.c b/lib/tests/igt_fork.c
> index 38c55d11f7ec..100031207461 100644
> --- a/lib/tests/igt_fork.c
> +++ b/lib/tests/igt_fork.c
> @@ -113,21 +113,21 @@ int main(int argc, char **argv)
>  
>         /* check that igt_assert is forwarded */
>         ret = do_fork(igt_fork_vs_assert);
> -       internal_assert(WEXITSTATUS(ret) == IGT_EXIT_FAILURE);
> +       internal_assert_wexited(ret, IGT_EXIT_FAILURE);
>  
>         /* check that igt_skip within a fork blows up */
>         ret = do_fork(igt_fork_vs_skip);
> -       internal_assert(WEXITSTATUS(ret) == SIGABRT + 128);
> +       internal_assert_wexited(ret, SIGABRT + 128);
>  
>         /* check that failure to clean up fails */
>         ret = do_fork(igt_fork_leak);
> -       internal_assert(WTERMSIG(ret) == SIGABRT);
> +       internal_assert_wsignaled(ret, SIGABRT);
>  
>         /* check that igt_waitchildren_timeout cleans up*/
>         ret = do_fork(igt_fork_timeout_leak);
> -       internal_assert(WEXITSTATUS(ret) == SIGKILL + 128);
> +       internal_assert_wexited(ret, SIGKILL + 128);
>  
>         /* check that any other process leaks are caught*/
>         ret = do_fork(plain_fork_leak);
> -       internal_assert(WTERMSIG(ret) == SIGABRT);
> +       internal_assert_wsignaled(ret, SIGABRT);
>  }

Ok.

> diff --git a/lib/tests/igt_segfault.c b/lib/tests/igt_segfault.c
> index bfbbff564fac..2a24531aaa8c 100644
> --- a/lib/tests/igt_segfault.c
> +++ b/lib/tests/igt_segfault.c
> @@ -94,10 +94,7 @@ static int do_fork(void)
>                        errno == EINTR)
>                         ;
>  
> -               if(WIFSIGNALED(status))
> -                       return WTERMSIG(status) + 128;
> -
> -               return WEXITSTATUS(status);
> +               return status;
>         }
>  }
>  
> @@ -109,20 +106,20 @@ int main(int argc, char **argv)
>         runc=false;
>         igt_info("Simple test.\n");
>         fflush(stdout);
> -       internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
> +       internal_assert_wsignaled(do_fork(), SIGSEGV);
>  
>         /* Test crash in a single subtest is reported */
>         simple = false;
>         igt_info("Single subtest.\n");
>         fflush(stdout);
> -       internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
> +       internal_assert_wexited(do_fork(), SIGSEGV + 128);
>  
>         /* Test crash in a subtest following a pass is reported */
>         simple = false;
>         runa=true;
>         igt_info("Passing then crashing subtest.\n");
>         fflush(stdout);
> -       internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
> +       internal_assert_wexited(do_fork(), SIGSEGV + 128);
>  
>         /* Test crash in a subtest preceeding a pass is reported */
>         simple = false;
> @@ -130,8 +127,7 @@ int main(int argc, char **argv)
>         runc=true;
>         igt_info("Crashing then passing subtest.\n");
>         fflush(stdout);
> -       internal_assert(WTERMSIG(do_fork()) == SIGSEGV);
> +       internal_assert_wexited(do_fork(), SIGSEGV + 128);

Ok.

>         return 0;
>  }
> -
> diff --git a/lib/tests/igt_tests_common.h b/lib/tests/igt_tests_common.h
> index 9b347a4565d9..e66ee37c0331 100644
> --- a/lib/tests/igt_tests_common.h
> +++ b/lib/tests/igt_tests_common.h
> @@ -35,4 +35,15 @@
>   */
>  #define internal_assert assert
>  
> +static inline void internal_assert_wexited(int wstatus, int exitcode)
> +{
> +       internal_assert(WIFEXITED(wstatus) &&
> +                       WEXITSTATUS(wstatus) == exitcode);
> +}
> +
> +static inline void internal_assert_wsignaled(int wstatus, int signal)
> +{
> +       internal_assert(WIFSIGNALED(wstatus) &&
> +                       WTERMSIG(wstatus) == signal);
> +}
>  #endif

Ok. internal_assert_f() ? ;)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 3/5] tests: drop invalid name build checks
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 3/5] tests: drop invalid name build checks Daniel Vetter
@ 2019-02-19  9:06   ` Arkadiusz Hiler
  0 siblings, 0 replies; 13+ messages in thread
From: Arkadiusz Hiler @ 2019-02-19  9:06 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: IGT development, Daniel Vetter, Petri Latvala

On Tue, Feb 19, 2019 at 08:57:14AM +0100, Daniel Vetter wrote:
> They're causing troubles because this runs all the igt_fixtures, and
> doing that on a build machine is at best surprising.
> 
> The main aim for this is catching testcases which fail to call
> igt_exit. But just enumerating subtests does that too, and we have
> library unit tests to make sure that's the case (with igt_no_exit and
> igt_no_exit_list_only).
> 
> Cc: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/5] lib/tests: Add header for common helpers
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
                   ` (4 preceding siblings ...)
  2019-02-19  8:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/tests: Add header for common helpers Patchwork
@ 2019-02-19  9:48 ` Patchwork
  2019-02-20 11:09 ` [igt-dev] [PATCH i-g-t 1/5] " Arkadiusz Hiler
  6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2019-02-19  9:48 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/5] lib/tests: Add header for common helpers
URL   : https://patchwork.freedesktop.org/series/56878/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5629_full -> IGTPW_2440_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56878/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_2440_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
    - shard-hsw:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-pageflip-hang-newfb-render-a:
    - shard-glk:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_cursor_crc@cursor-128x128-random:
    - shard-kbl:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_crc@cursor-128x42-onscreen:
    - shard-apl:          PASS -> FAIL [fdo#103232] +3

  * igt@kms_cursor_crc@cursor-256x256-dpms:
    - shard-glk:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-gtt:
    - shard-kbl:          NOTRUN -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
    - shard-apl:          PASS -> FAIL [fdo#103167] +2

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - shard-glk:          PASS -> FAIL [fdo#103167] +4

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-blt:
    - shard-snb:          NOTRUN -> INCOMPLETE [fdo#105411] / [fdo#107469]

  * igt@kms_plane@pixel-format-pipe-c-planes-source-clamping:
    - shard-apl:          PASS -> FAIL [fdo#108948] +1

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
    - shard-kbl:          PASS -> INCOMPLETE [fdo#103665] +1

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-glk:          NOTRUN -> FAIL [fdo#108145]

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-kbl:          PASS -> FAIL [fdo#103166] +1

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
    - shard-glk:          PASS -> FAIL [fdo#103166] +3

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-apl:          PASS -> FAIL [fdo#103166] +4

  
#### Possible fixes ####

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
    - shard-apl:          FAIL [fdo#109660] -> PASS

  * igt@kms_color@pipe-a-legacy-gamma:
    - shard-apl:          FAIL [fdo#104782] / [fdo#108145] -> PASS

  * igt@kms_cursor_crc@cursor-256x256-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +4

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-kbl:          FAIL [fdo#103191] / [fdo#103232] -> PASS
    - shard-apl:          FAIL [fdo#103191] / [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-64x64-onscreen:
    - shard-kbl:          FAIL [fdo#103232] -> PASS +2

  * igt@kms_flip@plain-flip-ts-check:
    - shard-kbl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +18

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
    - shard-apl:          FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          FAIL [fdo#103167] -> PASS +4

  * igt@kms_plane@pixel-format-pipe-c-planes:
    - shard-apl:          FAIL [fdo#103166] -> PASS +3

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-yf:
    - shard-glk:          FAIL [fdo#103166] -> PASS

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-kbl:          FAIL [fdo#109016] -> PASS

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * igt@kms_vblank@pipe-b-ts-continuation-modeset-rpm:
    - shard-apl:          FAIL [fdo#104894] -> PASS +1

  * igt@perf_pmu@rc6-runtime-pm-long:
    - shard-glk:          FAIL [fdo#105010] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#107469]: https://bugs.freedesktop.org/show_bug.cgi?id=107469
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


Build changes
-------------

    * IGT: IGT_4836 -> IGTPW_2440
    * Piglit: piglit_4509 -> None

  CI_DRM_5629: e5bd5364ce58650dc664ee250629aa902dfe64ac @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2440: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2440/
  IGT_4836: 51d069e07b3f7697f06fa8947ee92a196356d8b3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2440/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers
  2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
                   ` (5 preceding siblings ...)
  2019-02-19  9:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-02-20 11:09 ` Arkadiusz Hiler
  6 siblings, 0 replies; 13+ messages in thread
From: Arkadiusz Hiler @ 2019-02-20 11:09 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: IGT development, Daniel Vetter

On Tue, Feb 19, 2019 at 08:57:12AM +0100, Daniel Vetter wrote:
> Start with internal_assert, more will follow. While at it, use
> internal_assert everywhere (except where we check exit status, those
> will get dedicated assert checks).
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 4/5] lib/tests: Convert no_exit tests into positive tests
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 4/5] lib/tests: Convert no_exit tests into positive tests Daniel Vetter
@ 2019-02-20 11:10   ` Arkadiusz Hiler
  0 siblings, 0 replies; 13+ messages in thread
From: Arkadiusz Hiler @ 2019-02-20 11:10 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: IGT development, Daniel Vetter

On Tue, Feb 19, 2019 at 08:57:15AM +0100, Daniel Vetter wrote:
> This way we can make sure they die with an assert, which is what we
> want.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  lib/tests/igt_no_exit.c           | 50 ++++++++++++++++++++++++++++++-
>  lib/tests/igt_no_exit_list_only.c | 41 -------------------------
>  lib/tests/meson.build             | 17 +++++------
>  3 files changed, 57 insertions(+), 51 deletions(-)
>  delete mode 100644 lib/tests/igt_no_exit_list_only.c
> 
> diff --git a/lib/tests/igt_no_exit.c b/lib/tests/igt_no_exit.c
> index dc89b8302a71..4a777412b6a9 100644
> --- a/lib/tests/igt_no_exit.c
> +++ b/lib/tests/igt_no_exit.c
> @@ -25,9 +25,26 @@
>   *
>   */
>  
> +#include <sys/wait.h>
> +
>  #include "drmtest.h"
>  
> -int main(int argc, char **argv)
> +#include "igt_tests_common.h"
> +
> +static void no_exit_list_only(void)
> +{
> +	char prog[] = "igt_list_only";
> +	char arg[] = "--list-subtests";
> +	char *fake_argv[] = {prog, arg};
> +	int fake_argc = 2;

ARRAY_SIZE(fake_argv) ?

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name
  2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name Daniel Vetter
@ 2019-02-20 11:22   ` Arkadiusz Hiler
  2019-02-20 12:57     ` Daniel Vetter
  0 siblings, 1 reply; 13+ messages in thread
From: Arkadiusz Hiler @ 2019-02-20 11:22 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: IGT development, Daniel Vetter

On Tue, Feb 19, 2019 at 08:57:16AM +0100, Daniel Vetter wrote:
> While at it, convert the existing testcase for invalid subtest names
> to a positive one.
> 
> This is the only thing the invalid subtest checking for all tests did
> cover, which wasn't covered through some other checks already.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  lib/tests/igt_invalid_subtest_name.c | 62 +++++++++++++++++++++++++++-
>  lib/tests/meson.build                |  2 +-
>  2 files changed, 62 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/tests/igt_invalid_subtest_name.c b/lib/tests/igt_invalid_subtest_name.c
> index 418071da0591..f962e0df0121 100644
> --- a/lib/tests/igt_invalid_subtest_name.c
> +++ b/lib/tests/igt_invalid_subtest_name.c
> @@ -21,11 +21,71 @@
>   * IN THE SOFTWARE.
>   */
>  
> +#include <errno.h>
> +#include <sys/wait.h>
> +
>  #include "igt_core.h"
>  
> -igt_main
> +#include "igt_tests_common.h"
> +
> +static void invalid_subtest_name(void)
>  {
> +	char prog[] = "igt_no_exit";
> +	char *fake_argv[] = {prog};
> +	int fake_argc = 1;

Same thing with ARRAY_SIZE as in 4/5, but that in those trivial cases
it's just sugar.

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name
  2019-02-20 11:22   ` Arkadiusz Hiler
@ 2019-02-20 12:57     ` Daniel Vetter
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2019-02-20 12:57 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: IGT development, Daniel Vetter

On Wed, Feb 20, 2019 at 01:22:27PM +0200, Arkadiusz Hiler wrote:
> On Tue, Feb 19, 2019 at 08:57:16AM +0100, Daniel Vetter wrote:
> > While at it, convert the existing testcase for invalid subtest names
> > to a positive one.
> > 
> > This is the only thing the invalid subtest checking for all tests did
> > cover, which wasn't covered through some other checks already.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  lib/tests/igt_invalid_subtest_name.c | 62 +++++++++++++++++++++++++++-
> >  lib/tests/meson.build                |  2 +-
> >  2 files changed, 62 insertions(+), 2 deletions(-)
> > 
> > diff --git a/lib/tests/igt_invalid_subtest_name.c b/lib/tests/igt_invalid_subtest_name.c
> > index 418071da0591..f962e0df0121 100644
> > --- a/lib/tests/igt_invalid_subtest_name.c
> > +++ b/lib/tests/igt_invalid_subtest_name.c
> > @@ -21,11 +21,71 @@
> >   * IN THE SOFTWARE.
> >   */
> >  
> > +#include <errno.h>
> > +#include <sys/wait.h>
> > +
> >  #include "igt_core.h"
> >  
> > -igt_main
> > +#include "igt_tests_common.h"
> > +
> > +static void invalid_subtest_name(void)
> >  {
> > +	char prog[] = "igt_no_exit";
> > +	char *fake_argv[] = {prog};
> > +	int fake_argc = 1;
> 
> Same thing with ARRAY_SIZE as in 4/5, but that in those trivial cases
> it's just sugar.

There's more than these two in lib/tests, I'll do a follow-up patch.

> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Thanks for your and Chris' reviews, series merged.
-Daniel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-02-20 12:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19  7:57 [igt-dev] [PATCH i-g-t 1/5] lib/tests: Add header for common helpers Daniel Vetter
2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests: add internal_assert_wexited/wsignaled Daniel Vetter
2019-02-19  8:52   ` Chris Wilson
2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 3/5] tests: drop invalid name build checks Daniel Vetter
2019-02-19  9:06   ` Arkadiusz Hiler
2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 4/5] lib/tests: Convert no_exit tests into positive tests Daniel Vetter
2019-02-20 11:10   ` Arkadiusz Hiler
2019-02-19  7:57 ` [igt-dev] [PATCH i-g-t 5/5] lib/tests: Add testcase for nonexisting subtest name Daniel Vetter
2019-02-20 11:22   ` Arkadiusz Hiler
2019-02-20 12:57     ` Daniel Vetter
2019-02-19  8:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/tests: Add header for common helpers Patchwork
2019-02-19  9:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-20 11:09 ` [igt-dev] [PATCH i-g-t 1/5] " Arkadiusz Hiler

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.