Giter Site home page Giter Site logo

boosttestui's Introduction

BoostTestUi
~~~~~~~~~~~

BoostTestUi provides a Windows gui runner for boost.test and google test
based unit test executables.


How to build
------------

This is a Visual Studio 2010 project with the following dependencies:
- boost 1.43 or later
- WTL 9.0 or later
- gtest 1.6.0 or later (only required for the GTestSample sample unit test)
- Catch 1.5.8 or later

These libraries must be installed in Libraries. All projects should now build.


Boost.test support
------------------

In your unit test, replace <boost/test/unit_test.hpp> with
<boost/test/unit_test_gui.hpp>:

	#define BOOST_TEST_MODULE Exe TestRunner Test
	#include <boost/test/unit_test_gui.hpp>

	BOOST_AUTO_TEST_CASE(MyTest) { ... }

You can also provide your own init_unit_test_suite() initialization function
by omitting BOOST_TEST_MODULE, as usual.


Google test support
-------------------

In your unit test, replace #include <gtest/gtest.h> with <gtest/gtest-gui.h>:

	#include <gtest/gtest-gui.h>

	TEST(MyTest, MyTestCase) { ... }

Then add InitGoogleTestGui() to your main function body like this:

	int main(int argc, char* argv[])
	{
		testing::InitGoogleTest(&argc, argv);
		testing::InitGoogleTestGui(&argc, argv);
		return RUN_ALL_TESTS();
	}


BoostTestUi
-----------

Run BoostTestUi.exe and open a unit test executable that was build with
the gui header included. The appropriate header can be generated from the
File -> Create Header menu. Store it preferably in a sub folder named
"boost/test" or "gtest" in one of your include directories. Now select
Run from the toolbar or the test tree context menu to run the tests.


Gert-Jan de Vos
mailto:[email protected]

boosttestui's People

Contributors

berendsed avatar djeedjay avatar gertjan-devos avatar gjdevos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

boosttestui's Issues

Feature request: copy test name

in the context menu of a test please provide a 'copy' to clipboard option, that copies the name of the text 'MotionSystemTest.ControllerConnectionLostThenRecover' to the clipboard from the test:

TEST_F(MotionSystemTest, ControllerConnectionLostThenRecover)

Also what could be nice, is 'copy cmdline' that would give me, for example:
MdlMotion2LibTest.exe --gtest_filter=MotionSystemTest.ControllerConnectionLostThenRecover

TestFixtureSetUp is not called in most recent version of BoostTestui (v1.1.5 from jan_17_2018)

    [TestFixtureSetUp]
    public void TestFixtureSetUp()
    {
        System.Console.WriteLine("C# TestFixtureSetUp");
    }

Here it works correctly in version 1.1.2

boost_test_v1 1 2 _25_jun_2017

here it fails in 1.1.5:

boost_test_v1 1 5_jan_17_2018

reproduce:

namespace TestProjectNunit
{
    public abstract class FixtureBase
    {
        // This class has default constructor so it will generate an error
    }

    /// <summary>
    /// Simple sequences of Set and Get calls on the GFI interface.
    /// (no checks on received notifications etc.)
    /// </summary>
    [TestFixture]
    public class TestGFI03SetGet : FixtureBase
    {
        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            System.Console.WriteLine("C# TestFixtureSetUp"); // not called in v1.1.5
        }

        [TestFixtureTearDown]
        public void TestFixtureTearDown()
        {
            System.Console.WriteLine("C# TestFixtureTearDown");
        }

    }
}

debugview++test 'LineBufferTest2' locks up the GUI temporarily

the test outputs 3x17.000 lines during the test, this completely locks up the UI while the test is running.
There is also another symptom visible:
a std::cout << msg << std::endl is not 'flushing' until the end of the test, so there is now way to tell the user to wait

Repeating tests will start a new process each time

For leak-tests it is useful to repeat tests 1000 or 10.000 times, however, to be able to monitor is the tests to no leak, it is needed that the --repeat option of the framework is used instead of re-starting the test by boosttestui.

show the full path of a test somewhere

image

I other have multiple versions, debug/release/debug64/release64 in the recently opened list,
so it would be good if you could see which one is currently loaded, without having to re-load is again.

maybe in the title-bar? that would not make sense if we later decide to support loading multiple test projects

maybe in the hover- tooltip ?

Loading a nunit test dll gives 'no test cases'

image

This dialog is displayed if the [TestFixture] attribute is missing

[TestFixture]
public class Test
{
    [Test]
    public void TestMethod() 
    {
    }
}

I think it would be nice to suggest to check the [TestFixture] and [Test] attributes on the class and methods. Maybe add a code-example for nunit in the Help-menu also.

Failing googletest shows as 'successful'

TEST(TestCase, Test)
{
	EXPECT_EQ(1 + 1, 2);
	throw std::exception("");
}

int main(int argc, char* argv[])
{
	testing::InitGoogleTest(&argc, argv);
	testing::InitGoogleTestGui(&argc, argv);

	return RUN_ALL_TESTS();
}

image

Search / filter tests by name maybe SAIT feature?

ofter I know which test I want to run, but locating it in the long list can be a challenge. I would be nice to have either a search of filter feature on top of the list of tests.

Alternatively, a 'search as I type' feature like in debugview++ would also suffice.

throwing an exception in a testcase seems to pass the test

The test is failing as the logging shows, but the UI checkbox is still marked 'green'

image

TEST(TestCase, Test)
{
EXPECT_EQ(1 + 1, 3);
}

TEST(TestCase, TestException)
{
throw std::exception("test");
}

TEST(DISABLED_TestCase, TestException)
{
throw std::exception("test");
}

int main(int argc, char* argv[])
{
testing::InitGoogleTest(&argc, argv);
testing::InitGoogleTestGui(&argc, argv);

return RUN_ALL_TESTS();

}

Feature request: load multiple tests

It would be nice to be able to open more then one test at the same time.
It would also be a unique feature, because I dont know of any other environment where you can load projects from different test-frameworks at the same time.

some tests are not working

If the boosttestui is unable to query a list of tests, please show the stdout information in the output, this way the user can get feedback on why its not working

The case was a customized test that needed special commandline options and it was explaining this on the commandline but never shows in the boosttestui

Unable to run a googletest that was not build with gtest-gui.h

I think this dialog is very nice, however, if I was to run someone else's tests it still be useful to continue.
Can we load anyway after pressing ok?

---------------------------
Boost Test Runner
---------------------------
Did you forget to #include <gtest/gtest-gui.h>?
---------------------------
OK   Help   
---------------------------

Proposal for new dialog: (and disable the 'attach debugger' button

---------------------------
Boost Test Runner
---------------------------
Did you forget to #include <gtest/gtest-gui.h>?
You can continue, but some functions will not be available.
---------------------------
OK   Help   
---------------------------

With nunit 2.6.7 or higher replaced TestFixtureSetUp and TestFixtureTearDown

1>C:\Users\jan\source\repos\Nunittest\Class1.cs(9,10,9,26): warning CS0618: 'TestFixtureSetUpAttribute' is obsolete: 'Use OneTimeSetUpAttribute'
1>C:\Users\jan\source\repos\Nunittest\Class1.cs(15,10,15,29): warning CS0618: 'TestFixtureTearDownAttribute' is obsolete: 'Use OneTimeTearDownAttribute'
// pre nunit 2.6.x TestFixtureSetUp syntax
namespace TestProject
{

    [TestFixture]
    public class Tester
    {
        [TestFixtureSetUp] // pre  2.6.x syntax
        public void TestFixtureSetUp()
        {
            System.Console.WriteLine("C# TestFixtureSetUp"); 
        }

        [TestFixtureTearDown] // pre  2.6.x syntax
        public void TestFixtureTearDown()
        {
            System.Console.WriteLine("C# TestFixtureTearDown");
        }

        [Test]
        public void Mytest()
        {
            System.Console.WriteLine("C# Mytest");
        }

    }
}
// nunit 2.6.x or nunit 3.x.x  replaced TestFixtureSetUp and TestFixtureTearDown
// with OneTimeSetUpAttribute and OneTimeTearDownAttribute

// TestFixtureSetUp and TestFixtureTearDown **are** still allowed, but reported as obsolete

namespace TestProject
{

    [TestFixture]
    public class Tester
    {
        [OneTimeSetUpAttribute ]       //new
        public void TestFixtureSetUp()
        {
            System.Console.WriteLine("C# TestFixtureSetUp"); // not called in v1.1.5
        }

        [OneTimeTearDownAttribute]     //new
        public void TestFixtureTearDown()
        {
            System.Console.WriteLine("C# TestFixtureTearDown");
        }

        [Test]
        public void Mytest()
        {
            System.Console.WriteLine("C# Mytest");
        }

    }
}

GoogleTest compatibility with parameterized tests is broken?

This works correctly in version 1.0.9.553 from september 8, 2016
but nolonger in 1.1.1 from 20 December 2016

Tested using googletest 1.8.0
(https://github.com/google/googletest/releases/tag/release-1.8.0)

#include "stdafx.h"
#include <gtest/gtest-gui.h>
#include "gtest/gtest.h"
#include "gmock/gmock.h"

#pragma comment(lib, "gmock.lib")

class Mytest : public testing::TestWithParam<std::tuple<int,int,int>>
{
};


INSTANTIATE_TEST_CASE_P(MyTestname, Mytest, ::testing::Values(
    std::make_tuple(1, 5, 7),
    std::make_tuple(2, 4, 6),
    std::make_tuple(3, 7, 11)
));

TEST_P(Mytest, Foo)
{
    auto parms = GetParam();
}


TEST(TestCase, Test)
{
	EXPECT_EQ(1 + 1, 2);
}

int main(int argc, char* argv[])
{
	testing::InitGoogleTest(&argc, argv);
	testing::InitGoogleTestGui(&argc, argv);

	return RUN_ALL_TESTS();
}

Boosttestui does not appear at all using remote-desktop

setup:

  • two physical monitors, main screen on the left, second screen on the right.
  • remote desktop into the machine using a different setup: main screen on the right, second on the left.

the stored x,y coordinates are now 'off screen' and the main window is invisible.

I think its basically this issue:
CobaltFusion/DebugViewPP#72
which you fixed in debugview, but not here yet.

opening a new file while in repeat-test mode is weird

scenario:

  • open a test
  • set 'repeat' on
  • press 'play'

now it is running.

  • file->open-> some other test

what happens:

  • the log window is cleared
  • the testing of the previous test that was still repeating continues

and now I get:


Boost Test Runner

Did you forget to #include <gtest/gtest-gui.h>?

OK Help

because that is exactly what I forgot :)

The point here is, it might be clearer to stop the testing before trying to open a new test, because if you open a new test, you probably did not intent to keep running the current test.

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.