FreeYourSoul / FSeam

Cpp header only library to manage compile time mock class generated via Python script
MIT License
86 stars 8 forks source link

Allow fileending *.h for mocked classes #9

Closed jatozy closed 4 years ago

jatozy commented 5 years ago

Is your feature request related to a problem? Please describe. Currently I am playing with FSeam. And in my test project I use the fileending *.h for header files. E.g. I have the class component2 which shall be mocked for class component1. And When I compile the tests, I get the errormessage:

Traceback (most recent call last):
  File "/usr/local/bin/FSeamerFile.py", line 490, in <module>
    generateFSeamFile(_args[0], _args[1], _forceGeneration)
  File "/usr/local/bin/FSeamerFile.py", line 452, in generateFSeamFile
    raise NameError("Error file " + filePath + " is not a .hh file")
NameError: Error file /workspaces/Basic_Cpp_Project/tests/component1/../../application/component2/component2.h is not a .hh file

The CMakeLists.txt of the tests contains the test:

addFSeamTests(
        DESTINATION_TARGET component1Tests
        TARGET_AS_SOURCE component2
        TST_SRC 
                ${CMAKE_CURRENT_SOURCE_DIR}/component1Tests.cpp
        TO_MOCK
                ${CMAKE_CURRENT_SOURCE_DIR}/../../application/component2/component2.h
)

When I change the name of the file component2.h to component2.hpp, then the error doesn't appear.

Describe the solution you'd like Because of that this framework shall be used with ancient legacy code, and *.h is a very often fileending for header files, it would be nice if you would disable the filter for the filename of the headerfiles.

FreeYourSoul commented 5 years ago

Hello, A fix has just been provided for this issue. I may also add a way to register manually any type of extension file to handle in the future (I add it into the todo list file of the project and close this ticket when you confirm it is fixed)

jatozy commented 5 years ago

Sounds good. I will test it on the weekend.

FreeYourSoul commented 4 years ago

Did you give it a try?

jatozy commented 4 years ago

Hi sorry for the very late reply,

yes I have tried it and yes now the fileending .h works.