]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/librados: create general test case classes
authorJosh Durgin <josh.durgin@inktank.com>
Mon, 3 Feb 2014 17:01:20 +0000 (09:01 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 18 Feb 2014 20:34:32 +0000 (12:34 -0800)
commit9630f2f02d5e60ba7c5c3102702248ce19fdddb9
treec8e9714d4d3a29e7960ca7c50debfb427fc008f0
parent6273ba4a9fcd7ccebef2ec0164f6d23af80166e5
test/librados: create general test case classes

Using a test case allows us to remove a boatload of boilerplate code
in all the tests, and focus them more on what they're actually
testing.

Create one for C tests, and one for C++ tests, with the same
functionality:

- create a pool when the test case starts
- between individual tests, create an ioctx and set its namespace uniquely
- delete objects from the default namespace during individual test teardown
- delete the pool only when the whole test case is finished

In gtest, a test case is the whole set of tests declared as part of
the same class using TEST_F(). Many tests create and delete individual
pools, but this is unnecessary for independent operation in most
cases, since we can use namespaces for that now. Since pool creation
and deletion dominates test run time, using these test cases makes
running many of the tests much faster.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/test/Makefile.am
src/test/librados/TestCase.cc [new file with mode: 0644]
src/test/librados/TestCase.h [new file with mode: 0644]