SciLexer: Change project configuration to enable Google Test
-
Thell Fowler
- State changed from new to open
- Assigned user set to Thell Fowler
-
Thell Fowler
- State changed from open to needs_ack
- Assigned user changed from Thell Fowler to npp-community
Pushed for ack:
http://github.com/almostautomated/npp-community/commit/56efc293d092...
projects: introduce console app for SciLexer tests
-
SciLexer-gtest-main.exe executes tests for SciLexer, it uses the same precompiled header as the SciLexer project. Adding tests is done the same way as for PowerEditor except you use a header instead of source file.
-
The project uses the same vsprop sheets defining gtest and mock paths as the PowerEditor project, and is setup to execute after debug and release builds.
[#35 SciLexer: Change project configuration to enable Google Test]
-
Thell Fowler
(from [b163e1663017c15f8ae6c570fafb8945d1d992a4]) projects: introduce console app for SciLexer tests
-
SciLexer-gtest-main.exe executes tests for SciLexer, it uses the same precompiled header as the SciLexer project. Adding tests is done the same way as for PowerEditor except you use a header instead of source file.
-
The project uses the same vsprop sheets defining gtest and mock paths as the PowerEditor project, and is setup to execute after debug and release builds.
[#35 SciLexer: Change project configuration to enable Google Test] http://github.com/almostautomated/npp-community/commit/b163e1663017...
-
-
Jocelyn Legault
This implementation has many things wrong with it:
- The tests are in a header file for no obvious reasons. They should be in a .cpp file.
- You are using the precompiled header from another project, which in itself is quite wrong.
- The tests are part of the test app where they should be part of the tested DLL.
- The right pattern should be to have a generic test runner to which you pass a DLL path in parameter and the runner would then run it. This is way more versatile and flexible. We'd also would not have to compile a 3rd project every time.
Let me see if I can whip something up quickly to show you what I mean.
-
Jocelyn Legault
(from [848b8c7c80ef432d7cf779922a599ef6f4c6eddb]) Rough idea for a test runner for DLLs
THIS CODE IS NOT MEANT FOR PRODUCTION
This is a very rough example of what I have in mind for a test runner. It will probably not compile on other devs machines because of the hard coded paths for GTest and GMock.
There's also the problem that the tests from the DLL don't appear to load, which is a major issue. I've sent a question on the GTest mailing list to that regard.However, it shows the general idea I have in mind for a generic test runner that could take any GTested DLL and run the tests for it.
Note that I would NOT include the TestRunner in the final solution. This is just there for quickness sake.
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/joce/npp-community/commit/848b8c7c80ef432d7cf7799... -
Jocelyn Legault
(from [5ac4ba89aeef6abe53cee184718e3b42ccd46f3c]) Test runner proof-of-concept.
Here's a working proof of concept for a generic test runner.
It requires a little bit of code in the tested DLL, but that
could be provided as part of a SDK (for plugins, for example).
It also requires to make sure that the function is exported.
In this example, I had to modify the .def to do that. I think
that in general, you don't need that and __declspec(dllexport)
are always exported.[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/joce/npp-community/commit/5ac4ba89aeef6abe53cee18... -
Jocelyn Legault
(from [9e5b43dad568a0cfe8789d2db741ccc3dfba0147]) Project cleanup:
- Removed (useless) gtest_main.lib and gmock_main.lib dependencies from the projects.
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
http://github.com/joce/npp-community/commit/9e5b43dad568a0cfe8789d2... -
Thell Fowler
(from [80198b57d823b6d1a79a1994fec014b9f04edab1]) scintilla project: alter post-build test script
- Altered the post build event that starts gtest to take advantage of the ENV_LIB_PATHS and SM_LIB_PATHS environment variables setup by the LIBS_PATHS vsprops sheet. It also now executes the correct gtest_runner using the same path as the lib notepad++ linked against.
This eliminates a false positive of not having the test runner run at all using the IF EXIST that was previously being used.
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/almostautomated/npp-community/commit/80198b57d823... -
Thell Fowler
(from [3cf541b3e776932e74a0245a4d09f891e7ffe9bf]) scintilla project: alter post-build test script
- Altered the post build event that starts gtest to take advantage of the ENV_LIB_PATHS and SM_LIB_PATHS environment variables setup by the LIBS_PATHS vsprops sheet. It also now executes the correct gtest_runner using the same path as the lib notepad++ linked against.
This eliminates a false positive of not having the test runner run at all using the IF EXIST that was previously being used.
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/almostautomated/npp-community/commit/3cf541b3e776... -
Thell Fowler
- State changed from needs_ack to open
- Assigned user changed from npp-community to Thell Fowler
I apologize for not noticing this earlier, yet it seems this topic branch was based on on a work in progress branch the almost every test topic in it. I'll fix it up and resubmit.
-
Thell Fowler
(from [cda81313a82bb08b39da3a6507d8b4891bad15be]) Scintilla: introduce setup for unit tests.
-
Maintainer's note: This is a manual recreation of a few patches from a topic branch with many unrelated patches...
-
Implementation of the gtest_runner.exe utility that is introduced in the jl/LH-35/micro-test-runner branch of the N++CR repo of gtest.
-
Project cleanup: Removed (useless) gtest_main.lib and gmock_main.lib dependencies from the projects.
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/almostautomated/npp-community/commit/cda81313a82b... -
-
Thell Fowler
(from [a554ace063f584d65189b909e786bb1bf12f2d42]) scintilla project: alter post-build test script
-
Altered the post build event that starts gtest to take advantage of the ENV_LIB_PATHS and SM_LIB_PATHS environment variables setup by the LIBS_PATHS vsprops sheet. It also now executes the correct gtest_runner using the same path as the lib notepad++ linked against.
-
Requires gtest branch jl/LH-4v2/introduce-dll-test-runner-app
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/almostautomated/npp-community/commit/a554ace063f5... -
-
Thell Fowler
- State changed from open to needs_ack
- Assigned user changed from Thell Fowler to Jocelyn Legault
Topic is now based upon next (which required the least cherry-picking).
I had to squash your commits Joce, but re-committed using your ID and timestamp. That commit is slightly different and the message has been altered to reflect that there is no 'removal' of a previous patch.
Let me know if you have any questions on it.
-
Jocelyn Legault
- State changed from needs_ack to acked
-
Thell Fowler
- Assigned user changed from Jocelyn Legault to npp-community
- State changed from acked to candidate
Promoted
Merge branch 'tf/LH-35v4/scintilla-setup-for-testing' into next
- tf/LH-35v4/scintilla-setup-for-testing: scintilla project: alter post-build test script Scintilla: introduce setup for unit tests. http://github.com/npp-community/npp-community/commit/acd9d584168834...
Committed by Thell Fowler
-
Thell Fowler
(from [b336e8415a6fc28e13cadc766a5056343d473144]) scintilla project: alter post-build test script
-
Altered the post build event that starts gtest to take advantage of the ENV_LIB_PATHS and SM_LIB_PATHS environment variables setup by the LIBS_PATHS vsprops sheet. It also now executes the correct gtest_runner using the same path as the lib notepad++ linked against.
-
Requires gtest branch jl/LH-4v2/introduce-dll-test-runner-app
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/npp-community/npp-community/commit/b336e8415a6fc2... -
-
npp-community
(from [01609c5feac5d200e7b946245b0c106816e8666c]) Scintilla: introduce setup for unit tests.
-
Maintainer's note: This is a manual recreation of a few patches from a topic branch with many unrelated patches...
-
Implementation of the gtest_runner.exe utility that is introduced in the jl/LH-35/micro-test-runner branch of the N++CR repo of gtest.
-
Project cleanup: Removed (useless) gtest_main.lib and gmock_main.lib dependencies from the projects.
[#35 SciLexer: Change project configuration to enable Google Test]
Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
Signed-off-by: Thell Fowler git@tbfowler.name
http://github.com/npp-community/npp-community/commit/01609c5feac5d2... -
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.