Skip to content

Commit 3121a99

Browse files
CyberShadowdlang-bot
authored andcommitted
std.socket: Always compile slow unit tests
1 parent f712d16 commit 3121a99

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

std/socket.d

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ version (StdUnittest)
122122
writefln("Ignoring std.socket(%d) test failure (likely caused by flaky environment): %s", line, e.msg);
123123
}
124124
}
125+
126+
// Without debug=std_socket, still compile the slow tests, just don't run them.
127+
debug (std_socket)
128+
private enum runSlowTests = true;
129+
else
130+
private enum runSlowTests = false;
125131
}
126132

127133
/// Base exception thrown by `std.socket`.
@@ -1698,7 +1704,7 @@ public:
16981704
}
16991705
});
17001706

1701-
debug (std_socket)
1707+
if (runSlowTests)
17021708
softUnittest({
17031709
// test failing reverse lookup
17041710
const InternetAddress ia = new InternetAddress("255.255.255.255", 80);
@@ -2633,7 +2639,7 @@ private:
26332639

26342640
@safe unittest
26352641
{
2636-
debug (std_socket)
2642+
if (runSlowTests)
26372643
softUnittest({
26382644
import std.datetime.stopwatch;
26392645
import std.typecons;

0 commit comments

Comments
 (0)