mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00
std.stdio: move std.process import inside unittest
This moves the std.process import inside the unittest. The import is not used elsewhere, and so is unnecessary for non-unittest builds. This greatly speeds up importing std.stdio. (In a simple testcase, more than 90% of the import time of std.stdio was spent on std.process) I've tried to keep whitespace changes to a minimum, while keeping the code readable.
This commit is contained in:
parent
2cd39dff61
commit
dfd45c0ac1
1 changed files with 4 additions and 2 deletions
|
@ -1493,8 +1493,9 @@ Removes the lock over the specified file segment.
|
|||
}
|
||||
|
||||
version (Posix)
|
||||
static if (__traits(compiles, { import std.process : spawnProcess; }))
|
||||
@system unittest
|
||||
{
|
||||
static if (__traits(compiles, { import std.process : spawnProcess; }))
|
||||
{
|
||||
static import std.file;
|
||||
auto deleteme = testFilename();
|
||||
|
@ -1548,7 +1549,8 @@ Removes the lock over the specified file segment.
|
|||
g.unlock();
|
||||
});
|
||||
f.unlock();
|
||||
}
|
||||
} // static if
|
||||
} // unittest
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue