Блог пользователя minimario

Автор minimario, история, 9 лет назад, По-английски

Hi,

Is there any program that can test a program on a large set of .in files against a large set of .out files? I heard about Ineffable, but I also heard it's really buggy.

Thanks!

  • Проголосовать: нравится
  • +32
  • Проголосовать: не нравится

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +86 Проголосовать: не нравится

If you use Linux, here is the command you are looking for:

for i in *.in; do j=${i%.*}; ./cpp < $j.in > my$j.out; echo ---$j---; diff -w my$j.out $j.out; done;

What it does is loop over all files having extension .in (this is the value of i), then j becomes the filename without the extension and after that it just runs your code with j.in, saves your output in myj.out and compares it to the correct output j.out.

Here is what it should look like if among 10 cases, the 7th one fails: