[pacman-dev] [PATCH] Rework fakechroot checking
Do the checks in the tests that need it, and get rid of some of the cluttered output when it is not available (one line per test run). Signed-off-by: Dan McGee <dan@archlinux.org> --- pactest/pmtest.py | 4 +--- pactest/tests/scriptlet001.py | 4 ++++ pactest/tests/scriptlet002.py | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pactest/pmtest.py b/pactest/pmtest.py index 39f4dea..7bb3281 100755 --- a/pactest/pmtest.py +++ b/pactest/pmtest.py @@ -197,9 +197,7 @@ class pmtest: cmd.append("fakeroot") fakechroot = which("fakechroot") - if not fakechroot: - print "WARNING: fakechroot not found, scriptlet tests WILL fail!!!" - else: + if fakechroot: cmd.append("fakechroot") if pacman["gdb"]: diff --git a/pactest/tests/scriptlet001.py b/pactest/tests/scriptlet001.py index 54a46aa..ff7fcd2 100644 --- a/pactest/tests/scriptlet001.py +++ b/pactest/tests/scriptlet001.py @@ -14,3 +14,7 @@ self.args = "--debug -U %s" % p1.filename() self.addrule("PACMAN_RETCODE=0") self.addrule("PACMAN_OUTPUT=" + pre) self.addrule("PACMAN_OUTPUT=" + post) + +fakechroot = which("fakechroot") +if not fakechroot: + self.expectfailure = True diff --git a/pactest/tests/scriptlet002.py b/pactest/tests/scriptlet002.py index dd792b8..cc316a1 100644 --- a/pactest/tests/scriptlet002.py +++ b/pactest/tests/scriptlet002.py @@ -14,3 +14,7 @@ self.args = "--debug -R %s" % p1.name self.addrule("PACMAN_RETCODE=0") self.addrule("PACMAN_OUTPUT=" + pre) self.addrule("PACMAN_OUTPUT=" + post) + +fakechroot = which("fakechroot") +if not fakechroot: + self.expectfailure = True -- 1.6.0.1
On Fri, Sep 5, 2008 at 3:52 AM, Dan McGee <dan@archlinux.org> wrote:
Do the checks in the tests that need it, and get rid of some of the cluttered output when it is not available (one line per test run).
Signed-off-by: Dan McGee <dan@archlinux.org> --- pactest/pmtest.py | 4 +--- pactest/tests/scriptlet001.py | 4 ++++ pactest/tests/scriptlet002.py | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-)
I never bothered doing that but it is great, the one warning per test run was annoying indeed. And the two scriptlets pactest could not pass without fakeroot. So now we have a 100% pactest (expected to pass) success on cygwin too.
participants (2)
-
Dan McGee
-
Xavier