sim: testsuite: rework sim_init usage
authorMike Frysinger <vapier@gentoo.org>
Sun, 21 Nov 2021 08:41:39 +0000 (03:41 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 27 Nov 2021 00:48:05 +0000 (19:48 -0500)
commitc0d6a6e5828882040bbb55bafea6b188a18fc000
treed8cf4615c587d48caa174be280f30eb622d167b7
parent4c721b266fdae6e2761cc122fac4cfb42932e295
sim: testsuite: rework sim_init usage

The sim_init function was called by runtest for each test when --tool
was set to sim.  When we changed to --tool '' to collapse the testsuite
dir, the init function was no longer called on every test.  However, it
was still being called explicitly by config/default.exp.  It's not clear
why that explicit call ever existed since, in the past, it meant it was
redundant.

Lets drop the single sim_init call in config/default.exp and move it out
to all our tests.  This replicates the runtest behavior so we can setup
variables on a per-test basis which allows us to recollapse the sim_path
logic back.  We'll also leverage this in the future for toolchain setup.

Also add a few comments clarifying the overall runtime behavior.
44 files changed:
sim/testsuite/aarch64/allinsn.exp
sim/testsuite/arm/allinsn.exp
sim/testsuite/arm/iwmmxt/iwmmxt.exp
sim/testsuite/arm/misc.exp
sim/testsuite/arm/thumb/allthumb.exp
sim/testsuite/arm/xscale/xscale.exp
sim/testsuite/avr/allinsn.exp
sim/testsuite/bfin/allinsn.exp
sim/testsuite/bpf/allinsn.exp
sim/testsuite/config/default.exp
sim/testsuite/cr16/allinsn.exp
sim/testsuite/cr16/misc.exp
sim/testsuite/cris/asm/asm.exp
sim/testsuite/cris/c/c.exp
sim/testsuite/cris/hw/rv-n-cris/rvc.exp
sim/testsuite/d10v/allinsn.exp
sim/testsuite/example-synacor/allinsn.exp
sim/testsuite/frv/allinsn.exp
sim/testsuite/frv/fr400/allinsn.exp
sim/testsuite/frv/fr500/allinsn.exp
sim/testsuite/frv/fr550/allinsn.exp
sim/testsuite/frv/interrupts.exp
sim/testsuite/frv/misc.exp
sim/testsuite/frv/parallel.exp
sim/testsuite/ft32/allinsn.exp
sim/testsuite/h8300/allinsn.exp
sim/testsuite/iq2000/allinsn.exp
sim/testsuite/lib/sim-defs.exp
sim/testsuite/lm32/allinsn.exp
sim/testsuite/m32c/allinsn.exp
sim/testsuite/m32r/allinsn.exp
sim/testsuite/m32r/misc.exp
sim/testsuite/m68hc11/allinsn.exp
sim/testsuite/mcore/allinsn.exp
sim/testsuite/microblaze/allinsn.exp
sim/testsuite/mips/basic.exp
sim/testsuite/mn10300/allinsn.exp
sim/testsuite/moxie/allinsn.exp
sim/testsuite/msp430/allinsn.exp
sim/testsuite/or1k/alltests.exp
sim/testsuite/pru/allinsn.exp
sim/testsuite/riscv/allinsn.exp
sim/testsuite/sh/allinsn.exp
sim/testsuite/v850/allinsns.exp