Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Is there an entry point for CppUnitTestFramework unit tests ?

Is there an entry point for CppUnitTestFramework unit tests ?

Scheduled Pinned Locked Moved C / C++ / MFC
testingquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #1

    I need to initialize a 3rd party library when doing some/most of our unit tests. We have a working homemade framework with an entry point (_tmain) where we can do all initialization for all our tests. I can't seem to find the equivalent with CppUnitTestFramework. I don't want to add a wrapper to do the 3rd party library initialization for each unit test. Can I do such a thing ? Thanks.

    I'd rather be phishing!

    L 1 Reply Last reply
    0
    • M Maximilien

      I need to initialize a 3rd party library when doing some/most of our unit tests. We have a working homemade framework with an entry point (_tmain) where we can do all initialization for all our tests. I can't seem to find the equivalent with CppUnitTestFramework. I don't want to add a wrapper to do the 3rd party library initialization for each unit test. Can I do such a thing ? Thanks.

      I'd rather be phishing!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try the CppUnitTestFramework API - Initialize_and_cleanup[^].

      M 1 Reply Last reply
      0
      • L Lost User

        Try the CppUnitTestFramework API - Initialize_and_cleanup[^].

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        Thanks, I will look into it, but it seems to be run for each test and is not global to all my test cases and test classes. ? "Defines methodName as a method that runs before each test method is run. TEST_METHOD_INITIALIZE can only be defined once in a test class and must be defined in the scope of the test class."

        I'd rather be phishing!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups