@@ -84,20 +84,30 @@ class UnityTestCase(AutopilotTestCase):
85 @classmethod
85 @classmethod
86 def setUpClass(cls):
86 def setUpClass(cls):
87− output = subprocess.check_output([
88+ output = subprocess.check_output([
88− "/sbin/initctl",
89+ "/sbin/initctl",
89− "status",
90+ "status",
93+ stderr=subprocess.STDOUT)
94+ except subprocess.CalledProcessError, e:
96+ "Error: `initctl status unity8` failed, most probably the unity8 session could not be found:\n\n"
98+ "Please install unity8 or copy data/unity8.conf to {1}\n".format(
100+ os.path.join(os.getenv("XDG_CONFIG_HOME", os.path.join(os.getenv("HOME"), ".config")), "upstart")
93 if "start/" in output:
104 if "start/" in output:
94 sys.stderr.write(
105 sys.stderr.write(
95− "Error: Unity is currently running, these tests require it to "
106+ "Error: Unity is currently running, these tests require it to be 'stopped'.\n"
97 "Please run this command before running these tests: \n"
107 "Please run this command before running these tests: \n"
98− "initctl stop unity\n"
108+ "initctl stop unity8\n"
100− sys.exit(1)
110+ sys.exit(2)
102 def setUp(self):
112 def setUp(self):
103 super(UnityTestCase, self).setUp()
113 super(UnityTestCase, self).setUp()