From: Sergiu Date: Thu, 21 Jan 2016 04:27:30 +0000 (+0200) Subject: Add OCaml X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=34e1677139c95be7cb419d4813d83943a70f446e;p=gruntmaster-daemon.git Add OCaml --- diff --git a/gruntmaster-compile b/gruntmaster-compile index 0ab18fc..c83a03f 100755 --- a/gruntmaster-compile +++ b/gruntmaster-compile @@ -30,6 +30,7 @@ given ($format){ exec 'go', qw/build -compiler gccgo/, $name, when 'GCCGO'; 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'; when ('BRAINFUCK') { system 'bfc', $name and die "bfc failed: errno=$! return=$?"; @@ -118,6 +119,10 @@ Compile commands for each format: ghc -DONLINE_JUDGE -Wall -O2 -o $output $input +=item OCAML + + ocamlc -o $output $input + =item RUST rustc -O -o $output $input diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index b6d3a52..f37eaf6 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -28,6 +28,7 @@ use constant FORMAT_EXTENSION => { JAVA => 'java', JULIA => 'jl', MONO => 'cs', + OCAML => 'ml', PASCAL => 'pas', PERL => 'pl', PHP => 'php', diff --git a/t/01-jobs.t b/t/01-jobs.t index 90f7d70..03f4845 100644 --- a/t/01-jobs.t +++ b/t/01-jobs.t @@ -35,6 +35,7 @@ use constant COMPILER => { PYTHON python RUBY ruby RUST rustc + OCAML ocaml SBCL sbcl/}; my %needs_fork = map { $_ => 1 } qw/GOLANG GOLFSCRIPT GCCGO JAVA JULIA RUBY/; diff --git a/t/problems/hello/tests/ocaml/meta.yml b/t/problems/hello/tests/ocaml/meta.yml new file mode 100644 index 0000000..b14b550 --- /dev/null +++ b/t/problems/hello/tests/ocaml/meta.yml @@ -0,0 +1,7 @@ +test_name: OCaml +test_description: Hello world in OCaml +problem: hello +files: + prog: + format: OCAML + name: prog.ml diff --git a/t/problems/hello/tests/ocaml/prog.ml b/t/problems/hello/tests/ocaml/prog.ml new file mode 100644 index 0000000..4194180 --- /dev/null +++ b/t/problems/hello/tests/ocaml/prog.ml @@ -0,0 +1 @@ +print_endline "Hello World!"