From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 3/8] lib/tests: Test that igt_describe works with dynamic subtests
Date: Thu, 24 Oct 2019 14:05:41 +0300 [thread overview]
Message-ID: <20191024110546.25569-4-petri.latvala@intel.com> (raw)
In-Reply-To: <20191024110546.25569-1-petri.latvala@intel.com>
v2: Also test that calling igt_describe in a dynamic context asserts
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
lib/tests/igt_describe.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/lib/tests/igt_describe.c b/lib/tests/igt_describe.c
index 2ea47e9d..5e40569f 100644
--- a/lib/tests/igt_describe.c
+++ b/lib/tests/igt_describe.c
@@ -87,6 +87,14 @@ static void fake_main(int argc, char **argv) {
igt_subtest("F")
;
+ igt_describe("Subtest with dynamic subsubtests");
+ igt_subtest_with_dynamic_subsubtests("G") {
+ printf("should not be executed!\n");
+ igt_describe("should assert on execution");
+ igt_dynamic_subsubtest("should-not-list")
+ printf("should not be executed!\n");
+ }
+
igt_exit();
}
@@ -129,7 +137,10 @@ static const char DESCRIBE_ALL_OUTPUT[] = \
"\n"
"SUB F ../lib/tests/igt_describe.c:87:\n"
" verylongwordthatshoudlbeprintedeventhoughitspastthewrppinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n"
- " verylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n\n";
+ " verylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n"
+ "\n"
+ "SUB G ../lib/tests/igt_describe.c:91:\n"
+ " Subtest with dynamic subsubtests\n\n";
static const char JUST_C_OUTPUT[] = \
"the top level description\n"
@@ -278,5 +289,22 @@ int main(int argc, char **argv)
close(errfd);
}
+ /* trying to igt_describe a dynamic subsubtest should assert */ {
+ static char err[4096];
+ char arg[] = "--run-subtest=G";
+ char *fake_argv[] = {prog, arg};
+ int fake_argc = ARRAY_SIZE(fake_argv);
+
+ pid_t pid = do_fork(fake_argc, fake_argv, &outfd, &errfd);
+
+ read_whole_pipe(errfd, err, sizeof(err));
+
+ internal_assert(_wait(pid, &status) != -1);
+ internal_assert_wsignaled(status, SIGABRT);
+
+ close(outfd);
+ close(errfd);
+ }
+
return 0;
}
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-10-24 11:05 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 11:05 [igt-dev] [PATCH i-g-t 0/8] Dynamic subtests, v3 Petri Latvala
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 1/8] lib: Introduce dynamic subsubtests Petri Latvala
2019-10-25 7:49 ` Arkadiusz Hiler
2019-11-11 10:11 ` [igt-dev] [PATCH i-g-t v4 " Petri Latvala
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 2/8] lib/tests: Unit tests for dynamic subtests Petri Latvala
2019-10-25 8:05 ` Arkadiusz Hiler
2019-10-24 11:05 ` Petri Latvala [this message]
2019-10-25 9:35 ` [igt-dev] [PATCH i-g-t 3/8] lib/tests: Test that igt_describe works with " Arkadiusz Hiler
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 4/8] runner: Parse dynamic subtest outputs and results Petri Latvala
2019-10-25 11:03 ` Arkadiusz Hiler
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 5/8] runner/json_tests: Test dynamic subtests Petri Latvala
2019-10-25 11:22 ` Arkadiusz Hiler
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 6/8] kms_plane_cursor: Use " Petri Latvala
2019-11-08 16:15 ` Katarzyna Dec
2019-11-14 12:03 ` Petri Latvala
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 7/8] perf_pmu: " Petri Latvala
2019-11-08 16:13 ` Katarzyna Dec
2019-11-08 16:27 ` Tvrtko Ursulin
2019-10-24 11:05 ` [igt-dev] [PATCH i-g-t 8/8] i915/gem_exec_basic: " Petri Latvala
2019-11-05 9:24 ` Katarzyna Dec
2019-11-08 16:31 ` Tvrtko Ursulin
2019-11-08 16:33 ` Tvrtko Ursulin
2019-11-11 10:06 ` Petri Latvala
2019-11-11 10:36 ` Tvrtko Ursulin
2019-10-24 13:50 ` [igt-dev] ✗ GitLab.Pipeline: warning for Dynamic subtests (rev3) Patchwork
2019-10-24 13:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-10-25 19:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-11-11 11:22 ` [igt-dev] ✓ Fi.CI.BAT: success for Dynamic subtests (rev4) Patchwork
2019-11-11 13:51 ` [igt-dev] ✗ GitLab.Pipeline: failure " Patchwork
2019-11-11 20:15 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191024110546.25569-4-petri.latvala@intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox