aboutsummaryrefslogtreecommitdiff
blob: a9f24acf1f450734d82a3c6a9eb7bfb85f07d62e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#	vim:fileencoding=utf-8
# (c) 2011-2012 Michał Górny <mgorny@gentoo.org>
# Released under the terms of the 2-clause BSD license.

from .dbus_case import DBusEbuildTestCase

class PhaseFunctionOrderTest(DBusEbuildTestCase):
	""" Phase function execution order test. """

	supported_eapis = ((0, 1), (2, 3), (4,))

	def __init__(self, *args, **kwargs):
		DBusEbuildTestCase.__init__(self, *args, **kwargs)
		for k, lines in self.phase_funcs.items():
			lines.append('pms-test_dbus_append_result %s' % k)

	def check_dbus_result(self, output, pm):
		expect = []

		if self.eapi >= 4:
			expect.append('pkg_pretend')
		expect.extend(['pkg_setup', 'src_unpack'])
		if self.eapi >= 2:
			expect.extend(['src_prepare', 'src_configure'])
		expect.extend(['src_compile', 'src_install', 'pkg_preinst', 'pkg_postinst'])

		DBusEbuildTestCase.check_dbus_result(self, output, pm)
		self.assertEqual(output, expect, 'Executed phases')