26

Seems a great C++ unit testing framework. I'm just wanting something a bit more sophisticated than the console output for running the test, also something that makes it really easy to run specific tests (since gtest supports all kinds of test filtering)

If there is nothing, I'll probably roll my own

Gordon Wilson
  • 26,244
  • 11
  • 57
  • 60
Keith Nicholas
  • 43,549
  • 15
  • 93
  • 156

8 Answers8

16

I opened a google code project that adds UI to google test. Runs on both Windows and Unix. It is not a plugin to any IDE by design - I did not want to tie myself. Instead you open it in the background and press the "Go" button whenever you want to run.

As of this writing V1.2.1 is out and you are invited to give it a try.

https://github.com/ospector/gtest-gbar

Omri Spector
  • 2,431
  • 24
  • 22
  • Strange, the GUI is written in C#, but gtest is C++ – linquize Jan 20 '14 at 04:09
  • 2
    Actually it isn't strange at all - they are separate layers. Many UI tools used in C++ are not written in C++ anymore (Dev studio, Eclipse CDT - to name two). Writing UI in C++ takes longer. – Omri Spector Jan 21 '14 at 06:32
8

According to the project owner, there isn't. If you do work on one, do post to the project's group. I'm sure there are some folks there who'd like to help.

Gordon Wilson
  • 26,244
  • 11
  • 57
  • 60
  • am having a crack at doing a visual studio plugin that will run the tests. Bit of a sidetrack project so not sure when it will be done, and the extensibility of visual studio is quite complicated at first it seems! – Keith Nicholas Nov 20 '08 at 20:52
3

Industrial Logic has an Eclipse plugin for running and displaying results from gtest. The update site is http://plugins.industriallogic.com/gtest/

Community
  • 1
  • 1
Pat Notz
  • 208,672
  • 30
  • 90
  • 92
3

GTest Runner is a stand-alone UI for windows and linux that I have made which watches for changes to your gtest executables on disc and automatically re-runs the tests when they change, i.e. when you build them.

It has some cool features for filtering and sorting, and even though it isn't tied into any IDE, double-clicking a failure will open the IDE the file type is associated and copy the failure line number to the clipboard. With most IDEs, that will allow a quick CTRL-G + CTRL-V to get you to the line where the test failed.

It also provides progress bars while each test is running (multiple can be done each in their own thread), and redirects the console output into a dock so you can see both the original gtest output and the GUI-fied xml.

Full Disclosure: I am the author of GTest Runner.

Community
  • 1
  • 1
Nicolas Holthaus
  • 7,763
  • 4
  • 42
  • 97
  • 2
    Excessive promotion of a specific product/resource may be perceived by the community as **spam**. Take a look at the [help], specially [What kind of behavior is expected of users?](http://stackoverflow.com/help/behavior)'s last section: _Avoid overt self-promotion_. You might also be interested in [How do I advertise on Stack Overflow?](http://stackoverflow.com/help/advertising). – Tunaki Mar 27 '16 at 23:00
  • Thank you, looks interesting. I will take a closer look!! :D – Random Citizen Jul 07 '18 at 05:58
2

For Visual Studio 2012 there is a Test Adapter for Google Test. This means it integrates with the Visual Studio Test Explorer: Google Test Adapter

NobodysNightmare
  • 2,992
  • 2
  • 22
  • 33
2

This only solves the viewing problem, but gtest can produce JUnit compliant XML Reports. From that it should be possible to feed it into a test runner:

https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#generating-an-xml-report

rold2007
  • 1,297
  • 1
  • 12
  • 25
Greg Malcolm
  • 3,238
  • 4
  • 23
  • 24
1

The industrial logic plugin, which doesn't seem to be available anymore, was based on the cute eclipse plugin: http://r2.ifs.hsr.ch/cute/.

I think it should be minimal effort to adapt it. The original plugin used to parse the command line. Using an XML Report like suggested above will get you there even faster...

till
  • 570
  • 1
  • 6
  • 22
1

There is a feature request opened for that on the project tracker since a long time ago. http://code.google.com/p/googletest/issues/detail?id=40

Feel free to contribute ;) or at least vote for it.

greydet
  • 5,509
  • 3
  • 31
  • 51
  • 1
    The feature request now mentions this Eclipse plug-in which works quite well https://github.com/xgsa/cdt-tests-runner/wiki/Tutorial. – Wayne Johnston Feb 20 '12 at 22:11