[PATCH v1 weston 05/11] tests: Allow tests to use customized command line parameters

Bryce Harrington bryce at osg.samsung.com
Wed Nov 19 15:06:20 PST 2014


From: Derek Foreman <derekf at osg.samsung.com>

Tests will now return the extra command line parameters they need
when run with --params

Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
---
 tests/weston-test-runner.c | 8 ++++++++
 tests/weston-tests-env     | 1 +
 2 files changed, 9 insertions(+)

diff --git a/tests/weston-test-runner.c b/tests/weston-test-runner.c
index ef45bae..ce0a670 100644
--- a/tests/weston-test-runner.c
+++ b/tests/weston-test-runner.c
@@ -34,6 +34,8 @@
 
 #define SKIP 77
 
+char __attribute__((weak)) *server_parameters="";
+
 extern const struct weston_test __start_test_section, __stop_test_section;
 
 static const struct weston_test *
@@ -154,6 +156,12 @@ int main(int argc, char *argv[])
 			exit(EXIT_SUCCESS);
 		}
 
+		if (strcmp(testname, "--params") == 0 ||
+		    strcmp(testname, "-p") == 0) {
+			printf("%s", server_parameters);
+			exit(EXIT_SUCCESS);
+		}
+
 		t = find_test(argv[1]);
 		if (t == NULL) {
 			fprintf(stderr, "unknown test: \"%s\"\n", argv[1]);
diff --git a/tests/weston-tests-env b/tests/weston-tests-env
index e332354..aaf3ee1 100755
--- a/tests/weston-tests-env
+++ b/tests/weston-tests-env
@@ -46,5 +46,6 @@ case $TESTNAME in
 			--shell=$SHELL_PLUGIN \
 			--log="$SERVERLOG" \
 			--modules=$TEST_PLUGIN,$XWAYLAND_PLUGIN \
+			$($abs_builddir/$TESTNAME --params) \
 			&> "$OUTLOG"
 esac
-- 
1.9.1



More information about the wayland-devel mailing list