Skip to content

Commit 434af06

Browse files
node8
Signed-off-by: Arnav Gupta <arnav@codingblocks.com>
1 parent e2a377f commit 434af06

File tree

7 files changed

+55
-0
lines changed

7 files changed

+55
-0
lines changed

tests/nodejs8/run.stdin

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

tests/nodejs8/runbox/run.stderr

Whitespace-only changes.

tests/nodejs8/runbox/run.stdin

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

tests/nodejs8/runbox/run.stdout

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

tests/nodejs8/runbox/script.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var readline = require('readline');
2+
3+
var rl = readline.createInterface({
4+
input: process.stdin,
5+
output: process.stdout,
6+
terminal: false
7+
});
8+
9+
rl.on('line', function (line) {
10+
console.log("Hello " + line);
11+
});

tests/nodejs8/script.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var readline = require('readline');
2+
3+
var rl = readline.createInterface({
4+
input: process.stdin,
5+
output: process.stdout,
6+
terminal: false
7+
});
8+
9+
rl.on('line', function (line) {
10+
console.log("Hello " + line);
11+
});

tests/nodejs8/test_worker.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
pushd $(dirname "$0")
3+
DIR=$(pwd)
4+
RUNBOX="${DIR}/runbox"
5+
6+
echo $RUNBOX
7+
# Remove RUNBOX
8+
rm -rf $RUNBOX
9+
10+
# Create runbox
11+
mkdir -p $RUNBOX
12+
13+
# Copy source to runbox
14+
cp $DIR/script.js $RUNBOX/script.js
15+
cp $DIR/run.stdin $RUNBOX/run.stdin
16+
17+
# Test Compile
18+
docker run \
19+
--cpus="0.5" \
20+
--memory="20m" \
21+
--ulimit nofile=64:64 \
22+
--rm \
23+
--read-only \
24+
-v "$RUNBOX":/usr/src/runbox \
25+
-w /usr/src/runbox codingblocks/judge-worker-nodejs8 \
26+
bash -c "/bin/compile.sh && /bin/run.sh"
27+
28+
29+
# Delete runbox
30+
#rm -rf $RUNBOX

0 commit comments

Comments
 (0)