summaryrefslogtreecommitdiff
path: root/tests/testdisplay.c
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2014-07-31 16:26:55 +0100
committerThomas Wood <thomas.wood@intel.com>2014-07-31 16:30:01 +0100
commitff6b068ecd1d231af466d043454279e6cddcb3d1 (patch)
tree946e18162c0a5f08944ada8b470bc73df414ee6b /tests/testdisplay.c
parentde1e877be5fe9ac83477a8ca416708f3d078b731 (diff)
testdisplay: ignore invalid subtest options
testdisplay does not have any subtests and should therefore exit with the appropriate exit code if the --list-subtests or --run-subtest options are used. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'tests/testdisplay.c')
-rw-r--r--tests/testdisplay.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index a187c16e..f26d9425 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -71,6 +71,8 @@
#include <stdlib.h>
#include <signal.h>
+#define SUBTEST_OPTS 1
+
static int tio_fd;
struct termios saved_tio;
@@ -748,12 +750,17 @@ int main(int argc, char **argv)
GMainLoop *mainloop;
float force_clock;
bool opt_dump_info = false;
+ struct option long_opts[] = {
+ {"list-subtests", 0, 0, SUBTEST_OPTS},
+ {"run-subtest", 1, 0, SUBTEST_OPTS},
+ { 0, 0, 0, 0 }
+ };
igt_skip_on_simulation();
enter_exec_path( argv );
- while ((c = getopt(argc, argv, optstr)) != -1) {
+ while ((c = getopt_long(argc, argv, optstr, long_opts, NULL)) != -1) {
switch (c) {
case '3':
test_stereo_modes = 1;
@@ -804,6 +811,10 @@ int main(int argc, char **argv)
case 'o':
sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num);
break;
+ case SUBTEST_OPTS:
+ /* invalid subtest options */
+ exit(IGT_EXIT_INVALID);
+ break;
default:
/* fall through */
case 'h':