-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from kapillamba4/add-csharp
Add support for csharp
- Loading branch information
Showing
9 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:3.6 | ||
|
||
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ | ||
&& apk add --update --no-cache mono@testing bash | ||
|
||
COPY ./compile.sh /bin/compile.sh | ||
COPY ./run.sh /bin/run.sh | ||
|
||
RUN chmod 777 /bin/compile.sh; \ | ||
chmod 777 /bin/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
csc program.cs 2> compile.stderr 1> compile.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
chmod 777 program.exe | ||
mono program.exe < run.stdin 1> run.stdout 2> run.stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System; | ||
|
||
public class HelloWorld { | ||
static public void Main () { | ||
Console.WriteLine ("Hello " + Console.ReadLine()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
World |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
pushd $(dirname "$0") | ||
DIR=$(pwd) | ||
RUNBOX="${DIR}/runbox" | ||
|
||
echo $RUNBOX | ||
# Create runbox | ||
mkdir -p $RUNBOX | ||
|
||
# Copy source to runbox | ||
cp $DIR/program.cs $RUNBOX/program.cs | ||
cp $DIR/run.stdin $RUNBOX/run.stdin | ||
|
||
# Test Compile | ||
docker run \ | ||
--cpus="1" \ | ||
--memory="100m" \ | ||
--ulimit nofile=64:64 \ | ||
--rm \ | ||
--read-only \ | ||
-v "$RUNBOX":/usr/src/runbox \ | ||
-w /usr/src/runbox codingblocks/judge-worker-csharp \ | ||
bash -c "/bin/compile.sh && /bin/run.sh" | ||
|
||
ls -lh ${RUNBOX} | ||
|
||
expected="Hello World" | ||
actual="$(cat ${RUNBOX}/run.stdout)" | ||
if [ "$expected" == "$actual" ] ;then | ||
: | ||
else | ||
echo "MISMATCH: Expected = $expected; Actual = $actual" | ||
exit 1 | ||
fi | ||
|
||
# Delete runbox | ||
rm -rf $RUNBOX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters