Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

SciLexer: Change project configuration to enable Google Test

#35

As we start to do more actual feature enhancements to the N++ code and possible changes to SciLexer base we will need to have the ability to test things in SciLexer.

This will be done using the same approach that Google uses for testing their .dll

In order to have SciLexer use the user's settings for Gtest and Gmock the way that the PowerEditor project does a new 'Common' folder will be created at the solution level instead of duplicating files and creating two edit points and failure points for future changes.

Reported by Thell Fowler · January 29th, 2010 @ 10:22 PM

State: resolved
Milestone: v2.0.0
Assigned to: npp-community npp-community

Activity

  1. Thell Fowler
    Thell Fowler
    • State changed from new to open
    • Assigned user set to Thell Fowler

    January 30th, 2010 @ 09:48 PM

  2. 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]

    January 30th, 2010 @ 10:05 PM

  3. Thell Fowler
    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...

    February 3rd, 2010 @ 03:46 AM

  4. Jocelyn Legault
    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.

    February 16th, 2010 @ 08:03 PM

  5. Jocelyn Legault
    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...

    February 17th, 2010 @ 12:58 AM

  6. Jocelyn Legault
    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...

    February 17th, 2010 @ 08:16 PM

  7. Jocelyn Legault
  8. Thell Fowler
    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...

    February 20th, 2010 @ 12:43 AM

  9. Thell Fowler
    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...

    February 20th, 2010 @ 12:45 AM

  10. Thell Fowler
    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.

    February 20th, 2010 @ 05:15 AM

  11. Thell Fowler
    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...

    February 20th, 2010 @ 07:12 AM

  12. Thell Fowler
    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...

    February 20th, 2010 @ 07:12 AM

  13. Thell Fowler
    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.

    February 20th, 2010 @ 07:16 AM

  14. Jocelyn Legault
    Jocelyn Legault
    • State changed from needs_ack to acked

    February 22nd, 2010 @ 10:15 PM

  15. Thell Fowler
    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

    Committed by Thell Fowler

    February 27th, 2010 @ 06:04 AM

  16. 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...

    October 29th, 2010 @ 11:03 PM

  17. npp-community
    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...

    October 29th, 2010 @ 11:03 PM

  18. Thell Fowler
    Thell Fowler
    • State changed from candidate to resolved

    Merged to master.

    October 29th, 2010 @ 11:19 PM

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.