Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Dec 27, 2014
1 parent 459275c commit 758a3ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions benchmark/runbench.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Martin Nowak
*/
import std.ascii, std.exception, std.file, std.path,
std.process, std.regex, std.stdio, std.string, std.typecons;
import std.stdio;

// cmdline flags
bool verbose;

void runCmd(string cmd)
{
import std.exception : enforce;
import std.process : system;
if (verbose)
writeln(cmd);
enforce(!system(cmd));
}

void runTest(string pattern, string dmd, string dflags)
{
import std.file, std.path, std.regex, std.string;

string[] sources;
auto re = regex(pattern, "g");
auto self = buildPath(".", "runbench.d");
Expand Down Expand Up @@ -64,6 +67,7 @@ void runTest(string pattern, string dmd, string dflags)

void printHelp()
{
import std.ascii : newline;
auto helpString =
"usage: runbench [<tests>] [<dflags>] [-v|--verbose]"~newline~newline~

Expand Down Expand Up @@ -101,8 +105,8 @@ void main(string[] args)
if (!dflags.length)
dflags = "-O -release -inline";

auto dmd = getenv("DMD");
if (!dmd.length) dmd = "dmd";
import std.process : env=environment;
auto dmd = env.get("DMD", "dmd");

foreach(p; patterns)
runTest(p, dmd, dflags);
Expand Down

0 comments on commit 758a3ca

Please sign in to comment.