Total Articles 494
[installation]
github에서 clone하지 않고도 다음과 같은 명령어로 google test를 설치할 수 있다.
sudo apt install libgtest-dev
[sample code]
간단한 샘플 코드를 만든다.
#include <gtest/gtest.h>TEST(myTest, myTest1) {EXPECT_TRUE(1 == 1);EXPECT_TRUE(1 != 2);EXPECT_TRUE(1 != 3);}
[link option]
다음과 같은 링크 옵션을 주어 링크 에러를 없애도록 한다.
LIBS += -lgtest_main -lgtest -pthread
[output]
Running main() from gtest_main.cc[==========] Running 1 test from 1 test case.[----------] Global test environment set-up.[----------] 1 test from myTest[ RUN ] myTest.myTest1[ OK ] myTest.myTest1 (0 ms)[----------] 1 test from myTest (0 ms total)[----------] Global test environment tear-down[==========] 1 test from 1 test case ran. (0 ms total)[ PASSED ] 1 test.
[github]
google test는 원래 code.google.com에서 관리되었으나 지금은 github.com에서 관리되어 지고 있다.
https://github.com/google/googletest
[samples]
다양한 샘플을 통하여 google test 사용 방법을 익히도록 한다.
https://github.com/google/googletest/blob/master/googletest/docs/Samples.md
[download]