Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9151257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:45:40+00:00 2026-06-17T11:45:40+00:00

I´m working on a unit tester for c++, mostly for practice, but I´m stuck.

  • 0

I´m working on a unit tester for c++, mostly for practice, but I´m stuck.

The way I want it to work is as follows:

  1. It reads all class and function names from all .hpp files within a defined test folder and its sub-folders. These have assertions that are linked to a logger that outputs HTML files with the test results.
  2. It creates a single .hpp or .cpp file that creates one instance of every test class and runs every function in it.
  3. It compiles the .hpp/.cpp file created in step 2.
  4. It runs the output of step 3.

I have 1. and 2. down but I´m having trouble compiling the .hpp file I created. I initially wanted to compile using a simple call to cl.exe but that is proving to be more problematic than I originally anticipated.

Do any of you know of a good/simple way of compiling a single file?
I have done some research on make/nmake but I can´t figure out how to accomplish this with them.

Also, if this method of doing unit tests is completely stupid, please let me know.

Some info:
I´m using Windows 7 64-bit and Visual Studio 2010

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:45:41+00:00Added an answer on June 17, 2026 at 11:45 am

    Assuming the generated something.cpp file contains #include "something.hpp", then it should just be a case of cl something.cpp and you get a something.exe, which you can run in some suitable way.

    “Calling every funciton on an object” seems a little strange – how do you know whether the result is correct? If we have a complex object, it may require more than creation to support calling all functions. What parameters are you passing in to each function? How do you know what it should return?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a c++ unit tester(mostly as practice) and had some questions
I have a unit test class Tester ; I want it to access private
I am working with Silverlight Unit Testing i need to test a function which
I am working with a unit-testing suite that hijacks function calls and tests expected
I am creating unit test for this (working fine) Grails service : class CommonCodeService
We are working using the Unit Of Work pattern combined with the Generic Repository
I am working on a unit testing for a function in a form call
I'm working on unit tests for my little daemon but I'm having trouble getting
I was working on a Unit of Work implementation that works both in Entity
In F# I want to perform unit testing on a function with several levels

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.