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

Commit 8fc3345

Browse files
committed
Replace DRuntimeUnittest with existing CoreUnittest
1 parent 26fa565 commit 8fc3345

File tree

21 files changed

+40
-40
lines changed

21 files changed

+40
-40
lines changed

posix.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ else
8888
DFLAGS:=$(UDFLAGS) -inline # unittests don't compile with -inline
8989
endif
9090

91-
UTFLAGS:=-version=CoreUnittest -unittest -checkaction=context -version=DRuntimeUnittest
91+
UTFLAGS:=-version=CoreUnittest -unittest -checkaction=context
9292

9393
# Set PHOBOS_DFLAGS (for linking against Phobos)
9494
PHOBOS_PATH=../phobos

src/core/atomic.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ private
819819
////////////////////////////////////////////////////////////////////////////////
820820

821821

822-
version (DRuntimeUnittest)
822+
version (CoreUnittest)
823823
{
824824
void testXCHG(T)(T val) pure nothrow @nogc @trusted
825825
in

src/core/internal/array/operations.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,12 @@ bool contains(T)(const scope T[] ary, const scope T[] vals...)
449449

450450
// tests
451451

452-
version (DRuntimeUnittest) template TT(T...)
452+
version (CoreUnittest) template TT(T...)
453453
{
454454
alias TT = T;
455455
}
456456

457-
version (DRuntimeUnittest) template _arrayOp(Args...)
457+
version (CoreUnittest) template _arrayOp(Args...)
458458
{
459459
alias _arrayOp = arrayOp!Args;
460460
}

src/core/internal/parseoptions.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool parseOptions(CFG)(ref CFG cfg, string opt)
7878
static if (is(typeof(__traits(getMember, CFG, "help"))))
7979
if (name == "help")
8080
{
81-
version (DRuntimeUnittest) {} else
81+
version (CoreUnittest) {} else
8282
cfg.help();
8383
opt = skip!isspace(tail);
8484
continue;
@@ -135,7 +135,7 @@ private:
135135

136136
bool optError(const scope char[] msg, const scope char[] name, const(char)[] errName)
137137
{
138-
version (DRuntimeUnittest) if (inUnittest) return false;
138+
version (CoreUnittest) if (inUnittest) return false;
139139

140140
fprintf(stderr, "%.*s %.*s option '%.*s'.\n",
141141
cast(int)msg.length, msg.ptr,
@@ -242,7 +242,7 @@ do
242242

243243
bool parseError(const scope char[] exp, const scope char[] opt, const scope char[] got, const(char)[] errName)
244244
{
245-
version (DRuntimeUnittest) if (inUnittest) return false;
245+
version (CoreUnittest) if (inUnittest) return false;
246246

247247
fprintf(stderr, "Expecting %.*s as argument for %.*s option '%.*s', got '%.*s' instead.\n",
248248
cast(int)exp.length, exp.ptr,
@@ -254,7 +254,7 @@ bool parseError(const scope char[] exp, const scope char[] opt, const scope char
254254

255255
size_t min(size_t a, size_t b) { return a <= b ? a : b; }
256256

257-
version (DRuntimeUnittest) __gshared bool inUnittest;
257+
version (CoreUnittest) __gshared bool inUnittest;
258258

259259
unittest
260260
{

src/core/internal/traits.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ template staticMap(alias F, T...)
466466
}
467467

468468
// std.exception.assertCTFEable
469-
version (DRuntimeUnittest) package(core)
469+
version (CoreUnittest) package(core)
470470
void assertCTFEable(alias dg)()
471471
{
472472
static assert({ cast(void) dg(); return true; }());

src/core/lifetime.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ T* emplace(T, Args...)(void[] chunk, auto ref Args args)
752752
}
753753
}
754754

755-
version (DRuntimeUnittest)
755+
version (CoreUnittest)
756756
{
757757
//Ambiguity
758758
private struct __std_conv_S

src/core/sys/windows/basetsd.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ package mixin template AlignedStr(int alignVal, string name, string memberlist,
5858
mixin( _alignSpec ~ " struct " ~ name ~" { " ~ _alignSpec ~":"~ memberlist~" }" );
5959
}
6060

61-
version (DRuntimeUnittest) {
61+
version (CoreUnittest) {
6262
private mixin AlignedStr!(16, "_Test_Aligned_Str", q{char a; char b;});
6363
private mixin AlignedStr!(0, "_Test_NoAligned_Str", q{char a; char b;});
6464
}

src/core/thread/fiber.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ unittest {
15941594
assert( composed.state == Fiber.State.TERM );
15951595
}
15961596

1597-
version (DRuntimeUnittest)
1597+
version (CoreUnittest)
15981598
{
15991599
class TestFiber : Fiber
16001600
{

src/core/time.d

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ ulong mach_absolute_time();
117117
}
118118

119119
//To verify that an lvalue isn't required.
120-
version (DRuntimeUnittest) private T copy(T)(T t)
120+
version (CoreUnittest) private T copy(T)(T t)
121121
{
122122
return t;
123123
}
@@ -3968,7 +3968,7 @@ double _abs(double val) @safe pure nothrow @nogc
39683968
}
39693969

39703970

3971-
version (DRuntimeUnittest)
3971+
version (CoreUnittest)
39723972
string doubleToString(double value) @safe pure nothrow
39733973
{
39743974
string result;
@@ -3999,7 +3999,7 @@ unittest
39993999
assert(aStr == "-0.337", aStr);
40004000
}
40014001

4002-
version (DRuntimeUnittest) const(char)* numToStringz()(long value) @trusted pure nothrow
4002+
version (CoreUnittest) const(char)* numToStringz()(long value) @trusted pure nothrow
40034003
{
40044004
return (signedToTempString(value, 10) ~ "\0").ptr;
40054005
}
@@ -4009,7 +4009,7 @@ import core.internal.traits : AliasSeq;
40094009

40104010

40114011
/+ An adjusted copy of std.exception.assertThrown. +/
4012-
version (DRuntimeUnittest) void _assertThrown(T : Throwable = Exception, E)
4012+
version (CoreUnittest) void _assertThrown(T : Throwable = Exception, E)
40134013
(lazy E expression,
40144014
string msg = null,
40154015
string file = __FILE__,
@@ -4104,7 +4104,7 @@ unittest
41044104
}
41054105

41064106

4107-
version (DRuntimeUnittest) void assertApprox(D, E)(D actual,
4107+
version (CoreUnittest) void assertApprox(D, E)(D actual,
41084108
E lower,
41094109
E upper,
41104110
string msg = "unittest failure",
@@ -4117,7 +4117,7 @@ version (DRuntimeUnittest) void assertApprox(D, E)(D actual,
41174117
throw new AssertError(msg ~ ": upper: " ~ actual.toString(), __FILE__, line);
41184118
}
41194119

4120-
version (DRuntimeUnittest) void assertApprox(D, E)(D actual,
4120+
version (CoreUnittest) void assertApprox(D, E)(D actual,
41214121
E lower,
41224122
E upper,
41234123
string msg = "unittest failure",
@@ -4133,7 +4133,7 @@ version (DRuntimeUnittest) void assertApprox(D, E)(D actual,
41334133
}
41344134
}
41354135

4136-
version (DRuntimeUnittest) void assertApprox(MT)(MT actual,
4136+
version (CoreUnittest) void assertApprox(MT)(MT actual,
41374137
MT lower,
41384138
MT upper,
41394139
string msg = "unittest failure",
@@ -4143,7 +4143,7 @@ version (DRuntimeUnittest) void assertApprox(MT)(MT actual,
41434143
assertApprox(actual._ticks, lower._ticks, upper._ticks, msg, line);
41444144
}
41454145

4146-
version (DRuntimeUnittest) void assertApprox()(long actual,
4146+
version (CoreUnittest) void assertApprox()(long actual,
41474147
long lower,
41484148
long upper,
41494149
string msg = "unittest failure",

src/rt/lifetime.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ unittest
24232423
}
24242424

24252425
// cannot define structs inside unit test block, or they become nested structs.
2426-
version (DRuntimeUnittest)
2426+
version (CoreUnittest)
24272427
{
24282428
struct S1
24292429
{

0 commit comments

Comments
 (0)