Skip to content

"Unable to create directory" - unable to run test build with mingw provided by qt-installer #197

@Florian-Fischer-InMach

Description

@Florian-Fischer-InMach

Hello,
I want to use approval test for some legacy embedded C code.
Thus my c++/cmake knowledge is very limited.

My Setup:

  • Windows 10
  • ApprovalTests 10.12.2
  • CMake 3.21.1 -- provided by qt-installer
  • MinGw64 11.2.0 -- provided by qt-installer for qt 6.3.0
  • QT Creator 7.0.1

I get the same error message as mentioned in #195
I took his example files and created a new cmake project via QT Creator

__FILE__ == C:/Users/florian.fischer/Documents/inmach/src/approvalTest_problem/path_problem_demo/test.cpp

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
path_problem_demo.exe is a Catch v2.13.9 host application.
Run with -? for options

-------------------------------------------------------------------------------
MyTestCase
-------------------------------------------------------------------------------
C:/Users/florian.fischer/Documents/inmach/src/approvalTest_problem/path_problem_demo/test.cpp:5
...............................................................................

C:/Users/florian.fischer/Documents/inmach/src/approvalTest_problem/path_problem_demo/test.cpp:5: FAILED:
due to unexpected exception with message:
  Unable to create directory: 

===============================================================================
test cases: 1 | 1 failed
assertions: 1 | 1 failed

I "solved" it by modifying

std::string SystemUtils::getDirectorySeparator()
{
    //return isWindowsOs() ? "\\" : "/";
    return "/";
}

But then it fails when i want to use AutoApproveIfMissingReporter because copy does not like the paths with / instead of \

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions