Compare commits
14 Commits
16f123233b
...
03c64cfecf
Author | SHA1 | Date |
---|---|---|
Thomas Hobson | 03c64cfecf | |
Thomas Hobson | 5e9b9c888e | |
Thomas Hobson | a1209cdfd5 | |
Thomas Hobson | d2c36d8a54 | |
Thomas Hobson | af91e66d64 | |
Thomas Hobson | ceb902349f | |
Thomas Hobson | 8923fbd5cf | |
Thomas Hobson | ecfdfa52de | |
Thomas Hobson | 594ee7d436 | |
Thomas Hobson | d851515f37 | |
Thomas Hobson | dfdf8ce76e | |
Thomas Hobson | f72c51d614 | |
Thomas Hobson | c6e78fa073 | |
Thomas | aeda95a215 |
|
@ -10,7 +10,7 @@ RUN for i in $(seq 1001 1500); do \
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \
|
apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \
|
||||||
binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \
|
binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \
|
||||||
libncurses6 libncurses5 libedit-dev libseccomp-dev && \
|
libncurses6 libncurses5 libedit-dev libseccomp-dev rename && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Job {
|
||||||
this.uuid = uuidv4();
|
this.uuid = uuidv4();
|
||||||
this.runtime = runtime;
|
this.runtime = runtime;
|
||||||
this.files = files.map((file,i) => ({
|
this.files = files.map((file,i) => ({
|
||||||
name: file.name || `file${i}`,
|
name: file.name || `file${i}.code`,
|
||||||
content: file.content
|
content: file.content
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,13 @@
|
||||||
export DOTNET_CLI_HOME=$PWD
|
export DOTNET_CLI_HOME=$PWD
|
||||||
export HOME=$PWD
|
export HOME=$PWD
|
||||||
|
|
||||||
|
rename 's/$/\.cs/' "$@" # Add .cs extension
|
||||||
|
|
||||||
dotnet build --help > /dev/null # Shut the thing up
|
dotnet build --help > /dev/null # Shut the thing up
|
||||||
|
|
||||||
dotnet new console -o . --no-restore
|
dotnet new console -o . --no-restore
|
||||||
rm Program.cs
|
rm Program.cs
|
||||||
|
|
||||||
|
|
||||||
dotnet restore --source $DOTNET_ROOT/.nuget/packages
|
dotnet restore --source $DOTNET_ROOT/.nuget/packages
|
||||||
dotnet build --no-restore
|
dotnet build --no-restore
|
|
@ -5,16 +5,16 @@
|
||||||
|
|
||||||
case "${PISTON_ALIAS}" in
|
case "${PISTON_ALIAS}" in
|
||||||
gcc | c)
|
gcc | c)
|
||||||
gcc -std=c11 "$@" -lm
|
rename 's/$/\.c/' "$@" # Add .c extension
|
||||||
|
gcc -std=c11 *.c -lm
|
||||||
;;
|
;;
|
||||||
g++ | c++ | cpp)
|
g++ | c++ | cpp)
|
||||||
g++ -std=c++17 "$@"
|
rename 's/$/\.cpp/' "$@" # Add .cpp extension
|
||||||
;;
|
g++ -std=c++17 *.cpp
|
||||||
gccgo | go)
|
|
||||||
gccgo "$@"
|
|
||||||
;;
|
;;
|
||||||
gdc | d)
|
gdc | d)
|
||||||
gdc "$@"
|
rename 's/$/\.d/' "$@" # Add .d extension
|
||||||
|
gdc *.d
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "How did you get here? (${PISTON_ALIAS})"
|
echo "How did you get here? (${PISTON_ALIAS})"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Compile haskell file(s)
|
# Compile haskell file(s)
|
||||||
ghc -dynamic -v0 -o out "$@"
|
rename 's/$/\.hs/' "$@" # Add .hs extension
|
||||||
|
ghc -dynamic -v0 -o out *.hs
|
||||||
chmod +x out
|
chmod +x out
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Put instructions to run the runtime
|
# Put instructions to run the runtime
|
||||||
java "$@"
|
mv $1 $1.java
|
||||||
|
filename=$1.java
|
||||||
|
shift
|
||||||
|
java $filename "$@"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Put instructions to compile source code, remove this file if the language does not require this stage
|
# Put instructions to compile source code, remove this file if the language does not require this stage
|
||||||
kotlinc "$@" -include-runtime -d code.jar
|
|
||||||
|
rename 's/$/\.kt/' "$@" # Add .kt extension
|
||||||
|
|
||||||
|
kotlinc *.kt -include-runtime -d code.jar
|
|
@ -1,3 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ocamlc -o out "$@"
|
rename 's/$/\.ml/' "$@" # Add .ml extension
|
||||||
|
|
||||||
|
ocamlc -o out *.ml
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Compile pony file(s)
|
# Compile pony file(s)
|
||||||
|
rename 's/$/\.pong/' "$@" # Add .pony extension
|
||||||
ponyc -b out
|
ponyc -b out
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Put instructions to run the runtime
|
# Put instructions to run the runtime
|
||||||
scala -color never "$@"
|
scala "$@"
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
AUTH_HEADER="Authorization: $API_KEY"
|
||||||
|
|
||||||
|
for test_file in */*/test.*
|
||||||
|
do
|
||||||
|
IFS='/' read -ra test_parts <<< "$test_file"
|
||||||
|
language=${test_parts[0]}
|
||||||
|
lang_ver=${test_parts[1]}
|
||||||
|
|
||||||
|
test_src=$(python3 -c "import json; print(json.dumps(open('$test_file').read()))")
|
||||||
|
|
||||||
|
json='{"language":"'$language'","version":"'$lang_ver'","files":[{"content":'$test_src'}]}'
|
||||||
|
|
||||||
|
result=$(curl -s -XPOST -H "Content-Type: application/json" -d "$json" https://emkc.org/api/v2/piston/execute -H $AUTH_HEADER)
|
||||||
|
|
||||||
|
echo "==$test_file: $language-$lang_ver=="
|
||||||
|
#jq '.' <<<"$result"
|
||||||
|
jq -r '.compile.output + .run.output' <<<$result
|
||||||
|
done
|
|
@ -2,4 +2,6 @@
|
||||||
|
|
||||||
# Put instructions to compile source code, remove this file if the language does not require this stage
|
# Put instructions to compile source code, remove this file if the language does not require this stage
|
||||||
|
|
||||||
tsc "$@"
|
rename 's/$/\.ts/' "$@" # Add .ts extension
|
||||||
|
|
||||||
|
tsc *.ts
|
|
@ -5,4 +5,9 @@ export VMODULES="$PWD"
|
||||||
export TMPDIR="$PWD"
|
export TMPDIR="$PWD"
|
||||||
|
|
||||||
# Put instructions to run the runtime
|
# Put instructions to run the runtime
|
||||||
v run "$@"
|
|
||||||
|
rename 's/$/\.v/' "$@" # Add .v extension
|
||||||
|
|
||||||
|
filename=$1.v
|
||||||
|
shift
|
||||||
|
v run $filename "$@"
|
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# optimizing for small programs
|
# optimizing for small programs
|
||||||
zig build-exe -O ReleaseSmall --color off --cache-dir . --global-cache-dir . --name out "$@"
|
rename 's/$/\.zig/' "$@" # Add .zig extension
|
||||||
|
|
||||||
|
zig build-exe -O ReleaseSmall --color off --cache-dir . --global-cache-dir . --name out *.zig
|
||||||
|
|
Loading…
Reference in New Issue