[MacrayKV] An innovative parallel testing framework
来源:互联网 发布:windows 开机启动 编辑:程序博客网 时间:2024/05/18 14:46
We use tbsys multi-thread API for parallel testing In OceanBase. No so bad news is that tbsys has encapsulated an easy API for end user. The real bad news is that every tester should learn how to use the API and facing misuse risk.
What about writing parallel testing code like this:
TEST_F(ObTCFactoryTest, mt_basic_test){ // 第一次并发测试 BEGIN_THREAD_CODE(my_run, 50) { for (int i = 0; i < 1000000; ++i) { Base *b1 = base_tc_factory_t::get_instance()->get(0); ASSERT_TRUE(NULL != b1); } base_tc_factory_t::get_instance()->stat(); } END_THREAD_CODE(my_run); // 一些同步测试代码 // put your code here // 第二次并发测试 BEGIN_THREAD_CODE(my_run2, 50) { for (int i = 0; i < 1000000; ++i) { Base *b1 = base_tc_factory_t::get_instance()->get(0); ASSERT_TRUE(NULL != b1); } base_tc_factory_t::get_instance()->stat(); } END_THREAD_CODE(my_run2);}
With the help of my parallel testing framework, now you can!
#define BEGIN_THREAD_CODE(class_name, thread_count) \ class _##class_name : public tbsys::CDefaultRunnable \ { \ public: \ _##class_name() { _threadCount = thread_count; } \ void run(tbsys::CThread *thread, void *arg) { \ UNUSED(thread); UNUSED(arg); \#define END_THREAD_CODE(class_name) \ }};\ _##class_name my_##class_name; \ my_##class_name.start(); my_##class_name.wait();
Simple enough!
Notes: tbsys is required.
- [MacrayKV] An innovative parallel testing framework
- Steve Jobs-An innovative man
- why we need an innovative education system?
- How to elicit requirements for an innovative product?
- Windows Device Testing Framework
- Presentation Layer Testing Framework
- WAF Testing Framework
- Unit testing framework
- software testing framework
- Google C++ Testing Framework Primer
- Data Services Stress Testing Framework
- Google C++ Testing Framework简介
- Google C++ Testing Framework 简介
- Google C++ Testing Framework AdvancedGuide
- python Unit testing framework文档
- Google C++ Testing Framework Primer
- Parallel Symbolic Execution for Automated Real-World Software Testing
- Innovative Cooperation
- USACO Chapter1-Getting started Section 1.3
- 12,Objective-C语法之KVC的使用
- GoAgent设置RC4加密
- 写文件换行
- sublime配置全攻略
- [MacrayKV] An innovative parallel testing framework
- 13,Objective-C语法之KVO的使用
- 14,Objective-C语法之代码块(block)的使用
- LeetCode题解:N-Queens I and II
- 15,Objective-C语法之Category的使用
- Oracle 11Gr1监听报错TNS-12542 12560 00512
- Android 支持不同屏幕的方法
- SGU 105 Div 3 找规律
- 为Eclipse安装安卓开发插件ADT