Giter VIP home page Giter VIP logo

soft-testing-practice's Introduction

Google test 安装:

环境:ubuntu 14.04

编译器:g++

  1. Get the googletest framework

    $ wget https://github.com/google/googletest/archive/release-1.7.0.zip

  2. Unzip and build google test

    $ unzip gtest-1.7.0.zip $ cd gtest-1.7.0 $ ./configure $ make

  3. "Install" the headers and libs on my system.

    $ sudo cp -a include/gtest /usr/include $ sudo cp -a lib/.libs/* /usr/lib/

  4. Update the cache of the linker

    sudo ldconfig -v | grep gtest

简单使用

test.cpp 文件:

#include <gtest/gtest.h>
TEST(MathTest, TwoPlusTwoEqualsFour) {
    EXPECT_EQ(2 + 2, 4);
}
int main(int argc, char **argv) {
    ::testing::InitGoogleTest( &argc, argv );
    return RUN_ALL_TESTS();
}

$  g++ -Wall -o test test.cpp  -lgtest -lgtest_main -lpthread

参考

How to properly setup googleTest on Linux

soft-testing-practice's People

Contributors

david-guo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.