[sheepdog] [PATCH 0/3] Introducing unittest framework to sheepdog
Liu Yuan
namei.unix at gmail.com
Mon Jun 3 13:49:23 CEST 2013
On 06/03/2013 07:32 PM, Kai Zhang wrote:
> As we all known, unittest is quite important to any project which is aimed to be used in production environment.
>
> This series of patches is to introduce 'check', a popular unittest framework for C language.
>
> These patches are quite initial implemented.
> But it still shows the abilities of:
> - adding more unittests easily
> - runing unittests selectively
> - showing code coverage after running unittest
> - generating html report by lcov and genhtml
> - integrating with other CI (continuous integration) systems like Jenkins
>
> In addition, we can also benifit from unittest in the following ways:
> - help us write more testable code
> - improve the robustness of sheepdog
> - new contributors can be quickly involved by writing unittest code
>
Thanks for this framework. Besides above information, it would be nice
if you shed more lights on the different between this framework and our
current 'tests/' framework.
are these two framework completely complementary? Or they are somewhat
overlapped in some areas? If I want to add a test, what I should
consider to choose one over another?
> Usage:
> - $make check # run all unittests
> - $make check CK_RUN_SUITE=xxx_suite CK_RUN_CASE=xxx_case # run selective unittest
> - $make coverage # generate coverage report in html to directory 'coverage'
>
> There are also many things that we can improve:
> - more tests of cause
> - more functional mock programs (inspired by gmock)
>
> Another thing that I wanna share with you is that, current unittests in implemented under 'check', a C unittest framework.
> There is another test framework, google testing framework (including gtest and gmock), which is more popular and powerful.
> However, they are written in C++.
> I have tried to use gtest and gmock to write unittests in C++, but failed to compile with our code.
> We need to refine our code to be compatible with C++ compiler if we wanna adopt gtest and gmock.
I don't think we need follow the fashion, if 'check' serves sheepdog
well, just use it. Adjusting code just for a C++ test system looks weird
to me. Unless there is big win for gtest over check, I'd rather use check.
Thanks,
Yuan
More information about the sheepdog
mailing list