- aclocal
aclocal.m4 が生成される。
- libtoolize
- automake
Makefile.in が生成される。
- autoconf
configure が生成される。 - ./configure
Makefile が生成される。 - make
テスト
- Makefile 作るまで一緒
- make check-TESTS
namespace testing { template<typename T> struct AssertionReturn { T value; AssertionReturn() {} AssertionReturn(const T& v) : value(v) {} }; namespace internal { template<typename T>struct AssertionFixed; class AssertionMessage : public Message { public: template<typename T> AssertionMessage& operator << (T value) { Message::operator << (value); return *this; } template<typename R> AssertionFixed<R> operator << (const AssertionReturn<R>& r) { return AssertionFixed<R>(*this, r); } }; template<typename T> struct AssertionFixed { AssertionMessage message; AssertionReturn<T> ret; AssertionFixed(const AssertionMessage& msg, const AssertionReturn<T>& r) : message(msg), ret(r) {} }; } // namespace internal } // namespace testing
class AssertHelperEx : public AssertHelper { public: // Constructor. AssertHelperEx(TestPartResult::Type type, const char* file, int line, const char* message) : AssertHelper(type, file, line, message) {} void operator=(const Message& message) const { AssertHelper::operator = (message); } template<typename R> R operator=(const AssertionFixed<R>& fixed) const { AssertHelper::operator = (fixed.message); return fixed.ret.value; } private: GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperEx); };
#define GTEST_MESSAGE_AT_(file, line, message, result_type) \ ::testing::internal::AssertHelperEx(result_type, file, line, message) \ = ::testing::internal::AssertionMessage()
return ::testing::internal::AssertHelper(result_type, file, line, message) = ::testing::Message()
return ::testing::internal::AssertHelper(result_type, file, line, message) = ::testing::AssertionReturn<int>(1)
int ReturnTest(void) { IUTEST_ASSERT_TRUE(false) << ::iutest::AssertionReturn<int>(-1); return 0; }
void f(int x, int y) { // ... なにか処理 if( x == kBEGIN_X ) { // ... なにか処理 } }
IUTEST_INSTANTIATE_TEST_CASE_P(int, A, TestP, iuRange, 0, 2 ); IUTEST_P(int, TestP, Test) { const int x = param; // パラメータは param 引数として渡されます const int kMax = 10; IUTEST_ASSERT_LT(x, kMax); }