File tree Expand file tree Collapse file tree 9 files changed +78
-1
lines changed Expand file tree Collapse file tree 9 files changed +78
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ Currently we have following images -
2121
2222 - [ c] ( containers/c )
2323 - [ cpp] ( containers/cpp )
24+ - [ c#] ( containers/csharp )
2425 - [ java8] ( containers/java8 )
2526 - [ nodejs6] ( containers/nodejs6 )
2627 - [ nodejs] ( containers/nodejs8 )
Original file line number Diff line number Diff line change 1+ FROM alpine:3.6
2+
3+ RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
4+ && apk add --update --no-cache mono@testing bash
5+
6+ COPY ./compile.sh /bin/compile.sh
7+ COPY ./run.sh /bin/run.sh
8+
9+ RUN chmod 777 /bin/compile.sh; \
10+ chmod 777 /bin/run.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ csc program.cs 2> compile.stderr 1> compile.stdout
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ chmod 777 program.exe
4+ mono program.exe < run.stdin 1> run.stdout 2> run.stderr
Original file line number Diff line number Diff line change 88# bash tests/cpp/test_worker.sh
99# }
1010
11+ @test " test csharp" {
12+ bash tests/csharp/test_worker.sh
13+ }
14+
1115@test " test java8" {
1216 bash tests/java8/test_worker.sh
1317}
Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ public class HelloWorld {
4+ static public void Main ( ) {
5+ Console . WriteLine ( "Hello " + Console . ReadLine ( ) ) ;
6+ }
7+ }
Original file line number Diff line number Diff line change 1+ World
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ pushd $( dirname " $0 " )
3+ DIR=$( pwd)
4+ RUNBOX=" ${DIR} /runbox"
5+
6+ echo $RUNBOX
7+ # Create runbox
8+ mkdir -p $RUNBOX
9+
10+ # Copy source to runbox
11+ cp $DIR /program.cs $RUNBOX /program.cs
12+ cp $DIR /run.stdin $RUNBOX /run.stdin
13+
14+ # Test Compile
15+ docker run \
16+ --cpus=" 1" \
17+ --memory=" 100m" \
18+ --ulimit nofile=64:64 \
19+ --rm \
20+ --read-only \
21+ -v " $RUNBOX " :/usr/src/runbox \
22+ -w /usr/src/runbox codingblocks/judge-worker-csharp \
23+ bash -c " /bin/compile.sh && /bin/run.sh"
24+
25+ ls -lh ${RUNBOX}
26+
27+ expected=" Hello World"
28+ actual=" $( cat ${RUNBOX} /run.stdout) "
29+ if [ " $expected " == " $actual " ] ; then
30+ :
31+ else
32+ echo " MISMATCH: Expected = $expected ; Actual = $actual "
33+ exit 1
34+ fi
35+
36+ # Delete runbox
37+ rm -rf $RUNBOX
Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ docker run \
2525 -w /usr/src/runbox codingblocks/judge-worker-ruby \
2626 bash -c " /bin/compile.sh && /bin/run.sh"
2727
28+ ls -lh ${RUNBOX}
29+
30+ expected=" Hello World"
31+ actual=" $( cat ${RUNBOX} /run.stdout) "
32+ if [ " $expected " == " $actual " ] ; then
33+ :
34+ else
35+ echo " MISMATCH: Expected = $expected ; Actual = $actual "
36+ exit 1
37+ fi
2838
2939# Delete runbox
30- rm -rf $RUNBOX
40+ rm -rf $RUNBOX
You can’t perform that action at this time.
0 commit comments