????????????google test
???????????? ???????[ 2013/10/11 16:36:33 ] ????????
???????????
????gtest??Google?????????????C++???????????????????????????????????????????death???????????????????????????????????????????в????????XML???????棬?????????ο????????????ο?????
???????????
???????????????gtest??????μ?????汾??gtest-1.7.0???????????gtest??
????#unzip gtest-1.7.0.zip
????#cd gtest-1.7.0
????#./configure
????#make
???????lib/.libs??????????libgtest.a??libgtest_main.a??????????????????????????
????????????
???????潫?????????????gtest????????????
????1???????????
??????д???????????foo.h?б?д????max???????????е??????
#ifndef __FOO_H__
#define __FOO_H__
int max(int a?? int b)
{
return a>b?a:b;
}
#endif
????2?????????
??????д???????test_foo.cpp????foo.h???в????
#include "gtest/gtest.h"
#include "foo.h"
TEST(foo?? max)
{
EXPECT_EQ(2?? max(2?? 1));
EXPECT_EQ(3?? max(2?? 3));
}
int main(int argc?? char **argv)
{
::testing::InitGoogleTest(&argc?? argv);
return RUN_ALL_TESTS();
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11