Compare commits

...

No commits in common. "master" and "diff/basic" have entirely different histories.

15 changed files with 198 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
joj3_result.json

View File

@ -1,3 +0,0 @@
# JOJ3 examples
Check other branches.

6
a.cc Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main() {
int a, b;
std::cin >> a >> b;
std::cout << a + b << '\n';
}

1
cases/1.in Normal file
View File

@ -0,0 +1 @@
1 1

1
cases/1.out Normal file
View File

@ -0,0 +1 @@
2

1
cases/2.in Normal file
View File

@ -0,0 +1 @@
1024 2048

7
cases/2.out Normal file
View File

@ -0,0 +1,7 @@
3072
234890234
342342
1234234
300072
43234
1243

1
cases/3.in Normal file
View File

@ -0,0 +1 @@
1024 2048

1
cases/3.out Normal file
View File

@ -0,0 +1 @@
3072

1
cases/4.in Normal file
View File

@ -0,0 +1 @@
1024 2048

1
cases/4.out Normal file
View File

@ -0,0 +1 @@
3072

1
cases/5.in Normal file
View File

@ -0,0 +1 @@
1024 2048

1
cases/5.out Normal file
View File

@ -0,0 +1 @@
37200

174
conf.json Normal file
View File

@ -0,0 +1,174 @@
{
"stage": {
"stages": [
{
"name": "compile",
"executor": {
"name": "sandbox",
"with": {
"default": {
"args": [
"clang++",
"a.cc",
"-o",
"a"
],
"env": [
"PATH=/usr/bin:/bin"
],
"cpuLimit": 10000000000,
"memoryLimit": 209715200,
"procLimit": 50,
"copyInDir": ".",
"copyOut": [
"stdout",
"stderr"
],
"copyOutCached": [
"a"
],
"stdin": {
"content": ""
},
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
}
}
}
},
"parsers": [
{
"name": "result-status",
"with": {
"score": 0,
"comment": "compile done"
}
}
]
},
{
"name": "run",
"executor": {
"name": "sandbox",
"with": {
"default": {
"args": [
"./a"
],
"env": [
"PATH=/usr/bin:/bin"
],
"cpuLimit": 1000000000,
"memoryLimit": 104857600,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
],
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
},
"copyInCached": {
"a": "a"
}
},
"cases": [
{
"stdin": {
"src": "./cases/1.in"
}
},
{
"stdin": {
"src": "./cases/2.in"
}
},
{
"stdin": {
"src": "./cases/3.in"
}
},
{
"stdin": {
"src": "./cases/4.in"
}
},
{
"stdin": {
"src": "./cases/5.in"
}
}
]
}
},
"parsers": [
{
"name": "diff",
"with": {
"cases": [
{
"outputs": [
{
"score": 100,
"fileName": "stdout",
"answerPath": "./cases/1.out",
"compareSpace": true
}
]
},
{
"outputs": [
{
"score": 100,
"fileName": "stdout",
"answerPath": "./cases/2.out",
"compareSpace": true
}
]
},
{
"outputs": [
{
"score": 100,
"fileName": "stdout",
"answerPath": "./cases/3.out"
}
]
},
{
"outputs": [
{
"score": 100,
"fileName": "stdout",
"answerPath": "./cases/4.out"
}
]
},
{
"outputs": [
{
"score": 100,
"fileName": "stdout",
"answerPath": "./cases/5.out",
"compareSpace": false
}
]
}
]
}
}
]
}
]
}
}

1
expected.json Normal file
View File

@ -0,0 +1 @@
[{"name":"compile","results":[{"score":0,"comment":"compile done"}],"force_quit":false},{"name":"run","results":[{"score":100,"comment":"🥳Passed!\n"},{"score":0,"comment":"🧐Failed...\nDifference found in `stdout`\n```diff\n 3072\n- 234890234\n- 342342\n- 1234234\n- 300072\n- 43234\n- 1243\n```\n"},{"score":100,"comment":"🥳Passed!\n"},{"score":100,"comment":"🥳Passed!\n"},{"score":0,"comment":"🧐Failed...\nDifference found in `stdout`\n```diff\n- 37200\n+ 3072\n```\n"}],"force_quit":false}]