std_benchmark 0.3.1

Randomized benchmark and unittesting module


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

/** 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;

uint sumOfDivisors(uint a) 
{
	uint ret;
	for (uint i = 1; i < a/2; ++i)
	{
		if (ret % i == 0) {
			ret += i;
		}
	}
	return ret;
}

/// Ditto
unittest
{
    alias bench = benchmark!(sumOfDivisors);
    BenchmarkResult result = bench.execute();

    stdoutPrinter(result);
}

Authors: Robert burner Schadek

Dependencies: none

Versions:
0.3.1 2017-Jun-01
0.3.0 2017-May-30
0.2.0 2017-May-04
0.1.2 2017-Feb-04
0.1.1 2016-Sep-09
Show all 15 versions
Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 134 downloads total