luogu-dev / cyaron

CYaRon: Yet Another Random Olympic-iNformatics test data generator
GNU Lesser General Public License v3.0
1.35k stars 168 forks source link

对拍器的说明文档是不是有问题? #37

Closed fearlessxjdx closed 6 years ago

fearlessxjdx commented 6 years ago

我按照说明文档中提到的

while True:
    input_io = IO()
    input_io.input_writeln(randint(1,100))
    Compare.program("a.exe", "b.exe", input=input_io, std_program="std.exe") 
# 不断地生成测试数据(这里是1到100的随机数),然后放到a.exe,b.exe中,分别以std.exe为标准进行对拍比较
# CYaRon 现在使用多线程比较器,原 stop_on_incorrect 参数现已 deprecated 且无实际作用。
# 并在工作目录下输出a.exe.out, std.out, error_input.in三个文件方便您进一步调试。

进行了操作,但是并没有出现a.exe.out, std.out, error_input.in三个文件,只有一个异常

Traceback (most recent call last):
  File "F:\xjdx\test.py", line 9, in <module>
    Compare.program("a.exe", "b.exe", input=input_io, std_program="std.exe")
  File "D:\Program Files\Python36\lib\site-packages\cyaron\compare.py", line 143, in program
    [x for x in map(do, programs)]
  File "D:\Program Files\Python36\lib\site-packages\cyaron\compare.py", line 143, in <listcomp>
    [x for x in map(do, programs)]
  File "D:\Program Files\Python36\lib\site-packages\cyaron\compare.py", line 138, in do
    cls.__compare_two(program_name, content, std, grader)
  File "D:\Program Files\Python36\lib\site-packages\cyaron\compare.py", line 28, in __compare_two
    raise CompareMismatch(name, info)
cyaron.compare.CompareMismatch: ('a.exe', TextMismatch('123', '456', 'On line {} column {}, read {}, expected {}.', 1, 1, '123', '456'))
WAAutoMaton commented 6 years ago

像是cyraon有bug? 抛出了一个CompareMismatch之后就没有捕获了

fearlessxjdx commented 6 years ago

是啊,好奇怪 看了下Compare.py文件 好像也没有看到文档提到的写入文件操作.

lin-toto commented 6 years ago

Doc might be outdated

fearlessxjdx commented 6 years ago

@lin714093880 是否可以提供一个持续对拍,并将不同结果写入到其他文件的demo?

ghost commented 6 years ago

Sorry, maybe I am to blame for this. I will look into it. 😮

lin-toto commented 6 years ago

will fix

himself65 commented 6 years ago

these bugs have fixed on the latest version.

himself65 commented 6 years ago

@fearlessxjdx if you want to keep running process, you must code like this

...
try:
    input_io = IO()
    input_io.input_writeln(randint(1,100))
    Compare.program("a.exe", "b.exe", input=input_io, std_program="std.exe")
except:
    # ....
....