On 03-06-2020 14:54, Andrew Burgess wrote: > * Tom de Vries [2020-06-03 12:24:09 +0200]: > >> On 03-06-2020 12:09, Tom de Vries wrote: >>> On 03-06-2020 11:38, Tom de Vries wrote: >>>> On 03-06-2020 10:47, Tom de Vries wrote: >>>>> ERROR: can't read "mi_gdb_prompt": no such variable >>>>> while executing >>>>> "expect { >>>>> -i exp95 -timeout 10 >>>>> -re "~\"GNU.*\r\n~\".*$mi_gdb_prompt$" { >>>>> # We have a new format mi startup prompt. If we are >>>>> # running mi1,..." >>>>> ("uplevel" body line 1) >>>>> invoked from within >>>>> "uplevel $body" TCL READ VARNAME can't read "mi_gdb_prompt": no such >>>>> variable >>>> >>>> So, the following happens: >>>> - a test-case imports mi-support.exp using load_lib >>>> - mi-support.exp sets mi_gdb_prompt >>>> - the test-case finishes and the new global mi_gdb_prompt is unset, >>>> because it was not set before the test-case >>>> - a next test-case imports mi-support.exp using load_lib >>>> - load_lib sees that the file already has been loaded, so it skips it >>>> - mi_gdb_prompt remains unset >>>> - the test-case uses mi_gdb_prompt, and we have an error. > > I couldn't work out why my testing was going fine if this problem > exists... then I realised that my testing script was causing the tests > to run in parallel! > > I like the load_lib override solution. I think a solution that avoids > having to place each test into a new namespace would be a good thing > if we can pull it off. > I've tested this with runtest -v, I'm currently re-testing without -v. Thanks, - Tom