Difference between revisions of "GDC/Test Suite"

From D Wiki
Jump to: navigation, search
(Running the testsuite: Add info about timeouts)
(Passing options to gdc)
Line 27: Line 27:
 
make check-d RUNTESTFLAGS="--target_board=unix/-fno-section-anchors/O3"
 
make check-d RUNTESTFLAGS="--target_board=unix/-fno-section-anchors/O3"
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
To run the testsuite against multiple targets, if testing multilib builds, you'd specify each target as in the following test flags:
 +
<syntaxhighlight lang="bash">
 +
make check-d RUNTESTFLAGS="--target_board=unix\{,-m32,-mx32\}"
 +
</syntaxhighlight>
 +
In this example, the testsuite is ran three times.  First using the default target (in this case, -m64), then it runs testsuite generating code for the targets specified (-m32 and -mx32).
  
 
=== Adjusting the timeouts ===
 
=== Adjusting the timeouts ===

Revision as of 08:54, 30 October 2013


Running the testsuite

Execute this command in the directory where you've run configure (see GDC/Installation) to run the D test suite:

make check-d

Note: You must have built the gdc compiler using make before running the tests.

The summary and log will be saved in gcc/testsuite/gdc/ as gdc.sum and gdc.log.

XML output

To obtain xml output for the summary, use this command:

make check-d RUNTESTFLAGS="--xml"

Passing options to gdc

To pass an option to gdc which is used in every test run, use this:

make check-d RUNTESTFLAGS="--target_board=unix/-fno-section-anchors"


The unix part must always be included. Flags are then separated by /. For example, to pass -O3 and -fno-section-anchors, use this:

make check-d RUNTESTFLAGS="--target_board=unix/-fno-section-anchors/O3"


To run the testsuite against multiple targets, if testing multilib builds, you'd specify each target as in the following test flags:

make check-d RUNTESTFLAGS="--target_board=unix\{,-m32,-mx32\}"

In this example, the testsuite is ran three times. First using the default target (in this case, -m64), then it runs testsuite generating code for the targets specified (-m32 and -mx32).

Adjusting the timeouts

The test suite always enforces a certain timeout when compiling a testcase with gdc. If you see UNRESOLVED: lines in your build log with a program timed out warning your machine is too slow and you have to increase the default timeouts.

To change the timeout, edit /usr/share/dejagnu/config/unix.exp and add this line at the end:

set_board_info gcc,timeout 1200

where 1200 is the new timeout in seconds.

More information

GCC test suite documentation