testsuite layout conventions

Mike Frysinger via Binutils <[email protected]>
Newsgroups gmane.comp.gnu.binutils,gmane.comp.gdb.devel
Message-ID <20210106051222.GB7494@vapier>
do we have docs/guidelines for testsuite/ dir layouts ?  we seem to
(inconsistently) use a lot of redundant layouts largely due to our
use of dejagnu.

dejagnu takes a tool-centric view of the world.  this makes sense
when you have a flat testsuite dir (e.g. if gas & binutils & ld &
gdb all shared a testsuite/ dir), but i'm not sure it makes that
much sense when they're all sep.  i think dejagnu is the single
reason for the layouts we have and it seems a bit unnecessary.

when you set tool=<tool> in its site.exp, it will only search for
dirs with <tool> prefixes under testsuite/.  i.e. it applies the
glob like testsuite/<tool>*/**.

a quick survey of binutils/gdb/gcc dirs that have tests:
* binutils     / testsuite / binutils-<group>  / <tests>
* gas          / testsuite / gas / <group>     / <tests>
* gdb          / testsuite / gdb.<group>       / <tests>
* gold         / testsuite / <tests>
* ld           / testsuite / ld-<group>        / <tests>
* libctf       / testsuite / libctf-<group>    / <tests>
* libiberty    / testsuite / <tests>
* sim          / testsuite / sim / <group>     / <tests>
* gcc          / testsuite / <tool>.<group>    / <tests>
* libatomic    / testsuite / libatomic.<group> / <tests>
* libffi       / testsuite / libffi.<group>    / <tests>
* libgomp      / testsuite / libgomp.<group>   / <tests>
* libgo        / testsuite / libgo.<group>     / <tests>
* libitm       / testsuite / libitm.<group>    / <tests>
* libphobos    / testsuite / libphobos.<group> / <tests>
* libstdc++-v3 / testsuite / libstdc++-<group> / <tests>
* libvtv       / testsuite / libvtv.<group>    / <tests>

the notable standouts are gold & libiberty.  they don't use dejagnu
while everyone else does.  so i'll ignore them.

libstdc++-v3 has additional test subdirs beyond the tool=libstdc++
prefix.  not sure how that works exactly.  so i'll ignore them.

gcc is also a bit funky, but i guess that's what you get for such a
large subdir.  i don't think we want to use that as precedence :).

for all the rest, you can see that we have three styles:
	<tool>.<group>/
	<tool>-<group>/
	<tool>/<group>/

the odd thing is that it seems most projects don't actually set
tool in their site.exp.  libstdc++, gdb, and sim do.  so i guess
either the others ones used to, or they just adopted a similar
naming convention at some point because others were ?

i've just finished cleaning up the sim/testsuite/ tree.  i'm left
with sim/testsuite/sim/<arch>/<tests>.  i spend a lot of time in
sim/<arch>/ and sim/testsuite/sim/<arch>/ comparing and trying to
collapse common logic.  the extra sim/ dir irks me ;).  it ends up
being easy to collapse by deleting 'set tool sim' from site.exp,
then just doing:
  cd testsuite/
  git mv sim/* ./
which leaves me with sim/testsuite/<arch>/.

based on the fact that no one seems to use dejagnu's tool setting
anymore, and we don't seem to have general guidance, and every
project is slightly different, changing sim to drop the "sim" tool
prefix is fine.
-mike
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAl/1RrYACgkQQWM7n+g3
9YEdLQ/+MSVNL8ZndlLYc7BnZ9qjKY7G4IDcQHD9aEW8DfQBjrhpsE7KPBLtfThG
mThbWxxs4+/Xt24j6BS39iZKnHr8VpKoAZfWc5ycpD+PxYPqkhK2FJS4cZH7XGuV
9mug0SUHmZFiBimPvahk0CW2zjzatmV5lQsqejVuBY4H5olZftrEL4/6ftZasSJ4
G/shOR2sx4trFab86ZdfdUd+LgD1kjsmFUybC0MjDAo14EcgOHUapXxRJvMOK/PR
qc7ADNL42ijIiY1Rnflk3gZLchhhOjC6sr2lYtqedBALw1elE4IR2t2E9p50vcAV
DZRzkaPw6fNa4fjroFkYSFGnuvPpxcNJjze1zDCiPpz4Yi/lSWpxXitHzNTHggJi
hxzL3b1z837GPwh9/YxcxvF+vgCLv/Pl2cIrxHWj36JhnNP4bg6fKWQ0ByfD06F1
XM9IkYsVqCjp7yw7JVLYXfHH77IZ7JTLNWrfEQWUuR5i0QAxh1LCcvkYEaCHAYXF
KbF4ufJxSU9QIA8va41Go2WfhMYXVc9k0YxJZfI92sMxXzY0kElkoDelGtOpxD3J
MVSky7t0ZmlEd61tOVekbtpJ1dwlIQiB4pScZl0U88Ga3x/bQ0IcJ6N8rwa9JSa8
GU1nS2Oo77vnWQE5exBqiwQi19BknHgTGaSntumT4MdARt9dOkI=
=YuWs
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.