From 0ad36cae798f1d0698bfea2130f29707ee2a47e9 Mon Sep 17 00:00:00 2001 From: Petru Trimbitas Date: Fri, 15 Apr 2022 21:26:23 +0300 Subject: [PATCH] Add javascript --- README | 40 ---------------------- gruntmaster-compile | 3 +- lib/Gruntmaster/Daemon.pm | 1 + t/01-jobs.t | 3 +- t/problems/hello/tests/javascript/meta.yml | 7 ++++ t/problems/hello/tests/javascript/prog.js | 1 + 6 files changed, 13 insertions(+), 42 deletions(-) delete mode 100644 README create mode 100644 t/problems/hello/tests/javascript/meta.yml create mode 100644 t/problems/hello/tests/javascript/prog.js diff --git a/README b/README deleted file mode 100644 index 1b0e7ab..0000000 --- a/README +++ /dev/null @@ -1,40 +0,0 @@ -Gruntmaster-Daemon version 0.001 -================================ - -The README is used to introduce the module and provide instructions on -how to install the module, any machine dependencies it may have (for -example C compilers and installed libraries) and any other information -that should be provided before the module is installed. - -A README file is required for CPAN modules since CPAN extracts the -README file from a module distribution so that people browsing the -archive can use it get an idea of the modules uses. It is usually a -good idea to provide version information here so that people can -decide whether fixes for the module are worth downloading. - -INSTALLATION - -To install this module type the following: - - perl Makefile.PL - make - make test - make install - -DEPENDENCIES - -This module requires these other modules and libraries: - - blah blah blah - -COPYRIGHT AND LICENCE - -Put the correct copyright and licence information here. - -Copyright (C) 2013 by Marius Gavrilescu - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself, either Perl version 5.18.1 or, -at your option, any later version of Perl 5 you may have available. - - diff --git a/gruntmaster-compile b/gruntmaster-compile index 2538cde..3599621 100755 --- a/gruntmaster-compile +++ b/gruntmaster-compile @@ -41,11 +41,12 @@ given ($format){ exit } - when ([qw/GOLFSCRIPT JULIA PERL PHP PYTHON PYTHON3 RUBY SBCL/]){ + when ([qw/GOLFSCRIPT JAVASCRIPT JULIA PERL PHP PYTHON PYTHON3 RUBY SBCL/]){ open IN, '<', $name; open OUT, '>', $basename; print OUT "#!/usr/bin/golfscript\n" if $_ eq 'GOLFSCRIPT'; print OUT "#!/usr/bin/julia -O\n" if $_ eq 'JULIA'; + print OUT "#!/usr/bin/node\n" if $_ eq 'JAVASCRIPT'; print OUT "#!/usr/bin/perl\n" if $_ eq 'PERL'; print OUT "#!/usr/bin/php -d ONLINE_JUDGE=true\n" if $_ eq 'PHP'; print OUT "#!/usr/bin/python2.7\n" if $_ eq 'PYTHON'; diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index ef24364..9597572 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -27,6 +27,7 @@ use constant FORMAT_EXTENSION => { GOLFSCRIPT => 'gs', HASKELL => 'hs', JAVA => 'java', + JAVASCRIPT => 'js', JULIA => 'jl', MONO => 'cs', OBERON => 'm', diff --git a/t/01-jobs.t b/t/01-jobs.t index 0bb2350..c37e081 100644 --- a/t/01-jobs.t +++ b/t/01-jobs.t @@ -26,6 +26,7 @@ use constant COMPILER => { GOLFSCRIPT golfscript MONO gmcs JAVA javac + JAVASCRIPT node JULIA julia PASCAL fpc GOLANG go @@ -40,7 +41,7 @@ use constant COMPILER => { OCAML ocaml SBCL sbcl/}; -my %needs_fork = map { $_ => 1 } qw/GOLANG GOLFSCRIPT GCCGO JAVA JULIA RUBY/; +my %needs_fork = map { $_ => 1 } qw/GOLANG GOLFSCRIPT GCCGO JAVA JAVASCRIPT JULIA RUBY SBCL/; my $loglevel = $ENV{TEST_LOG_LEVEL} // ($ENV{TEST_VERBOSE} ? 'TRACE' : 'OFF'); my $log_conf = <