@@ -28,12 +28,14 @@ don't break them for those external projects.
32import mock
33import mock
34import fixtures
35import fixtures
35from testtools.matchers import Contains, HasLength
36from testtools.matchers import Contains, HasLength
37from unity8 import process_helpers
39from unity8 import process_helpers
38from unity8.shell import emulators, tests
40from unity8.shell import emulators, tests
39from unity8.shell.emulators import dash as dash_emulators
41from unity8.shell.emulators import dash as dash_emulators
@@ -51,14 +53,26 @@ class DashBaseTestCase(tests.UnityTestCase):
51 self.dash = self.main_window.get_dash()
53 self.dash = self.main_window.get_dash()
53 def _use_scope_fakes(self):
55 def _use_scope_fakes(self):
54− qml2_import_path = os.environ.get('QML2_IMPORT_PATH')
56+ self.useFixture(
55− mocks_path = os.path.join(
56− os.getcwd(), '../..', 'builddir/tests/mocks')
57− qml_import_path_with_scope_fakes = '{0}:{1}'.format(
58− qml2_import_path, mocks_path)
59− self.useFixture(fixtures.EnvironmentVariable(
57+ fixtures.EnvironmentVariable(
60− 'QML2_IMPORT_PATH',
58+ 'QML2_IMPORT_PATH',
61− newvalue=qml_import_path_with_scope_fakes))
59+ newvalue=self._get_fake_scopes_library_path()))
61+ def _get_fake_scopes_library_path(self):
62+ if unity8.running_installed_tests():
63+ mock_path = 'qml/scopefakes/'
65+ mock_path = os.path.join(
66+ '../lib/', sysconfig.get_config_var('MULTIARCH'),
67+ 'unity8/qml/scopefakes/')
68+ lib_path = unity8.get_lib_path()
69+ ld_library_path = os.path.abspath(os.path.join(lib_path, mock_path))
71+ if not os.path.exists(ld_library_path):
73+ 'Expected library path does not exists: %s.' % (
75+ return ld_library_path
64class DashEmulatorTestCase(DashBaseTestCase):
78class DashEmulatorTestCase(DashBaseTestCase):