tests/readlink.py
author anuraggoel <anurag.dsps@gmail.com>
Thu, 12 Jun 2014 01:36:57 +0530
changeset 21735 5ee547fdb0be
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
run-tests: produce error on running a failing test This patch fixes a regression recently introduced by a refactoring (see 92a6b16c9186 and about 200 previous changesets from Gregory Szorc). It produce an error message everytime with a test filename which gets fail while testing except at one condition when '--nodiff' option is enabled.

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)