[farsight2/master] Possibly set the upnp's xml path with env var for tests
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:25:57 PST 2008
---
tests/check/Makefile.am | 3 ++-
tests/check/transmitter/rawudp-upnp.c | 18 ++++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index 21dadaa..d45a195 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -11,7 +11,8 @@ TESTS_ENVIRONMENT = \
$(REGISTRY_ENVIRONMENT) \
GST_PLUGIN_PATH=$(top_builddir)/gst:${GST_PLUGIN_PATH} \
FS_PLUGIN_PATH=$(top_builddir)/transmitters/rawudp/.libs:$(top_builddir)/transmitters/multicast/.libs \
- LD_LIBRARY_PATH=$(top_builddir)/gst-libs/gst/farsight/.libs:${LD_LIBRARY_PATH}
+ LD_LIBRARY_PATH=$(top_builddir)/gst-libs/gst/farsight/.libs:${LD_LIBRARY_PATH} \
+ UPNP_XML_PATH=$(srcdir)/upnp
# ths core dumps of some machines have PIDs appended
diff --git a/tests/check/transmitter/rawudp-upnp.c b/tests/check/transmitter/rawudp-upnp.c
index a09b0de..4021e7d 100644
--- a/tests/check/transmitter/rawudp-upnp.c
+++ b/tests/check/transmitter/rawudp-upnp.c
@@ -124,8 +124,22 @@ start_upnp_server (void)
context = gupnp_context_new (NULL, NULL, 0, NULL);
ts_fail_if (context == NULL, "Can't get gupnp context");
- gupnp_context_host_path (context, "upnp/InternetGatewayDevice.xml", "/InternetGatewayDevice.xml");
- gupnp_context_host_path (context, "upnp/WANIPConnection.xml", "/WANIPConnection.xml");
+ if (g_getenv ("UPNP_XML_PATH"))
+ {
+ gchar **paths = g_strsplit (g_getenv ("UPNP_XML_PATH"), ":", 0);
+ gint i;
+
+ for (i=0; paths[i]; i++)
+ {
+ gupnp_context_host_path (context, paths[i], "");
+ }
+ g_strfreev (paths);
+ }
+ else
+ {
+ gupnp_context_host_path (context, "upnp/InternetGatewayDevice.xml", "/InternetGatewayDevice.xml");
+ gupnp_context_host_path (context, "upnp/WANIPConnection.xml", "/WANIPConnection.xml");
+ }
dev = gupnp_root_device_new (context, "/InternetGatewayDevice.xml");
ts_fail_if (dev == NULL, "could not get root dev");
--
1.5.6.5
More information about the farsight-commits
mailing list