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 7438005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:29:15+00:00 2026-05-29T10:29:15+00:00

i looked at Test C code with googletest but did not find any satisfactory

  • 0

i looked at Test C code with googletest but did not find any satisfactory answer.

In most of the unit testing frameworks, simple examples always work, but when it comes to medium or large code base, where there are 30 or more modules, and the dependencies are everywhere , HOW do use these tools ? plus gtest does not claim that it can test C code. but here is an example if using gtest to test c code
test c code with gtest

  • 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-05-29T10:29:16+00:00Added an answer on May 29, 2026 at 10:29 am

    Not really

    As the blog post you linked says, the differences between the languages make it difficult to use a well designed C++ testing framework for testing C. Like the example in the article, you can shoe-horn C++ testing frameworks to test C using #define etc, but as you mentioned, you will run into problems when there are a lot of dependencies.

    This is a common problem – this question about C testing includes a lot of C++ testing tools, but I really don’t think they’d work well for larger projects.


    Here are some suggestions

    If you use autotools, you might want to look at Check. I’ve also been using test-dept, which is nice and lightweight, and allows for replacing functions on the fly. I’ve been using it to add tests to a very large codebase for a few months now, and it seems fine so far (though I ended up doing quite a bit of refactoring – but I think that would have been the case no matter the framework).

    There are many other suggestions in the question I linked before.

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

Sidebar

Related Questions

I'm trying to use TestDriven.Net not only to test my code, but to call
I looked up my question on the Internet but couldn't find an answer...so I'm
I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format
In the Go tutorial, and most of the Go code I've looked at, packages
I have looked around a lot, and not found the answer yet. Maybe it
I am getting this error in java in my junit test code. I looked
I have looked around the internet but haven't been able to find a working
I have looked into a few similar questions on SO, but have not yeet
I looked into previous questions, but they didn't seem to answer what's happening to
I looked through some code and noticed that the convention was to turn pointer

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.