approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
317 stars 51 forks source link

CLion reporter does not open correctly if CLion is already open #215

Open christian-olsen opened 11 months ago

christian-olsen commented 11 months ago

When using the CLion reporter with a project open in the IDE, received and approved files are opened as regular tabs, and an empty diff window is opened for each failed test.

I experience this issue on macOS. I don't know if Windows/Linux are affected.

It seems that the nosplash argument when invoking CLion is the culprit here. As a workaround, you can skip the argument in CLion's startup script (/Users/[username]/Library/Application Support/JetBrains/Toolbox/scripts/clion) by adding this to the start of the for-loop:

  if [[ "$o" = "nosplash" ]]; then
      continue
  fi

With the workaround applied, ApprovalTests diffs correctly open in the CLion diff viewer.