Difference between revisions of "DRuntime development"

From D Wiki
Jump to: navigation, search
(Run all tests)
(Mention how to run individual targets in debug mode)
Line 21: Line 21:
 
make -f posix.mak test/coverage/.run
 
make -f posix.mak test/coverage/.run
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
There are also unittest which have a different behavior when built in <tt>debug</tt>.
 +
To test this, you can set the <tt>BUILD</tt> mode:
 +
 +
<syntaxhighlight lang=bash>
 +
make -f posix.mak test/exceptions/.run BUILD=debug
 +
</syntaxhighlight>
 +
 +
When you execute the <tt>unittest</tt> target, <tt>unittest-debug</tt> and <tt>unittest-release</tt> are tested.
  
 
== Run benchmark ==
 
== Run benchmark ==

Revision as of 09:15, 13 December 2017

Welcome to the D community and thanks for your interest in contributing! If you need help you can ask questions on #d IRC channel on freenode.org (web interface) or on our forum.

This section explains commonly commands which are commonly used to test the low level runtime library for the D programming language.


Run all tests

The entire druntime testsuite can be run with the unittest target:

make -f posix.mak unittest -j4

Run an individual test

Sometimes it can be helpful to rerun only a single test which tests the module or feature one is working on. For example:

make -f posix.mak test/coverage/.run

There are also unittest which have a different behavior when built in debug. To test this, you can set the BUILD mode:

make -f posix.mak test/exceptions/.run BUILD=debug

When you execute the unittest target, unittest-debug and unittest-release are tested.

Run benchmark

If you are making a bigger change or want to improve the performance of a specific function in druntime, you should run the included benchmark script:

rdmd benchmark/runbench.d