[igt-dev] [PATCH i-g-t 3/4] runner_tests: Add new mockup test binary

Petri Latvala petri.latvala at intel.com
Tue Jan 14 09:17:44 UTC 2020


'dynamic' is a new mockup test binary. It has one subtest with two
dynamic subtests, first of which will fail.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
 runner/runner_tests.c       |  4 ++--
 runner/testdata/dynamic.c   | 12 ++++++++++++
 runner/testdata/meson.build |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 runner/testdata/dynamic.c

diff --git a/runner/runner_tests.c b/runner/runner_tests.c
index 9bbc4252..a232aa2b 100644
--- a/runner/runner_tests.c
+++ b/runner/runner_tests.c
@@ -25,9 +25,9 @@ static const char testdatadir[] = TESTDATA_DIRECTORY;
  * that test binaries without subtests should still be counted as one
  * for this macro.
  */
-#define NUM_TESTDATA_SUBTESTS 5
+#define NUM_TESTDATA_SUBTESTS 6
 /* The total number of test binaries in runner/testdata/ */
-#define NUM_TESTDATA_BINARIES 3
+#define NUM_TESTDATA_BINARIES 4
 
 static void igt_assert_eqstr(const char *one, const char *two)
 {
diff --git a/runner/testdata/dynamic.c b/runner/testdata/dynamic.c
new file mode 100644
index 00000000..8e5de7d9
--- /dev/null
+++ b/runner/testdata/dynamic.c
@@ -0,0 +1,12 @@
+#include "igt.h"
+
+igt_main
+{
+	igt_subtest_with_dynamic("dynamic-subtest") {
+		igt_dynamic("failing")
+			igt_assert(false);
+
+		igt_dynamic("passing")
+			;
+	}
+}
diff --git a/runner/testdata/meson.build b/runner/testdata/meson.build
index 2456f82a..631ba5b9 100644
--- a/runner/testdata/meson.build
+++ b/runner/testdata/meson.build
@@ -2,6 +2,7 @@
 testdata_progs = [ 'successtest',
 		   'no-subtests',
 		   'skippers',
+		   'dynamic',
 		 ]
 
 testdata_executables = []
-- 
2.20.1



More information about the igt-dev mailing list