feat: longer sampe

manuel 2024-10-17 18:37:21 +08:00
parent 66e3a40d62
commit c21b5b3152

@ -93,6 +93,8 @@ Global options:
- `release.deadline [offset date-time]`: RFC 3339 formatted date-time with offset - `release.deadline [offset date-time]`: RFC 3339 formatted date-time with offset
- `limit.cpu [int]`: default maximum running time used for all stages in sec (default: `4`) - `limit.cpu [int]`: default maximum running time used for all stages in sec (default: `4`)
- `limit.mem [int]`: default maximum amount of RAM allowed for all stages in MB (default: `4`) - `limit.mem [int]`: default maximum amount of RAM allowed for all stages in MB (default: `4`)
- `limit.stdout [int]`: default `stdout` size applicable to all stages in kB (default: `4`)
- `limit.stderr [int]`: default `stderr` size applicable to all stages in kB (default: `4`)
Each stage is configured in a table. All parameters following a table definition belong to it until Each stage is configured in a table. All parameters following a table definition belong to it until
the next table is defined. the next table is defined.
@ -102,9 +104,12 @@ the next table is defined.
driver and header files needed for compilation) driver and header files needed for compilation)
- `files.export [array of string]`: list of generated files to export to ensure future commands run as expected (eg. - `files.export [array of string]`: list of generated files to export to ensure future commands run as expected (eg.
binaries needed for online-judge stages) binaries needed for online-judge stages)
- `name [string]`: stage name to display (default: `stagename`)
- `parsers [array of string]`: list of parsers to run on the output of `command` - `parsers [array of string]`: list of parsers to run on the output of `command`
- `limit.cpu [int]`: maximum running time for the stage in sec (default: `4`) - `limit.cpu [int]`: maximum running time for the stage in sec (default: `4`)
- `limit.mem [int]`: maximum amount of RAM allowed for stage of step in MB (default: `4`) - `limit.mem [int]`: maximum amount of RAM allowed for the stage in MB (default: `4`)
- `limit.stdout [int]`: default `stdout` size applicable to the stage in kB (default: `4`)
- `limit.stderr [int]`: default `stderr` size applicable to the stage in kB (default: `4`)
Any online-judge stage *must* feature the keyword `judge`, eg. `judge`, `judge-base`, `asan-judge` are all valid online-judge Any online-judge stage *must* feature the keyword `judge`, eg. `judge`, `judge-base`, `asan-judge` are all valid online-judge
@ -114,8 +119,6 @@ An online-judge stage is configure as any other stage, ie. using the above optio
extra parameter: extra parameter:
- `skip [array of string]`: list of test cases to skip for this stage (default: `[ ]`) - `skip [array of string]`: list of test cases to skip for this stage (default: `[ ]`)
By default all available test-cases are tested, unless some are marked as `skip`.
### Parsers ### Parsers
@ -234,7 +237,7 @@ score = 100
parsers = ["diff", "result-detail"] parsers = ["diff", "result-detail"]
result-detail.time = false result-detail.time = false
result-detail.mem = false result-detail.mem = false
result-detail.error = true result-detail.stderr = true
``` ```
</details> </details>
@ -252,58 +255,95 @@ release.deadline = 2024-10-12 23:59:00+08:00
release.stages = [ "compile" ] release.stages = [ "compile" ]
[compile] [compile]
name = "Compilation"
command = "make.sh" # eg. script running cmake commands command = "make.sh" # eg. script running cmake commands
files.import = [ "src/main.c", "src/task.h", "srcCMakelist.txt" ] # files.import = [ "tools/make.sh", "src/main.c", "src/task.h", "srcCMakelist.txt" ]
files.export = [ "p1", "p1-msan" ] files.export = [ "driver", "p2", "p2-msan" ]
# limit.cpu = 300 # allow 300s for complex/long compilation limit.cpu = 180 # p2 takes long to compile
limit.stderr = 128
# parsers # compile parsers
parsers = [ "result-detail", "result-status" ]
result-status.comment = "Congratulations! Your code compiled successfully." result-status.comment = "Congratulations! Your code compiled successfully."
dummy.comment = "\n\n### Details\n" dummy.comment = "\n\n### Details\n"
result-details.status = true result-detail.exitstatus = true
result-details.stderr = true result-detail.stderr = true
result-detail.time = false
result-detail.mem = false
[filelength] [filelength]
name = "File length check" name = "File length check"
command = "file-length" # command to run command = "./file-length 500 400 *.c *.h" # command to run
tests = [ "max", "recommend"] # keywords caught by corresponding JOJ plugin files.import = [ "tools/file-length" ]
weights = [ 50, 20 ] # weight of each keyword
parsers parsers = [ "keyword", "dummy", "result-detail" ]
keyword.keyword = [ "max", "recommend"] # keywords caught by corresponding JOJ plugin
keyword.weight = [ 50, 20 ] # weight of each keyword
result-detail.exitstatus = true
result-detail.stderr = true
result-detail.time = false
result-detail.mem = false
[clangtidy] [clangtidy]
name = "Clang-tidy checks"
command = "run-clang-tidy-18 -header-filter=.* -quiet -load=/usr/local/lib/libcodequality.so -p build" command = "run-clang-tidy-18 -header-filter=.* -quiet -load=/usr/local/lib/libcodequality.so -p build"
tests = [ "codequality-no-global-variables", "codequality-no-header-guard", "readability-function-size", "readability-duplicate-include", "readability-identifier-naming", "readability-redundant", "readability-misleading-indentation", "readability-misplaced-array-index", "cppcoreguidelines-init-variables", "bugprone-suspicious-string-compare", "google-global-names-in-headers", "clang-diagnostic", "clang-analyzer", "misc performance" ] limit.stdout = 65
weights = [100, 100, 50, 10, 5, 5, 10, 5, 5, 8, 5, 5, 5, 5, 8]
parsers = [ "clangtidy", "dummy", "result-detail" ]
clangtiy.keyword = [ "codequality-no-global-variables", "codequality-no-header-guard", "readability-function-size", "readability-duplicate-include", "readability-identifier-naming", "readability-redundant", "readability-misleading-indentation", "readability-misplaced-array-index", "cppcoreguidelines-init-variables", "bugprone-suspicious-string-compare", "google-global-names-in-headers", "clang-diagnostic", "clang-analyzer", "misc performance" ]
clangtidy.weight = [10, 10, 50, 10, 5, 5, 10, 5, 5, 8, 5, 5, 5, 5, 8]
dummy.comment = "\n\n### Details\n"
result-detail.exitstatus = true
result-detail.stdout = true
result-detail.time = false
result-detail.mem = false
[cppcheck] [cppcheck]
name = "Cppcheck check"
command = "cppcheck --template='{\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}' --force --enable=all --quiet ./" command = "cppcheck --template='{\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}' --force --enable=all --quiet ./"
tests = ["error", "warning", "portability", "performance", "style"] limit.stderr = 65
weights = [20, 10, 15, 15, 10]
parsers = [ "cppcheck", "dummy", "result-detail" ]
cppcheck.keyword = ["error", "warning", "portability", "performance", "style"]
cppcheck.weight = [20, 10, 15, 15, 10]
dummy.comment = "\n\n### Details\n"
result-detail.exitstatus = true
result-detail.stderr = true
result-detail.time = false
result-detail.mem = false
[cpplint] [cpplint]
name = "Cpplint check"
command = "cpplint --linelength=120 --filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-readability/todo,-build/include_subdir,-build/header_guard --recursive --exclude=build ." command = "cpplint --linelength=120 --filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-readability/todo,-build/include_subdir,-build/header_guard --recursive --exclude=build ."
tests = [ "runtime", "readability", "build" ] limit.stdout = 65
weights = [ 10, 20, 15]
parsers = [ "cpplint", "dummy", "result-detail" ]
cpplint.keyword = [ "runtime", "readability", "build" ]
cpplint.weight = [ 10, 20, 15]
dummy.comment = "\n\n### Details\n"
result-detail.exitstatus = true
result-detail.stdout = true
result-detail.time = false
result-detail.mem = false
[judge-base] [judge-base]
command="./driver ./mumsh" command="./driver ./mumsh"
limit.cpu = 10 # default cpu limit (in sec) for each test case limit.cpu = 3
limit.mem = 50 # set default mem limit (in MB) for all OJ test cases limit.mem = 75
score = 10 # default OJ score for each test case score = 10
parsers = ["diff", "stderr"]
size.diff = 4 parsers = ["diff", "dummy", "result-detail"]
size.stderr = 4 dummy.comment = "\n\n### Details\n"
diff.ignorespaces = true result-detail.exitstatus = true
result-detail.stderr = true
case4.score = 15 case4.score = 15
case4.limit.cpu = 30 case4.limit.cpu = 30
case4.limit.mem = 10 case4.limit.mem = 10
case4.limit.stdout = 8
case5.score = 25 case5.score = 25
case6.score = 25
case6.size.diff = 64
case8.size.stderr = 128 case8.size.stderr = 128
[judge-msan] [judge-msan]
@ -311,18 +351,18 @@ command="./driver ./mumsh-msan"
limit.cpu = 10 # default cpu limit (in sec) for each test case limit.cpu = 10 # default cpu limit (in sec) for each test case
limit.mem = 500 # set default mem limit (in MB) for all OJ test cases limit.mem = 500 # set default mem limit (in MB) for all OJ test cases
score = 10 score = 10
parsers = ["diff"]
skip = ["case0", "case11"] skip = ["case0", "case11"]
diff.ignorespaces = false
parsers = ["diff", "dummy", "result-detail"]
dummy.comment = "\n\n### Details\n"
result-detail.exitstatus = true
result-detail.stderr = true
case4.score = 15 case4.score = 15
case4.limit.cpu = 30 case4.limit.cpu = 30
case4.limit.mem = 10 case4.limit.mem = 10
case5.score = 25 case5.diff.ignorespaces = false
case6.score = 25
case6.size.stderr = 32
``` ```