djeedjay / boosttestui Goto Github PK
View Code? Open in Web Editor NEWGUI runner for boost.test
License: Boost Software License 1.0
GUI runner for boost.test
License: Boost Software License 1.0
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]
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]
public void TestFixtureSetUp()
{
System.Console.WriteLine("C# TestFixtureSetUp");
}
Here it works correctly in version 1.1.2
here it fails in 1.1.5:
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");
}
}
}
Hi,
Can you please add the BootTestUi.exe file in the next releases ?
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
some tests don't load, because parameterized tests are not supported, see #27
https://github.com/nunit/docs/wiki/TestCaseSource-Attribute
Note: just noticed, there is already a pull request ready for this feature:
#25
Please merge it :)
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.
From the 1.7 docs:
Temporarily Disabling Tests
If you have a broken test that you cannot fix right away, you can add the DISABLED_ prefix to its name. This will exclude it from execution. This is better than commenting out the code or using #if 0, as disabled tests are still compiled (and thus won't rot).
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 ?
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.
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.
see email
The test is failing as the logging shows, but the UI checkbox is still marked 'green'
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();
}
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.
The ampersand is not printed but the following character is printed underlined.
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
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
---------------------------
since we now support
Maybe rename the project
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");
}
}
}
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();
}
setup:
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.
If I have a group of tests to enable, it makes sense to click the first test, hold shift and click the last test to select/deselect/toggle the tests.
This is not a duplicate of #1, I checked that the [TextFixture] and [Test] attributes are present.
scenario:
now it is running.
what happens:
and now I get:
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.