/** This module combines randomized unittests with benchmarking capabilites.
To gain appropriate test coverage and to test unexpected inputs, randomized
unittest are a possible approach.
Additionally, they lend itself for reproducible benchmarking and performance
monitoring.
$(D randomizedtestbenchmark) is a test data generation and benchmark
package. The below example shows a simple example of how to test a function
with this package.
*/
import randomizedtestbenchmark;
bool isPrime(uint a)
{
uint ret;
for (uint i = 2; i < a; ++i)
{
if (ret % i == 0) {
return false;
}
}
return true;
}
///
unittest
{
alias bench = benchmark!(isPrime);
BenchmarkResult result = bench.execute();
stdoutPrinter!(Min, Mode, Quantil!0.5, Max)(result);
gnuplot!(Min, Mode, Quantil!0.5, Max)(result);
}
burner/benchmark
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A benchmarking and parameterized unit testing framework for D.
Resources
Stars
Watchers
Forks
Packages 0
No packages published