I'm using Catch Lib for unit testing
Previously, I tested a headers individually, and had no issue with TEST_CASEs but after final including all of these into the project I faced with a lot of errors like this:
c:\dev\workspace\algolist\src\algolist.hpp(143): error C2374: '`anonymous-namespace'::autoRegistrar143': redefinition; multiple initialization
c:\dev\workspace\algolist\src\mfactory.hpp(143): note: see declaration of '`anonymous-namespace'::autoRegistrar143'
c:\dev\workspace\algolist\src\algolist.hpp(143): error C2084: function 'void ____C_A_T_C_H____T_E_S_T____143(void)' already has a body
c:\dev\workspace\algolist\src\mfactory.hpp(143): note: see previous definition of '____C_A_T_C_H____T_E_S_T____143'
can someone explain me what does this mean ?
It looks like your're putting TEST_CASE's in the HPP files and then including them both from the same CPP file. You have several options: