aboutsummaryrefslogtreecommitdiff
blob: cd64a9ad714ec61424f671045246f69aa6f4d625 (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
29
30
31
32
#	vim:fileencoding=utf-8
# (c) 2011 Michał Górny <mgorny@gentoo.org>
# Released under the terms of the 2-clause BSD license.

from abc import abstractproperty

from .case import EbuildTestCase

class EclassTestCase(EbuildTestCase):
	"""
	Test case using an eclass (and a set of per-EAPI ebuilds).

	The eclass inherit will be added to the ebuilds automatically.
	"""

	@abstractproperty
	def eclass_contents(self):
		"""
		The eclass contents.

		@type: string
		"""
		pass

	def __init__(self, *args, **kwargs):
		EbuildTestCase.__init__(self, *args, **kwargs)
		self.inherits.append(self.pn)

	def get_output_files(self):
		outf = EbuildTestCase.get_output_files(self)
		outf['eclass/%s.eclass' % self.pn] = self.eclass_contents
		return outf