on xenial help sign in
Fix environment for autopilot tests.
commitaf16994294ed1694161f553a5132ae13da7135b6 authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 3 Jul 2013, 20:53 (13 years ago) parent9687163
1 file changed+6−2
tests/autopilot/unity8/tests/__init__.py+6−2
tests/autopilot/unity8/tests/__init__.py+6−2
@@ -8,6 +8,7 @@
88"""unity8 autopilot tests."""
99
1010import os.path
11+import sysconfig
1112
1213from autopilot.testcase import AutopilotTestCase
1314from autopilot.matchers import Eventually
@@ -23,6 +24,7 @@ class ShellTestCase(AutopilotTestCase):
2324
2425 """A common test case class that provides several useful methods for shell tests."""
2526
27+ libdir = "/usr/lib/{0}/unity8".format(sysconfig.get_config_var('MULTIARCH'))
2628 lightdm_mock = "full"
2729
2830 def setUp(self, geometry, grid_size):
@@ -39,7 +41,8 @@ class ShellTestCase(AutopilotTestCase):
3941 self.launch_test_local(geometry)
4042
4143 def launch_test_local(self, geometry):
42− os.environ['LD_LIBRARY_PATH'] = "../../builddir/tests/mocks/libusermetrics:../../builddir/tests/mocks/LightDM/" + self.lightdm_mock
44+ os.environ['LD_LIBRARY_PATH'] = "../../builddir/tests/mocks/libusermetrics:../../builddir/tests/mocks/LightDM" + self.lightdm_mock
45+ os.environ['QML2_IMPORT_PATH'] = "../../builddir/tests/mocks"
4346 if geometry != "0x0":
4447 self.app = self.launch_test_application(
4548 "../../builddir/unity8", "-geometry", geometry, "-frameless", app_type='qt')
@@ -48,7 +51,8 @@ class ShellTestCase(AutopilotTestCase):
4851 "../../builddir/unity8", "-fullscreen", app_type='qt')
4952
5053 def launch_test_installed(self, geometry):
51− os.environ['LD_LIBRARY_PATH'] = "/usr/share/unity8/plugins/mocks/libusermetrics:/usr/share/unity8/plugins/mocks/LightDM/" + self.lightdm_mock
54+ os.environ['LD_LIBRARY_PATH'] = "{0}/qml/mocks/libusermetrics:{0}/qml/mocks/LightDM/{1}".format(self.libdir, self.lightdm_mock)
55+ os.environ['QML2_IMPORT_PATH'] = "{0}/qml/mocks".format(self.libdir)
5256 if model() == 'Desktop' and geometry != "0x0":
5357 self.app = self.launch_test_application(
5458 "unity8", "-geometry", geometry, "-frameless", app_type='qt')