tests/readlink.py
author Bryan O'Sullivan <bos@serpentine.com>
Mon, 04 Jan 2016 21:54:46 -0800
changeset 27636 21b363bd87dc
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
tests: make a stab at approximating wall-clock times Vaguely empirical observations: * ".py" tests are about an order of magnitude faster than ".t" tests * dividing size by 1000 gives an approximation to wall-clock run time (in seconds) that is not completely ridiculous.

#!/usr/bin/env python

import errno, os, sys

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

sys.exit(0)