每日构造中,我的项目中 Visual Studio 的 MakeFile 后会产生大量信息,如下

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
========== Build: 0 succeeded, 0 failed, 23 up-to-date, 0 skipped ==========

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
========== Build: 0 succeeded, 1 failed, 7 up-to-date, 0 skipped ==========

现在假如我想确定有多少个子工程 proj 失败了,可以用词法分析器 Flex 来解决,以下是我的 check.l 文件内容

%option noyywrap nodefault
%{
int err_count = 0;
%}

%%
.*" 0 failed".* { }
.*"failed".* { err_count++; }
\n { }
. { }
%%

int main(int argc, char **argv)
{
if (argc > 1)
{
if ( !(yyin = fopen(argv[1], "r")))
{
perror(argv[1]);
return 1;
}
}
yylex();

if (err_count > 0)
printf("%d error found.\n", err_count);
else
printf("Successfully.\n");

return 0;
}

然后就运行flex.exe check.l 产生lex.yy.c文件,并用Visual Studio生成一个工程check

之后在命令行下运行check.exe log.txt便可以简单地知道每日构造成功与否。

最新文章

  1. Unity iOS混合开发界面切换思路
  2. ruby中excel简单操作以及文件读取操作方法
  3. Lock的用法,为什么要用?
  4. CDN技术发展趋势
  5. [LoadRunner]性能测试实践_Hessian协议脚本编写2
  6. Poj(2349),最小生成树的变形
  7. C#获取程序所在目录路径
  8. 001-python基础
  9. .net中用到的一些方法
  10. 超级密码(bfs)
  11. Linux下的变化的主机名步骤
  12. .net中的emit
  13. TCP与UDP的区别(转)
  14. Python数据分析学习(一):Numpy与纯Python计算向量加法速度比较
  15. consul搭建
  16. npm install --save
  17. Mybatis ResultMap Collection 复合主键
  18. Ubuntu 关闭防火墙
  19. TestNG中DataProvider的用法
  20. Shell或notepad连接虚拟机操作

热门文章

  1. robot framework 安装配置
  2. libcurl教程
  3. window go protobuf
  4. iOS开发XCODE5 SVN配置 使用办法 (转) 收藏一下
  5. 内存工具类:MemoryManager
  6. [整理]S-Record数据格式解析
  7. genymotion不能联网
  8. Android进程间的通信之Messenger
  9. JS验证字符长度
  10. NC 单据保存时间过长,判断数据库锁表解决办法