Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

Ceedling does not recognize "/" in paths in Windows

Open jonathon-generac opened this issue 3 years ago • 2 comments

I am running Ceedling in windows, sometimes. I have the GNU toolchain installed via MSYS2/MINGW64 and Ceedling installed using Ruby. I can run all of my unit tests in Ceedling with no problems if I define all of the source file dependencies using TEST_FILE() or if the header file is included for any source file dependencies with no forward slashes. However, if an absolute or relative path is used (i.e. #include "../someFolder/myHeader.h"), then Ceedling will not compile the source file associated with the header. When running in Linux it works fine in this case.

jonathon-generac avatar Aug 05 '22 19:08 jonathon-generac

I have exactly the same problem. On Windows files included with path are not compiled. They are also missing in the build/test/preprocess/includes files.

Chr157i4n avatar Jun 17 '24 14:06 Chr157i4n

i found a workaround for me:

replacing these lines:

https://github.com/ThrowTheSwitch/Ceedling/blob/75698bdf4ffd26d9a3a84c18ea81d8f2bc7174ad/lib/ceedling/preprocessinator_includes_handler.rb#L365-L370

with:

    _nested.each_key do |filepath|
      filepath1 = filepath.dup
      filepath1.slice! "./"
      if _shallow.has_key?( filepath1 )
        common << filepath1         # Copy to common
        _shallow.delete(filepath1)  # Remove matching filepath from _shallow list
      end
    end

Because the path in the filepath variable have "./" as prefix and therefore don't match with _shallow where the path don't have "./" as prefix

Chr157i4n avatar Jun 19 '24 09:06 Chr157i4n