[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libredwg] Testsuite
From: |
Thien-Thi Nguyen |
Subject: |
Re: [libredwg] Testsuite |
Date: |
Fri, 20 Feb 2015 09:45:12 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
() Mike Dupont <address@hidden>
() Mon, 9 Feb 2015 06:00:04 -0600
On Sun, Feb 8, 2015 at 4:40 AM, guruprasad rane
<address@hidden> wrote:
> I tried to run the check.py it gave errors
>
> Traceback (most recent call last):
> File "./check.py", line 17, in <module>
> generatexml(path_to_dwg)
> File "/home/bcadmin/libredwg/testsuite/xmlsuite/helper.py", line 33, in
> generatexml
> os.system (me + " ./txttoxml.py " + filename)
> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
>
if you look at the code :
# This beats 'sys.argv[0]', which is not guaranteed to be set.
me = os.getenv ("PYTHON")
current_dir = os.getcwd()
os.chdir(dwgdir)
for filename in glob.glob ("*/*.txt"):
os.system (me + " ./txttoxml.py " + filename)
you will see it is looking for the environment variable
PYTHON this is not set by default.
use :
export PYTHON=`which python`
or
export PYTHON=/usr/bin/python
This is done automatically by the "make check" machinery (see
variable ‘TESTS_ENVIRONMENT’ in testsuite/xmlsuite/Makefile.am).
IOW, the recommended way to run check.py is to do:
make check
in either testsuite/xmlsuite/ or the top-level directory.
The ‘getenv’ hair was added to support running "make check" on
Hydra (or any such "non-standard" system where ‘sys.argv[0]’ is
not guaranteed to have a useful value). I suppose we can add a
fallback to the original ‘sys.argv[0]’ if env var ‘PYTHON’ is
not set, but that would be going in circles design-wise. Better
to check ‘me’ and throw an error with a clear diagnostic message.
Any objections?
--
Thien-Thi Nguyen
GPG key: 4C807502
(if you're human and you know it)
read my lisp: (responsep (questions 'technical)
(not (via 'mailing-list)))
=> nil
signature.asc
Description: PGP signature