Giter VIP home page Giter VIP logo

Comments (5)

claremacrae avatar claremacrae commented on June 13, 2024

Might an alternative to adding a patch be to fix our #ifdefs to prevent the windows code from being compiled in mingw - like we did with Cygwin?

from approvaltests.cpp.

claremacrae avatar claremacrae commented on June 13, 2024

I had a quick go on this before we pair on it on Friday, and I've found that:

  • Visual Studio defines _WIN32 when compiling C++
  • cygwin provided by the current CLion does not
  • mingw (provided by Qt Creator 4.9.0 with Qt 5.12.2) does define _WIN32

This means that our way of detecting Unix-like environments on Windows for Cygwin doesn't work in mingw...

I've got a long way by using _MSC_VER instead...

There's also a problem of mingw not providing a valid POSIX mkdir() - as in https://stackoverflow.com/questions/12102147/too-many-arguments-to-function-int-mkdirconst-char - see the answer https://stackoverflow.com/a/14200178/104370

The changes need reviewing, but I can now get the code to build with mingw.

Sadly tests don't pass, as - I think - how Windows file paths are handled by mingw seems to be different from both native windows and cygwin.

from approvaltests.cpp.

claremacrae avatar claremacrae commented on June 13, 2024

The failing test is:

-------------------------------------------------------------------------------
Reporters Report Success Status
-------------------------------------------------------------------------------
...\ApprovalTests.cpp\ApprovalTests_Catch2_Tests\reporters\ReporterTests.cpp:39
...............................................................................

...\ApprovalTests.cpp\ApprovalTests_Catch2_Tests\reporters\ReporterTests.cpp:43: FAILED:
  REQUIRE( true == result )
with expansion:
  true == false

from approvaltests.cpp.

claremacrae avatar claremacrae commented on June 13, 2024

The symptom is in this code:

TEST_CASE("Reporters Report Success Status") {
    std::string knownCommand = SystemUtils::isWindowsOs() ? "C:\\Windows\\System32\\user.exe" : "echo";

With our current behaviour in mingw, SystemUtils::isWindowsOs() returns true, so knownCommand returns C:\Windows\System32\user.exe

When the failing test is run, this code in SystemLauncher::launch() returns false - and the front() value checked is the user.exe path mentioned above:

    bool launch(std::vector<std::string> argv) override
    {
        if (!exists(argv.front()))
        {
            return false;
        }

from approvaltests.cpp.

claremacrae avatar claremacrae commented on June 13, 2024

This issue was fixed in the v.3.4.1 release. Closing.

from approvaltests.cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.