Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeIt and CppUTest #323

Open
jwgrenning opened this issue Aug 31, 2023 · 3 comments
Open

FakeIt and CppUTest #323

jwgrenning opened this issue Aug 31, 2023 · 3 comments

Comments

@jwgrenning
Copy link

jwgrenning commented Aug 31, 2023

Hi

I am experimenting FakeIt with CppUTest and the stand-alone single header for use in a training exercise. It works nicely and I had no problem getting it working with CppUTest, but the 10,000 line single header adds a second to test build on my linux box.

I have a cloud server I use with cyber-dojo as a training exercise server. This environment is shared by people doing training exercises. For simple test-runners that include fakeit.h, there is a 20-second build time on my dev server.

Is there are non-single header way of using FakeIt? You know, separating interface from implementation?

Thanks, James

@malcolmdavey
Copy link
Contributor

My assumption based on the amount of templating is that it needs to be header only.

I know windows Visual Studio allows precompiled headers so in effect it can be optimised to only compile it once, instead of for every source file with tests. Haven't tried it on linux/gcc etc, and not sure if this would help your scenario.

@jwgrenning
Copy link
Author

Hi, Thanks for the reply. I tried the GCC pre-compiled header but could not get it to do anything useful for me.

Do any people find the performance a problem? It seems like it would add the better part of a second to the build for each file that uses fakeit.

@FranckRJ
Copy link
Collaborator

I've never really tested compilation time so I don't know how much impact the library has. I haven't looked into importing headers individually either, instead of importing the single-header only. Maybe it could help but I don't know if the includes are "clean" in the sense that they only include necessary headers themselves. I should probably look that one day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants