Merge pull request #166 from vibe-d/update_compiler_support
Update to DMD 2.087.0 and LDC 1.6.0. merged-on-behalf-of: Leonid Kramer <l-kramer@users.noreply.github.com>
This commit is contained in:
commit
beac700a5b
14
.travis.yml
14
.travis.yml
|
@ -5,20 +5,16 @@ d:
|
|||
# this way the overall test time gets cut down (GDC/LDC are a lot
|
||||
# slower tham DMD, so they should be started early), while still
|
||||
# catching most DMD version related build failures early
|
||||
- dmd-2.086.0
|
||||
- dmd-2.087.1
|
||||
- dmd-2.078.3
|
||||
- ldc-1.16.0
|
||||
- ldc-1.15.0
|
||||
- ldc-1.14.0
|
||||
- ldc-1.13.0
|
||||
- ldc-1.12.0
|
||||
- ldc-1.11.0
|
||||
- ldc-1.10.0
|
||||
- ldc-1.9.0
|
||||
- ldc-1.8.0
|
||||
- dmd-2.086.1
|
||||
- dmd-2.085.1
|
||||
- dmd-2.084.1
|
||||
- dmd-2.083.1
|
||||
- dmd-2.082.1
|
||||
- dmd-2.081.2
|
||||
- dmd-2.080.1
|
||||
- dmd-2.079.0
|
||||
- dmd-beta
|
||||
|
||||
|
|
15
README.md
15
README.md
|
@ -26,22 +26,19 @@ Supported compilers
|
|||
|
||||
The following compilers are tested and supported:
|
||||
|
||||
- DMD 2.086.0
|
||||
- DMD 2.087.1
|
||||
- DMD 2.086.1
|
||||
- DMD 2.085.1
|
||||
- DMD 2.084.1
|
||||
- DMD 2.083.1
|
||||
- DMD 2.082.1
|
||||
- DMD 2.081.2
|
||||
- DMD 2.080.1
|
||||
- DMD 2.079.0
|
||||
- DMD 2.078.3
|
||||
- LDC 1.16.0
|
||||
- LDC 1.15.0
|
||||
- LDC 1.14.0
|
||||
- LDC 1.13.0
|
||||
- LDC 1.12.0
|
||||
- LDC 1.11.0
|
||||
- LDC 1.10.0
|
||||
- LDC 1.9.0
|
||||
|
||||
Supported up to 1.6.2:
|
||||
- DMD 2.078.3
|
||||
- LDC 1.8.0
|
||||
|
||||
Supported up to 1.4.7:
|
||||
|
|
37
appveyor.yml
37
appveyor.yml
|
@ -2,37 +2,28 @@ platform: x64
|
|||
environment:
|
||||
matrix:
|
||||
- DC: dmd
|
||||
DVersion: 2.086.0
|
||||
DVersion: 2.087.1
|
||||
arch: x64
|
||||
- DC: dmd
|
||||
DVersion: 2.086.0
|
||||
DVersion: 2.087.1
|
||||
arch: x86
|
||||
- DC: dmd
|
||||
DVersion: 2.086.0
|
||||
DVersion: 2.087.1
|
||||
arch: x86_mscoff
|
||||
- DC: dmd
|
||||
DVersion: 2.086.1
|
||||
arch: x64
|
||||
- DC: dmd
|
||||
DVersion: 2.085.1
|
||||
arch: x64
|
||||
- DC: dmd
|
||||
DVersion: 2.084.1
|
||||
arch: x86
|
||||
- DC: dmd
|
||||
DVersion: 2.083.1
|
||||
arch: x86_mscoff
|
||||
- DC: dmd
|
||||
DVersion: 2.082.1
|
||||
arch: x86_mscoff
|
||||
- DC: dmd
|
||||
DVersion: 2.081.2
|
||||
arch: x86_mscoff
|
||||
- DC: dmd
|
||||
DVersion: 2.080.1
|
||||
arch: x86_mscoff
|
||||
- DC: dmd
|
||||
DVersion: 2.079.0
|
||||
arch: x86_mscoff
|
||||
- DC: dmd
|
||||
DVersion: 2.078.3
|
||||
- DC: ldc
|
||||
DVersion: 1.16.0
|
||||
arch: x64
|
||||
- DC: ldc
|
||||
DVersion: 1.15.0
|
||||
|
@ -43,21 +34,9 @@ environment:
|
|||
- DC: ldc
|
||||
DVersion: 1.13.0
|
||||
arch: x64
|
||||
- DC: ldc
|
||||
DVersion: 1.12.0
|
||||
arch: x64
|
||||
- DC: ldc
|
||||
DVersion: 1.11.0
|
||||
arch: x64
|
||||
- DC: ldc
|
||||
DVersion: 1.10.0
|
||||
arch: x64
|
||||
- DC: ldc
|
||||
DVersion: 1.9.0
|
||||
arch: x64
|
||||
- DC: ldc
|
||||
DVersion: 1.8.0
|
||||
arch: x64
|
||||
|
||||
skip_tags: false
|
||||
|
||||
|
|
|
@ -9,201 +9,211 @@ import core.thread;
|
|||
import vibe.core.log;
|
||||
import vibe.core.core;
|
||||
import vibe.core.process;
|
||||
import std.algorithm;
|
||||
import std.array;
|
||||
import std.range;
|
||||
import std.algorithm;
|
||||
|
||||
void testEcho()
|
||||
{
|
||||
foreach (i; 0..100) {
|
||||
auto procPipes = pipeProcess(["echo", "foo bar"], Redirect.stdout);
|
||||
foreach (i; 0..100) {
|
||||
auto procPipes = pipeProcess(["echo", "foo bar"], Redirect.stdout);
|
||||
|
||||
assert(!procPipes.process.exited);
|
||||
auto output = procPipes.stdout.collectOutput();
|
||||
|
||||
auto output = procPipes.stdout.collectOutput();
|
||||
assert(procPipes.process.wait() == 0);
|
||||
assert(procPipes.process.exited);
|
||||
|
||||
assert(procPipes.process.wait() == 0);
|
||||
assert(procPipes.process.exited);
|
||||
|
||||
assert(output == "foo bar\n");
|
||||
}
|
||||
assert(output == "foo bar\n");
|
||||
}
|
||||
}
|
||||
|
||||
void testCat()
|
||||
{
|
||||
auto procPipes = pipeProcess(["cat"]);
|
||||
auto procPipes = pipeProcess(["cat"]);
|
||||
|
||||
string output;
|
||||
auto outputTask = runTask({
|
||||
output = procPipes.stdout.collectOutput();
|
||||
});
|
||||
string output;
|
||||
auto outputTask = runTask({
|
||||
output = procPipes.stdout.collectOutput();
|
||||
});
|
||||
|
||||
auto inputs = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
|
||||
.map!(s => s ~ "\n")
|
||||
.repeat(4000).join.array;
|
||||
foreach (input; inputs) {
|
||||
procPipes.stdin.write(input);
|
||||
}
|
||||
auto inputs = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
|
||||
.map!(s => s ~ "\n")
|
||||
.repeat(4000).join.array;
|
||||
foreach (input; inputs) {
|
||||
procPipes.stdin.write(input);
|
||||
}
|
||||
|
||||
procPipes.stdin.close();
|
||||
assert(procPipes.process.wait() == 0);
|
||||
procPipes.stdin.close();
|
||||
assert(procPipes.process.wait() == 0);
|
||||
|
||||
outputTask.join();
|
||||
outputTask.join();
|
||||
|
||||
assert(output == inputs.join());
|
||||
assert(output == inputs.join());
|
||||
}
|
||||
|
||||
void testStderr()
|
||||
{
|
||||
auto program = q{
|
||||
foreach (line; stdin.byLine())
|
||||
stderr.writeln(line);
|
||||
};
|
||||
auto procPipes = pipeProcess(["rdmd", "--eval", program], Redirect.stdin | Redirect.stderr);
|
||||
auto program = q{
|
||||
foreach (line; stdin.byLine())
|
||||
stderr.writeln(line);
|
||||
};
|
||||
auto procPipes = pipeProcess(["rdmd", "--eval", program], Redirect.stdin | Redirect.stderr);
|
||||
|
||||
// Wait for rdmd to compile
|
||||
sleep(3.seconds);
|
||||
// Wait for rdmd to compile
|
||||
sleep(3.seconds);
|
||||
|
||||
string output;
|
||||
auto outputTask = runTask({
|
||||
output = procPipes.stderr.collectOutput();
|
||||
});
|
||||
string output;
|
||||
auto outputTask = runTask({
|
||||
output = procPipes.stderr.collectOutput();
|
||||
});
|
||||
|
||||
auto inputs = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
|
||||
.map!(s => s ~ "\n")
|
||||
.repeat(4000).join.array;
|
||||
foreach (input; inputs) {
|
||||
procPipes.stdin.write(input);
|
||||
}
|
||||
auto inputs = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
|
||||
.map!(s => s ~ "\n")
|
||||
.repeat(4000).join.array;
|
||||
foreach (input; inputs) {
|
||||
procPipes.stdin.write(input);
|
||||
}
|
||||
|
||||
procPipes.stdin.close();
|
||||
assert(procPipes.process.wait() == 0);
|
||||
procPipes.stdin.close();
|
||||
assert(procPipes.process.wait() == 0);
|
||||
|
||||
outputTask.join();
|
||||
outputTask.join();
|
||||
|
||||
assert(output == inputs.join);
|
||||
assert(output == inputs.join);
|
||||
}
|
||||
|
||||
void testRandomDeath()
|
||||
{
|
||||
auto program = q{
|
||||
import core.thread;
|
||||
import std.random;
|
||||
Thread.sleep(dur!"msecs"(uniform(0, 1000)));
|
||||
};
|
||||
// Prime rdmd
|
||||
execute(["rdmd", "--eval", program]);
|
||||
auto program = q{
|
||||
import core.thread;
|
||||
import std.random;
|
||||
Thread.sleep(dur!"msecs"(uniform(0, 1000)));
|
||||
};
|
||||
// Prime rdmd
|
||||
execute(["rdmd", "--eval", program]);
|
||||
|
||||
foreach (i; 0..20) {
|
||||
auto process = spawnProcess(["rdmd", "--eval", program]);
|
||||
foreach (i; 0..20) {
|
||||
auto process = spawnProcess(["rdmd", "--eval", program]);
|
||||
|
||||
assert(!process.exited);
|
||||
assert(!process.exited);
|
||||
|
||||
sleep(800.msecs);
|
||||
try {
|
||||
process.kill();
|
||||
} catch (Exception e) {}
|
||||
process.wait();
|
||||
sleep(800.msecs);
|
||||
try {
|
||||
process.kill();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
process.wait();
|
||||
|
||||
assert(process.exited);
|
||||
}
|
||||
assert(process.exited);
|
||||
}
|
||||
}
|
||||
|
||||
void testIgnoreSigterm()
|
||||
{
|
||||
auto program = q{
|
||||
import core.thread;
|
||||
import core.sys.posix.signal;
|
||||
auto program = q{
|
||||
import core.thread;
|
||||
import core.sys.posix.signal;
|
||||
|
||||
signal(SIGINT, SIG_IGN);
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
signal(SIGINT, SIG_IGN);
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
|
||||
foreach (line; stdin.byLine()) {
|
||||
writeln(line);
|
||||
stdout.flush();
|
||||
}
|
||||
foreach (line; stdin.byLine()) {
|
||||
writeln(line);
|
||||
stdout.flush();
|
||||
}
|
||||
|
||||
// Zombie
|
||||
while (true) Thread.sleep(100.dur!"msecs");
|
||||
};
|
||||
auto procPipes = pipeProcess(
|
||||
["rdmd", "--eval", program],
|
||||
Redirect.stdin | Redirect.stdout | Redirect.stderrToStdout);
|
||||
// Zombie
|
||||
while (true) Thread.sleep(100.dur!"msecs");
|
||||
};
|
||||
auto procPipes = pipeProcess(
|
||||
["rdmd", "--eval", program],
|
||||
Redirect.stdin | Redirect.stdout | Redirect.stderrToStdout);
|
||||
|
||||
string output;
|
||||
auto outputTask = runTask({
|
||||
output = procPipes.stdout.collectOutput();
|
||||
});
|
||||
string output;
|
||||
auto outputTask = runTask({
|
||||
output = procPipes.stdout.collectOutput();
|
||||
});
|
||||
|
||||
assert(!procPipes.process.exited);
|
||||
assert(!procPipes.process.exited);
|
||||
|
||||
// Give the program some time to compile and install the signal handler
|
||||
sleep(4.seconds);
|
||||
// Give the program some time to compile and install the signal handler
|
||||
sleep(4.seconds);
|
||||
|
||||
procPipes.process.kill();
|
||||
procPipes.stdin.write("foo\n");
|
||||
procPipes.process.kill();
|
||||
procPipes.stdin.write("foo\n");
|
||||
|
||||
assert(!procPipes.process.exited);
|
||||
assert(!procPipes.process.exited);
|
||||
|
||||
assert(procPipes.process.waitOrForceKill(2.seconds) == 9);
|
||||
assert(procPipes.process.waitOrForceKill(2.seconds) == -9);
|
||||
|
||||
assert(procPipes.process.exited);
|
||||
assert(procPipes.process.exited);
|
||||
|
||||
outputTask.join();
|
||||
outputTask.join();
|
||||
|
||||
assert(output == "foo\n");
|
||||
assert(output == "foo\n");
|
||||
}
|
||||
|
||||
void testSimpleShell()
|
||||
{
|
||||
auto res = executeShell("echo foo");
|
||||
auto res = executeShell("echo foo");
|
||||
|
||||
assert(res.status == 0);
|
||||
assert(res.output == "foo\n");
|
||||
assert(res.status == 0);
|
||||
assert(res.output == "foo\n");
|
||||
}
|
||||
|
||||
void testLineEndings()
|
||||
{
|
||||
auto program = q{
|
||||
write("linux\n");
|
||||
write("os9\r");
|
||||
write("win\r\n");
|
||||
};
|
||||
auto res = execute(["rdmd", "--eval", program]);
|
||||
auto program = q{
|
||||
write("linux\n");
|
||||
write("os9\r");
|
||||
write("win\r\n");
|
||||
};
|
||||
auto res = execute(["rdmd", "--eval", program]);
|
||||
|
||||
assert(res.status == 0);
|
||||
assert(res.output == "linux\nos9\rwin\r\n");
|
||||
assert(res.status == 0);
|
||||
assert(res.output == "linux\nos9\rwin\r\n");
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// rdmd --eval is only supported in versions >= 2.080
|
||||
static if (__VERSION__ >= 2080) {
|
||||
runTask({
|
||||
auto tasks = [
|
||||
&testEcho,
|
||||
&testCat,
|
||||
&testStderr,
|
||||
&testRandomDeath,
|
||||
&testIgnoreSigterm,
|
||||
&testSimpleShell,
|
||||
&testLineEndings,
|
||||
].map!(fn => runTask({
|
||||
try {
|
||||
fn();
|
||||
} catch (Exception e) {
|
||||
logError("%s", e);
|
||||
throw e;
|
||||
}
|
||||
}));
|
||||
import core.stdc.stdlib : abort;
|
||||
import core.time;
|
||||
import std.meta : AliasSeq;
|
||||
|
||||
foreach (task; tasks) {
|
||||
task.join();
|
||||
}
|
||||
// rdmd --eval is only supported in versions >= 2.080
|
||||
static if (__VERSION__ >= 2080) {
|
||||
runTask({
|
||||
alias Tasks = AliasSeq!(
|
||||
testEcho,
|
||||
testCat,
|
||||
testStderr,
|
||||
testRandomDeath,
|
||||
testIgnoreSigterm,
|
||||
testSimpleShell,
|
||||
testLineEndings
|
||||
);
|
||||
|
||||
exitEventLoop();
|
||||
});
|
||||
static foreach (alias task; Tasks) {{
|
||||
auto t = runTask({
|
||||
logInfo("Running test %s...", __traits(identifier, task));
|
||||
auto tm = setTimer(60.seconds, {
|
||||
logError("Test %s timed out!", __traits(identifier, task));
|
||||
abort();
|
||||
});
|
||||
try {
|
||||
task();
|
||||
} catch (Exception e) {
|
||||
logError("Test %s failed: %s", __traits(identifier, task), e);
|
||||
abort();
|
||||
}
|
||||
tm.stop();
|
||||
});
|
||||
t.join();
|
||||
}}
|
||||
|
||||
runEventLoop();
|
||||
}
|
||||
exitEventLoop();
|
||||
});
|
||||
|
||||
runEventLoop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue