On Thu, Jul 27, 2006 at 04:31:31PM +0200, Duncan Sands wrote: > I've started adding a bunch of regression tests to the > Ada dejagnu testsuite (see below for the current state). > I've accumulated these over several years, and almost all > of them have been reported in gcc bugzilla (not many of > these) or to ACT (the funny package names are ACT tracking > numbers). > > However it's not clear to me how to add multi-package tests. > Some of my test cases consist of more than a_package.ads, > a_package.adb (think of tests involving interaction of child > packages with parent packages for example - they necessarily > involve several compilation units). Logically speaking, the > test only needs to be run on the main package, the subsidiary > packages don't need to be tested individually. However the > testsuite infrastructure tests all bodies. How to tell it > to ignore some? Likewise for tests in gnat.dg/specs.
The test directive dg-additional-sources specifies one or more additional files to use for a test; they are added to the compile line for the main test file. Each .exp file uses a glob pattern to find test names to pass to dg-runtest. See gcc.dg/special/special.exp, which uses a pattern to omit the names of additional source files in that directory. Another (untested and rather ugly) possibility is to add { dg-skip-if "" { *-*-* } { "*" } { "" } } to the additional files so they'll be treated as skipped tests. Janis