测试直接在 Travis CI
和 AppVeyor
上构建并运行,已在以下环境中做过测试:
Tests were built and run directly on Tracis CI
and AppVeyor
and had been tested in the following environments:
- linux, ubuntu 14.04, gcc5/6/7
- osx, xcode5/6/7/8
- windows, VS2015/VS2017, [x64|x86], [Release|Debug]
在 test.h 中,用了两个类实现了一个简单的测试框架,并定义了大量宏来封装测试过程。
In this file test.h, I used two class to implement a simple test framework, and defined a lot of macros to package testing process.
在 test.h 中定义了两个宏,PERFORMANCE_TEST_ON
和 LARGER_TEST_DATA_ON
。PERFORMANCE_TEST_ON
代表开启性能测试,默认定义为 1
。LARGER_TEST_DATA_ON
代表增大测试数据,默认定义为 0
。如果你想把 LARGER_TEST_DATA_ON
设置为 1
,建议电脑配置为:处理器 i5 或以上,内存 8G 以上。
In this file test.h, I defined two marcos: PERFORMANCE_TEST_ON
and LARGER_TEST_DATA_ON
. PERFORMANCE_TEST_ON
means to run performance test, the default is defined as 1
. LARGER_TEST_DATA_ON
means to increase the test data, the default is defined as 0
. If you want to set LARGER_TEST_DATA_ON
to 1
, the proposed computer configuration is: CPU i5 or above, memory 8G or more.
测试案例如下:
The test cases are as follows:
- algorithm (100%/100%)
- algorithm_performance (100%/100%)
- deque (100%/100%)
- list (100%/100%)
- map (100%/100%)
- map
- multimap
- queue (100%/100%)
- queue
- priority_queue
- set (100%/100%)
- set
- multiset
- stack (100%/100%)
- string_test (100%/100%)
- unordered_map (100%/100%)
- unordered_map
- unordered_multimap
- unordered_set (100%/100%)
- unordered_set
- unordered_multiset
- vector (100%/100%)