GithubHelp home page GithubHelp logo

google-test-runner's Introduction

Google Test Runner

Intro

It is a simple tools to run many googletest suits (separate executables) and collect overall statistics.

Why

C++ googletest is great lib to test C++ code. But I run into a problem how to run many googletest executables locally and collect an overall statistics. Lets say tests are fast, but initialization for a suite takes some time. For exammple I have 20 test case suits. Initialization (::testing::Test::SetUpTestCase) for each suit takes about 1 sec. And I have about 500 test.

Ctest -j4 does the thing. But it runs every test separatelly, invokes ::testing::Test::SetUpTestCase for each test. It ends up to 500 sec/4 (number of processes) = 125 sec.

I can run all tests using find . -type f -name '*_test' -exec bash -c {} ';'. But it does not show failures at the end.

Installation

Before: You must have go >= 1.12 installed.

  1. Clone the repo git clone https://github.com/airenas/google-test-runner

  2. Build cd google-test-runner/cmd/google-test-runner && go build

  3. Copy executable somewhere on your path sudo cp google-test-runner /usr/local/bin

Usage

Run google-test-runner -h for a help.

  1. Go to a dir containing googletest executables inside

  2. Lets say find . -type f -name '*_test' - returns googletests with relative paths

  3. Invoke the tests:

  • Standard: find . -type f -name '*_test' | google-test-runner
  • Filter as parameter: google-test-runner -f ./**/*_test
  • Show only failing tests: google-test-runner -o f -f ./**/*_test
  • One worker: google-test-runner -j 1 -s -f ./**/*_test

Author

Airenas Vaičiūnas


License

Copyright © 2019, Airenas Vaičiūnas.


google-test-runner's People

Contributors

airenas avatar

Watchers

 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.