From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QoeyB-0003Z5-12 for garchives@archives.gentoo.org; Wed, 03 Aug 2011 17:10:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 03A0121C026; Wed, 3 Aug 2011 17:10:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BAA6121C026 for ; Wed, 3 Aug 2011 17:10:50 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 369671B403B for ; Wed, 3 Aug 2011 17:10:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7947580042 for ; Wed, 3 Aug 2011 17:10:49 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: pmstestsuite/library/standard/dbus_case.py pmstestsuite/library/standard/deprecated_vars.py pmstestsuite/library/standard/phase_function_order.py pmstestsuite/library/standard/special_vars.py pmstestsuite/library/standard/variable_scope.py X-VCS-Directories: pmstestsuite/library/standard/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: b69b11da02b541ca764a1291651b085f90bf430d Date: Wed, 3 Aug 2011 17:10:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 744324c63576eeb23a1ddea69068de6d commit: b69b11da02b541ca764a1291651b085f90bf430d Author: Micha=C5=82 G=C3=B3rny mgorny alt pl= > AuthorDate: Wed Aug 3 17:09:03 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Wed Aug 3 17:09:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3Db69b11da Pass D-Bus output as a list, instead of joining it. This way, we can handle newlines in the output cleanly. --- pmstestsuite/library/standard/dbus_case.py | 8 ++-- pmstestsuite/library/standard/deprecated_vars.py | 4 +- .../library/standard/phase_function_order.py | 34 +++++---------= ------ pmstestsuite/library/standard/special_vars.py | 2 +- pmstestsuite/library/standard/variable_scope.py | 2 +- 5 files changed, 16 insertions(+), 34 deletions(-) diff --git a/pmstestsuite/library/standard/dbus_case.py b/pmstestsuite/li= brary/standard/dbus_case.py index eb88fa1..e0cd09c 100644 --- a/pmstestsuite/library/standard/dbus_case.py +++ b/pmstestsuite/library/standard/dbus_case.py @@ -75,7 +75,7 @@ class RunningTest(dbus.service.Object): in_signature=3D's', out_signature=3D'') def append_output(self, l): """ Append the line to the test output. """ - self.test.dbus_output.append(l) + self.test.dbus_output.append(str(l)) =20 class DBusBaseTestCase(object): """ A base D-Bus test case class. """ @@ -104,7 +104,7 @@ class DBusBaseTestCase(object): =20 def check_result(self, pm): self.assertTrue(self.dbus_started, 'build started') - return self.check_dbus_result('\n'.join(self.dbus_output), pm) + return self.check_dbus_result(self.dbus_output, pm) =20 class DBusEbuildTestCase(DBusBaseTestCase, EbuildTestCase): """ D-Bus capable base test case. """ @@ -142,7 +142,7 @@ class DBusEbuildDependencyTestCase(DBusBaseTestCase, = EbuildDependencyTestCase): def check_result(self, pm): self.assertBool(not self.expect_failure, self.dbus_started, 'build started') - return self.check_dbus_result('\n'.join(self.dbus_output), pm) + return self.check_dbus_result(self.dbus_output, pm) =20 class DBusEclassDependencyTestCase(DBusBaseTestCase, EclassDependencyTes= tCase): """ D-Bus capable eclass dependency test case. """ @@ -158,4 +158,4 @@ class DBusEclassDependencyTestCase(DBusBaseTestCase, = EclassDependencyTestCase): def check_result(self, pm): self.assertBool(not self.expect_failure, self.dbus_started, 'build started') - return self.check_dbus_result('\n'.join(self.dbus_output), pm) + return self.check_dbus_result(self.dbus_output, pm) diff --git a/pmstestsuite/library/standard/deprecated_vars.py b/pmstestsu= ite/library/standard/deprecated_vars.py index 4b8b672..25fd487 100644 --- a/pmstestsuite/library/standard/deprecated_vars.py +++ b/pmstestsuite/library/standard/deprecated_vars.py @@ -33,7 +33,7 @@ class AATest(DBusFetchingEbuildTestCase): expect =3D '' =20 DBusEbuildTestCase.check_dbus_result(self, output, pm) - self.assertEqual(output, expect, '${AA}') + self.assertEqual(output[0], expect, '${AA}') =20 class KVTest(DBusEbuildTestCase): """ Test whether KV is declared. """ @@ -49,4 +49,4 @@ class KVTest(DBusEbuildTestCase): DBusEbuildTestCase.check_dbus_result(self, output, pm) func =3D self.assertEqual if self.eapi =3D=3D 4 \ else self.assertNotEqual - func(output, '', '${KV}') + func(output[0], '', '${KV}') diff --git a/pmstestsuite/library/standard/phase_function_order.py b/pmst= estsuite/library/standard/phase_function_order.py index 65209ce..9fe085c 100644 --- a/pmstestsuite/library/standard/phase_function_order.py +++ b/pmstestsuite/library/standard/phase_function_order.py @@ -15,32 +15,14 @@ class PhaseFunctionOrderTest(DBusEbuildTestCase): lines.append('pms-test-dbus_append_result %s' % k) =20 def check_dbus_result(self, output, pm): - if self.eapi < 2: - expect =3D """pkg_setup -src_unpack -src_compile -src_install -pkg_preinst -pkg_postinst""" - elif self.eapi < 4: - expect =3D """pkg_setup -src_unpack -src_prepare -src_configure -src_compile -src_install -pkg_preinst -pkg_postinst""" - else: - expect =3D """pkg_pretend -pkg_setup -src_unpack -src_prepare -src_configure -src_compile -src_install -pkg_preinst -pkg_postinst""" + expect =3D [] + + if self.eapi >=3D 4: + expect.append('pkg_pretend') + expect.extend(['pkg_setup', 'src_unpack']) + if self.eapi >=3D 2: + expect.extend(['src_prepare', 'src_configure']) + expect.extend(['src_compile', 'src_install', 'pkg_preinst', 'pkg_posti= nst']) =20 DBusEbuildTestCase.check_dbus_result(self, output, pm) self.assertEqual(output, expect, 'Executed phases') diff --git a/pmstestsuite/library/standard/special_vars.py b/pmstestsuite= /library/standard/special_vars.py index 854a196..476959e 100644 --- a/pmstestsuite/library/standard/special_vars.py +++ b/pmstestsuite/library/standard/special_vars.py @@ -15,7 +15,7 @@ class InheritedVariableTest(DBusEbuildTestCase): =20 def check_dbus_result(self, output, pm): DBusEbuildTestCase.check_dbus_result(self, output, pm) - inherits =3D output.split() + inherits =3D output[0].split() self.assertContains('pms-test-dbus', inherits, 'INHERITS') =20 diff --git a/pmstestsuite/library/standard/variable_scope.py b/pmstestsui= te/library/standard/variable_scope.py index 3bd7b94..9815a2d 100644 --- a/pmstestsuite/library/standard/variable_scope.py +++ b/pmstestsuite/library/standard/variable_scope.py @@ -30,7 +30,7 @@ class VariableScopeTest(DBusEbuildTestCase): def check_dbus_result(self, output, pm): myvars =3D ('GLOBAL_TEST', 'DEFAULT_TEST', 'EXPORT_TEST', 'LOCAL_TEST'= ) res =3D [] - for i, l in enumerate(output.splitlines()): + for i, l in enumerate(output): m =3D self.declare_re.match(l) if not m or m.group(2) !=3D myvars[i]: return False