Unit Testing

Has anyone had any success unit testing? As in the logic side of things using GoogleTest or something similar (I noticed there was some mention of hardware automated tests).
I’m having a tough time getting GoogleTest to work, as the MinGW for Windows doesn’t support std::Mutex, which GoogleTest needs, so I’m trying to install a different version of MinGW, but I haven’t succeeded yet.

Has anyone got this working or have you tried anything else?

We do some unit testing with GoogleTest in libDaisy. You can take a look here and see how it’s set up. I just run make then ./build/bin/libDaisy_gtest.exe.

I have to run the unit tests in Cygwin to have them work, git bash doesn’t work out of the box. I can’t recall if I had to install any special packages to get Cygwin to work, you might know Cygwin has a package manager utility built into its installer.

Alternatively, I found this thread on stackoverflow How to compile googletest on windows using mingw with msys?

Let me know if either of those work of if you have any other questions.

1 Like

Hi, thank you for the reply. I did see the GoogleTest in libDaisy after I’d posted this! However by that time I’d used Catch2 which is a lot simpler to get going with but has fewer features. I will look at that link though, thanks for that.

1 Like