gdb/testsuite: update expected results in gdb.python/py-startup-opt.exp
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 29 Apr 2021 09:11:35 +0000 (10:11 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 3 May 2021 11:21:00 +0000 (12:21 +0100)
commitd389a1a7692d247b6153fc6a98ebc43d7070fc2e
tree521f7cd3ce89b900a92a5836bb00da544afe0efb
parent4916030821bb0b052091bd1e29f1851e1512a056
gdb/testsuite: update expected results in gdb.python/py-startup-opt.exp

The test gdb.python/py-startup-opt.exp checks the behaviour of GDB's:

  set python dont-write-bytecode on

This flag (when on) stops Python creating .pyc files.  The test first
checks that .pyc files will be created, then turns this option on and
checks .pyc files will not be created.

However, if the user has PYTHONDONTWRITEBYTECODE set in their
environment then this will prevent Python from creating .pyc files, as
such the first test, that .pyc files are being created, currently
fails.

We could unset PYTHONDONTWRITEBYTECODE, however, until Python 3.8
there is no way to control where Python writes the .pyc files.  As the
GDB developer clearly doesn't want .pyc files created in their
file-system it feels wrong to silently unset this environment
variable.

My proposal then, is that we just spot when this environment variable
is set and adjust the expected results.  My hope is that across all
GDB developers some will be running with PYTHONDONTWRITEBYTECODE
unset, so this feature will be fully tested at least some of the time.

gdb/testsuite/ChangeLog:

PR testsuite/27788
* gdb.python/py-startup-opt.exp (test_python_settings): Change the
expected results when environment variable PYTHONDONTWRITEBYTECODE
is set.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-startup-opt.exp
This page took 0.028915 seconds and 4 git commands to generate.