From 49b65824460a3f79c2fcd2a8bae9dd42534f64c9 Mon Sep 17 00:00:00 2001 From: Sergiu Date: Fri, 22 Jan 2016 23:01:44 +0200 Subject: [PATCH] Add D --- gruntmaster-compile | 1 + lib/Gruntmaster/Daemon.pm | 1 + t/01-jobs.t | 1 + t/problems/hello/tests/d/meta.yml | 7 +++++++ t/problems/hello/tests/d/prog.d | 4 ++++ 5 files changed, 14 insertions(+) create mode 100644 t/problems/hello/tests/d/meta.yml create mode 100644 t/problems/hello/tests/d/prog.d diff --git a/gruntmaster-compile b/gruntmaster-compile index 3a0dac8..be5dab5 100755 --- a/gruntmaster-compile +++ b/gruntmaster-compile @@ -31,6 +31,7 @@ given ($format){ exec 'ghc', qw/-DONLINE_JUDGE -Wall -O2 -o/, $basename, $name when 'HASKELL'; exec 'rustc', qw/-O -o/, $basename, $name when 'RUST'; exec 'ocamlc', qw/-o/, $basename, $name when 'OCAML'; + exec 'dmd', qw/-version=ONLINE_JUDGE -O -release -inline -noboundscheck/, $name when 'D'; when ('BRAINFUCK') { system 'bfc', $name and die "bfc failed: errno=$! return=$?"; diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index f37eaf6..7189c84 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -21,6 +21,7 @@ use constant FORMAT_EXTENSION => { BRAINFUCK => 'bf', C => 'c', CPP => 'cpp', + D => 'd', GCCGO => 'go', GOLANG => 'go', GOLFSCRIPT => 'gs', diff --git a/t/01-jobs.t b/t/01-jobs.t index 6fb5a16..2cb1eb1 100644 --- a/t/01-jobs.t +++ b/t/01-jobs.t @@ -22,6 +22,7 @@ use constant COMPILER => { qw/BRAINFUCK bfc C gcc CPP g++ + D dmd GOLFSCRIPT golfscript MONO gmcs JAVA javac diff --git a/t/problems/hello/tests/d/meta.yml b/t/problems/hello/tests/d/meta.yml new file mode 100644 index 0000000..806a1fd --- /dev/null +++ b/t/problems/hello/tests/d/meta.yml @@ -0,0 +1,7 @@ +test_name: D +test_description: Hello world in D +problem: hello +files: + prog: + format: D + name: prog.d diff --git a/t/problems/hello/tests/d/prog.d b/t/problems/hello/tests/d/prog.d new file mode 100644 index 0000000..4d988a9 --- /dev/null +++ b/t/problems/hello/tests/d/prog.d @@ -0,0 +1,4 @@ +import std.stdio : writeln; +void main() { + writeln("Hello World!"); +} -- 2.39.2