尝试googletest AKA gTest它并不比任何其他单元测试框架差,但也可以通过易用性击败一些.不完全是您正在寻找的集成测试工具,但在大多数情况下可以轻松应用.此维基百科页面可能也适合您.
以下是gTest项目页面上的示例副本:
#include <gtest/gtest.h>
namespace {
// The fixture for testing class Foo.
class FooTest : public ::testing::Test {
protected:
// You can remove any or all of the following functions if its body
// is empty.
FooTest() {
// You can do set-up work for each test here.
}
virtual ~FooTest() {
// You can do clean-up work that doesn't throw exceptions here.
}
// If the constructor and destructor are not enough for setting up
// and cleaning up each test, you can define the following methods:
virtual void SetUp() {
// Code here will be called immediately after the constructor (right
// before each test).
}
virtual void TearDown() {
// Code here will be called immediately after each test (right
// before the destructor).
}
// Objects declared here can be used by all tests in the test case for Foo.
};
// Tests that Foo does Xyz.
TEST_F(FooTest, DoesXyz) {
// Exercises the Xyz feature of Foo.
}
Run Code Online (Sandbox Code Playgroud)
Scons可以在你.cc改变时建立你的建立,gTest可以用来setUp和tearDown你的测试.
我只能补充一点,我们在某些情况下使用gTest,而在几乎所有其他情况下都使用自定义的内部测试自动化框架.通常情况下,使用此类工具可能更容易编写自己的工具,而不是尝试调整和调整其他工具以满足您的要求.
一个不错的选择,国际海事组织,这是我们的一些测试自动化框架朝着移动,使用nosetests,再加上常见的程序库(如启动/停止服务,得到什么地位,能够在某些部件/禁用记录等) .这为您提供了一个易于使用的灵活系统.而且由于它使用python而不是C++或类似的东西,更多的人可能忙于创建测试用例,包括QE,它们不一定需要能够编写C++.
| 归档时间: |
|
| 查看次数: |
2262 次 |
| 最近记录: |