首页 > 其他 > 详细

代码对拍器

时间:2019-03-26 20:17:48      阅读:202      评论:0      收藏:0      [点我收藏+]

 

bat文件

 

一个exe用于不断生成数据 (build)

另外两个exe输出结果并比较 (test1,test2)

一个文件夹存放结果(addr)

 

@echo off
setlocal enabledelayedexpansion

::here, code1 build data, code,cod2 test exe


set build=C:\Users\scientific\Desktop\code1\bin\Debug\code1.exe
set test1=C:\Users\scientific\Desktop\code\bin\Debug\code.exe
set test2=C:\Users\scientific\Desktop\code2\bin\Debug\code2.exe
set addr=C:\Users\scientific\Desktop\test

if not exist %addr% (
    md %addr%
)

for /l %%i in (1,1,1000) do (
    cd %addr%
    %build% >%%i.txt
    %test1% <%%i.txt >output1_%%i.txt
    %test2% <%%i.txt >output2_%%i.txt
    fc output1_%%i.txt output2_%%i.txt >nul && echo >nul  || echo not same %%i
    set /a j=%%i%%100
    if !j! equ 0 (
        echo %%i th
    )
)

pause

 

代码对拍器

原文:https://www.cnblogs.com/cmyg/p/10603038.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!