public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pms-test-suite:master commit in: basic/
@ 2011-05-31 18:10 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2011-05-31 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     10e744b9f4bd7caad60c323fd23ba71fceb4e2a1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 19:09:42 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 18:00:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=10e744b9

Add a Python library format example.

---
 basic/phase-function-order.py |   73 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/basic/phase-function-order.py b/basic/phase-function-order.py
new file mode 100644
index 0000000..59307f9
--- /dev/null
+++ b/basic/phase-function-order.py
@@ -0,0 +1,73 @@
+# Example Python implementation
+
+# XXX: will be implemented in core suite and imported here
+class EbuildTest(object):
+	phase_funcs = dict([(func, []) for func in (
+		'pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare',
+		'src_configure', 'src_compile', 'src_install',
+		'pkg_preinst', 'pkg_postinst'
+		)])
+
+class PhaseFunctionOrderTest(EbuildTest):
+	relevant_eapis = (0, 2, 4)
+
+	DESCRIPTION = 'Phase function execution order test'
+
+	def __init__(self):
+		for func in self.phase_funcs.keys():
+			self.phase_funcs[func].append("pms-test_append_result %s" % func)
+
+	def check_output(self, output):
+		if self.EAPI < 2:
+			expect = """pkg_setup
+src_unpack
+src_compile
+src_install
+pkg_preinst
+pkg_postinst"""
+		elif self.EAPI < 4:
+			expect = """pkg_setup
+src_unpack
+src_prepare
+src_compile
+src_configure
+src_install
+pkg_preinst
+pkg_postinst"""
+		else:
+			expect = """pkg_pretend
+pkg_setup
+src_unpack
+src_prepare
+src_compile
+src_configure
+src_install
+pkg_preinst
+pkg_postinst"""
+
+		return (output == expect)
+
+# (test code)
+test = PhaseFunctionOrderTest()
+
+test.EAPI=1
+real_output="""pkg_setup
+src_unpack
+src_compile
+src_install
+pkg_preinst
+pkg_postinst"""
+print(test.check_output(real_output)) # expect True
+
+test.EAPI=2
+print(test.check_output(real_output)) # expect False
+
+real_output="""pkg_setup
+src_unpack
+src_prepare
+src_compile
+src_configure
+src_install
+pkg_preinst
+pkg_postinst"""
+print(test.check_output(real_output)) # expect True



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [gentoo-commits] proj/pms-test-suite:master commit in: basic/
@ 2011-05-31 18:10 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2011-05-31 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     54b1047b7b7844ce48d9f765e8fcf5cfd2effa46
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 16:40:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 18:01:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=54b1047b

Move ebuilds vars to a separate dict.

---
 basic/phase-function-order.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/basic/phase-function-order.py b/basic/phase-function-order.py
index 59307f9..01e71c9 100644
--- a/basic/phase-function-order.py
+++ b/basic/phase-function-order.py
@@ -11,7 +11,9 @@ class EbuildTest(object):
 class PhaseFunctionOrderTest(EbuildTest):
 	relevant_eapis = (0, 2, 4)
 
-	DESCRIPTION = 'Phase function execution order test'
+	ebuild_vars = {
+		'DESCRIPTION': 'Phase function execution order test'
+	}
 
 	def __init__(self):
 		for func in self.phase_funcs.keys():



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [gentoo-commits] proj/pms-test-suite:master commit in: basic/
@ 2011-05-31 18:10 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2011-05-31 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     c5b0f3d8c096765695be2a01208175d88a183da6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 20:35:07 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 18:01:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=c5b0f3d8

Adjust the phase function order test to the new API.

---
 basic/phase-function-order.py |   75 -----------------------------------------
 basic/phase_function_order.py |   47 +++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 75 deletions(-)

diff --git a/basic/phase-function-order.py b/basic/phase-function-order.py
deleted file mode 100644
index 01e71c9..0000000
--- a/basic/phase-function-order.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Example Python implementation
-
-# XXX: will be implemented in core suite and imported here
-class EbuildTest(object):
-	phase_funcs = dict([(func, []) for func in (
-		'pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare',
-		'src_configure', 'src_compile', 'src_install',
-		'pkg_preinst', 'pkg_postinst'
-		)])
-
-class PhaseFunctionOrderTest(EbuildTest):
-	relevant_eapis = (0, 2, 4)
-
-	ebuild_vars = {
-		'DESCRIPTION': 'Phase function execution order test'
-	}
-
-	def __init__(self):
-		for func in self.phase_funcs.keys():
-			self.phase_funcs[func].append("pms-test_append_result %s" % func)
-
-	def check_output(self, output):
-		if self.EAPI < 2:
-			expect = """pkg_setup
-src_unpack
-src_compile
-src_install
-pkg_preinst
-pkg_postinst"""
-		elif self.EAPI < 4:
-			expect = """pkg_setup
-src_unpack
-src_prepare
-src_compile
-src_configure
-src_install
-pkg_preinst
-pkg_postinst"""
-		else:
-			expect = """pkg_pretend
-pkg_setup
-src_unpack
-src_prepare
-src_compile
-src_configure
-src_install
-pkg_preinst
-pkg_postinst"""
-
-		return (output == expect)
-
-# (test code)
-test = PhaseFunctionOrderTest()
-
-test.EAPI=1
-real_output="""pkg_setup
-src_unpack
-src_compile
-src_install
-pkg_preinst
-pkg_postinst"""
-print(test.check_output(real_output)) # expect True
-
-test.EAPI=2
-print(test.check_output(real_output)) # expect False
-
-real_output="""pkg_setup
-src_unpack
-src_prepare
-src_compile
-src_configure
-src_install
-pkg_preinst
-pkg_postinst"""
-print(test.check_output(real_output)) # expect True

diff --git a/basic/phase_function_order.py b/basic/phase_function_order.py
new file mode 100644
index 0000000..7a9cc13
--- /dev/null
+++ b/basic/phase_function_order.py
@@ -0,0 +1,47 @@
+#	vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+from PMSTestSuite.library.case import EbuildTestCase
+
+class PhaseFunctionOrderTest(EbuildTestCase):
+	relevant_eapis = (0, 2, 4)
+
+	ebuild_vars = {
+		'DESCRIPTION': 'Phase function execution order test'
+	}
+
+	def __init__(self, *args, **kwargs):
+		for func in self.phase_funcs:
+			self.phase_funcs[func].append("pms-test_append_result %s" % func)
+		EbuildTestCase.__init__(self, *args, **kwargs)
+
+	def check_output(self, output):
+		if self.eapi < 2:
+			expect = """pkg_setup
+src_unpack
+src_compile
+src_install
+pkg_preinst
+pkg_postinst"""
+		elif self.eapi < 4:
+			expect = """pkg_setup
+src_unpack
+src_prepare
+src_compile
+src_configure
+src_install
+pkg_preinst
+pkg_postinst"""
+		else:
+			expect = """pkg_pretend
+pkg_setup
+src_unpack
+src_prepare
+src_compile
+src_configure
+src_install
+pkg_preinst
+pkg_postinst"""
+
+		return (output == expect)



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [gentoo-commits] proj/pms-test-suite:master commit in: basic/
@ 2011-05-31 18:10 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2011-05-31 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     78c3dee66ba29ecb937643a7e3bb650e7b87dbb9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 06:19:16 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 18:01:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=78c3dee6

Fix mutating shared phase_funcs.

---
 basic/phase_function_order.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/basic/phase_function_order.py b/basic/phase_function_order.py
index 7a9cc13..80a1c4e 100644
--- a/basic/phase_function_order.py
+++ b/basic/phase_function_order.py
@@ -2,7 +2,7 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from PMSTestSuite.library.case import EbuildTestCase
+from PMSTestSuite.library.case import EbuildTestCase, phase_func_names
 
 class PhaseFunctionOrderTest(EbuildTestCase):
 	relevant_eapis = (0, 2, 4)
@@ -11,10 +11,8 @@ class PhaseFunctionOrderTest(EbuildTestCase):
 		'DESCRIPTION': 'Phase function execution order test'
 	}
 
-	def __init__(self, *args, **kwargs):
-		for func in self.phase_funcs:
-			self.phase_funcs[func].append("pms-test_append_result %s" % func)
-		EbuildTestCase.__init__(self, *args, **kwargs)
+	phase_funcs = dict([(x, ["pms-test_append_result %s" % x])
+		for x in phase_func_names])
 
 	def check_output(self, output):
 		if self.eapi < 2:



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-31 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 18:10 [gentoo-commits] proj/pms-test-suite:master commit in: basic/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2011-05-31 18:10 Michał Górny
2011-05-31 18:10 Michał Górny
2011-05-31 18:10 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox