Skip to content

Commit 82d6c8f

Browse files
add input+output support for runs
Signed-off-by: Arnav Gupta <arnav@codingblocks.com>
1 parent be4b901 commit 82d6c8f

File tree

27 files changed

+46
-15
lines changed

27 files changed

+46
-15
lines changed

containers/c/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

33
chmod 777 exe
4-
./exe 1> run.stdout 2> run.stderr
4+
./exe < run.stdin 1> run.stdout 2> run.stderr

containers/cpp/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

33
chmod 777 exe
4-
./exe 1> run.stdout 2> run.stderr
4+
./exe < run.stdin 1> run.stdout 2> run.stderr

containers/java8/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ FROM alpine:3.6
22

33
RUN apk add --no-cache openjdk8 bash
44
ENV PATH="/usr/lib/jvm/java-1.8-openjdk/bin:${PATH}"
5+
56
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

containers/java8/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
java Main < run.stdin 1> run.stdout 2> run.stderr

tests/c/run.stdin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
World

tests/c/runbox/exe

72 Bytes
Binary file not shown.

tests/c/runbox/run.stdin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
World

tests/c/runbox/source.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <stdio.h>
22

33
int main () {
4-
printf("Hello World");
4+
char in[10];
5+
scanf("%s", in);
6+
printf("Hello %s", in);
57
return 0;
68
}

tests/c/source.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <stdio.h>
22

33
int main () {
4-
printf("Hello World");
4+
char in[10];
5+
scanf("%s", in);
6+
printf("Hello %s", in);
57
return 0;
68
}

tests/c/test_worker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mkdir -p $RUNBOX
99

1010
# Copy source to runbox
1111
cp $DIR/source.c $RUNBOX/source.c
12+
cp $DIR/run.stdin $RUNBOX/run.stdin
1213

1314
# Test Compile
1415
docker run \

0 commit comments

Comments
 (0)