Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spj支持testlib么 #44

Open
tabbbbbb opened this issue May 17, 2022 · 3 comments
Open

spj支持testlib么 #44

tabbbbbb opened this issue May 17, 2022 · 3 comments

Comments

@tabbbbbb
Copy link

spj支持testlib么,要如何用,求教程

@equation314
Copy link
Contributor

equation314 commented May 19, 2022

校验器可以是任意可执行程序,只需满足以下协议:

  1. 传入标准输入、标准输出、选手输出、结果输出文件名作为参数:

    ./spj <IN> <ANS> <OUT> <LOG>
    
  2. 程序返回值为 0 表示校验器检查成功,非 0 表示校验器崩溃。

  3. 结果输出文件需满足以下格式:

    1. 第一行一个 [0, 1] 的实数,表示得分比例。
    2. 第二行一个字符串,表示要显示在评测界面上的的信息。

可以参考全文比较的实现:https://github.com/sxyzccr/CCR-Plus/blob/master/src/tools/checker/fulltext_utf8.cpp

如要使用 testlib,保证生成的可执行程序满足该协议即可。

@tabbbbbb
Copy link
Author

in、ans、out、log的顺序可以换么,testlib.h的是in、out、ans。
结束ccr用的是End(string, state),testlib.h用的是类似quitf(_ok, "1")
如果我要把用testlib.h写的check改为支持ccr的check要如何改

@equation314
Copy link
Contributor

需要改 testlib.h,比如改这里调整参数顺序:

https://github.com/MikeMirzayanov/testlib/blob/6daa79fdc9c2b113be8d40f828e3dc81e67ce33d/testlib.h#L4268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants