use googletest on windows ce
来源:互联网 发布:安卓运行php 编辑:程序博客网 时间:2024/04/24 13:27
use googletest on windows ce
分类: wince unit testing2010-05-10 21:48 74人阅读 评论(0) 收藏 举报
windowsgoogletestpreprocessorapplicationtestingoutput
I've been trying to use googletest on windows ce platform to do unit testing. But gtest doesn't provide a windows ce project file, so I had to modify the project myself. Here is how to do so:
1. Add a new platform
I added a new windows ce based platform (Windows Mobile 5.0 Pocket PC SDK (ARMV4I), for example) in the configuration manager of the gtest project.
2. Add below preprocessor definitions
In order to compile gtest library for windows ce, I used below preprocessor definitions:
"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
Not all of them are mandatory, but missing the bold ones may cause gtest fail to compile.
3. Create a windows ce console project
The sample project is available at:
http://code.google.com/p/rxwen-blog-stuff/source/browse/#svn/trunk/wince/ce_gtest_proj
This project expects to find gtest header file (gtest/gtest.h) and static library (gtestd.lib) in googletest folder in parent directory.
4. Run the application on emulator/device and verify output
Finally, I run the unit testing application on a windows ce device, and get below outputs in visual studio and serial port output respectively. The output shows that the test case passed successfully.
It's not always necessary to run unit testing application on windows ce device. If we write our application with care, it's possible that the application can compile and run on both win32 and windows ce platform. Then we can do unit testing on a normal pc, which will be easier and faster.
But I still would like to run the unit testing on windows ce if our product is supposed to run on it. Any subtle differences between win32 and win ce may cause the unit testing succeed on one platform but fail on the other. It's wise to do unit testing on the platform that the application will actually run.
1. Add a new platform
I added a new windows ce based platform (Windows Mobile 5.0 Pocket PC SDK (ARMV4I), for example) in the configuration manager of the gtest project.
2. Add below preprocessor definitions
In order to compile gtest library for windows ce, I used below preprocessor definitions:
"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
Not all of them are mandatory, but missing the bold ones may cause gtest fail to compile.
3. Create a windows ce console project
The sample project is available at:
http://code.google.com/p/rxwen-blog-stuff/source/browse/#svn/trunk/wince/ce_gtest_proj
This project expects to find gtest header file (gtest/gtest.h) and static library (gtestd.lib) in googletest folder in parent directory.
4. Run the application on emulator/device and verify output
Finally, I run the unit testing application on a windows ce device, and get below outputs in visual studio and serial port output respectively. The output shows that the test case passed successfully.
visual studio output window
device serial port output
It's not always necessary to run unit testing application on windows ce device. If we write our application with care, it's possible that the application can compile and run on both win32 and windows ce platform. Then we can do unit testing on a normal pc, which will be easier and faster.
But I still would like to run the unit testing on windows ce if our product is supposed to run on it. Any subtle differences between win32 and win ce may cause the unit testing succeed on one platform but fail on the other. It's wise to do unit testing on the platform that the application will actually run.
- use googletest on windows ce
- use googletest on windows ce
- Windows CE 6 On Mini2440
- perform profiling on windows ce
- mysql++ use Unicode on Windows
- [NFC] Use Libnfc On Windows
- TextOut is not supported on CE , use DrawText or ExtTextOut
- Windows CE 5.0 Device Emulator on Windows2003
- capture network traffic on windows ce
- Enabling ClearType on Windows CE 6.0
- use cscope with gvim on windows
- how to use python virtualenv on windows
- Resolving Symbols Manually on Windows CE (ADDRESS --> SYMBOL)
- Windows CE 6.0 post-build on WIN7 64 bits machine
- windows环境下学习googletest记录
- Windows CE
- Windows CE
- windows CE
- 【NFC】Android NFC API Reference中英文
- rsync 安装配置,服务器到客户端间同步文件
- 交叉编译
- 在线html网页编辑器ckeditor的使用与配置
- java 正则表达式 指数
- use googletest on windows ce
- PrimeFaces布局技巧
- Makefile中的常用函数
- POJ-1731-Orders
- GDB 调试程序
- Eclipse 断点的一个情况 TODO Auto-generated catch block
- explain 参数含义
- VRRP协议介绍
- 投入自动化测试首要考虑的5个因素