Comments (13)
Evolving list of actions:
Fix this for:
- Catch2
- doctest
- Boost.ut
If possible, add warnings if user references old naming for:
- Decided not to do in this ticket - Catch2
- Decided not to do in this ticket - doctest
- Decided not to do in this ticket - Boost.ut
Other stuff
- Get this working with the starter project - Updating this is now part of the #85
from approvaltests.cpp.
@claremacrae, how about a developer warning when someone links against the old targets so that they can eventually be removed?
from approvaltests.cpp.
@athrun22 Good idea - do you have any idea where I should look to find out how to do that?
from approvaltests.cpp.
(Content moved to comment above)
from approvaltests.cpp.
@claremacrae This is an interesting predicament 🧐
CMake support for a library deprecation feature is actively being developed.
Off the top of my head, an interface library could be used to transitively link to the required library and an add_custom_command(TARGET) could be used to issue a warning message POST_BUILD using the cmake -E echo
feature. I'll write up an example when I have time.
from approvaltests.cpp.
@claremacrae See below for an example for Catch2. Be warned that I have not had a chance to test it yet.
add_library(catch INTERFACE)
target_link_libraries(catch INTERFACE Catch2::Catch2)
add_custom_command(TARGET catch POST_BUILD COMMAND ${CMAKE_EXECUTABLE} ARGS -E echo "ApprovalTests: CMake target 'catch' is deprecated and may be removed in the future. Please link to the target 'Catch2::Catch2' instead.")
from approvaltests.cpp.
I thought I had got these all implemented correctly, and just needed to add the warnings...
Then I added these lines for a project that pulled Boost.ut in via FetchContent_Declare()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Turn off some checks for issues that should be fixed in ApprovalTests code
target_compile_options(boost.ut INTERFACE
-Wno-newline-eof
-Wno-shadow-field-in-constructor
-Wno-weak-vtables
)
endif()
And then I went to add the same lines to ApprovalTests.cpp/third_party/ut/CMakeLists.txt
and got:
CMake Error at third_party/ut/CMakeLists.txt:12 (target_compile_options):
target_compile_options can not be used on an ALIAS target.
So I need to check how I added the aliases - to ensure that I use the same combination of target and alias names as the library I am mimicking.
from approvaltests.cpp.
@claremacrae See below for an example for Catch2. Be warned that I have not had a chance to test it yet.
add_library(catch INTERFACE) target_link_libraries(catch INTERFACE Catch2::Catch2) add_custom_command(TARGET catch POST_BUILD COMMAND ${CMAKE_EXECUTABLE} ARGS -E echo "ApprovalTests: CMake target 'catch' is deprecated and may be removed in the future. Please link to the target 'Catch2::Catch2' instead.")
Thanks @jwillikers
I tried that out and got:
CMake Error at third_party/catch2/CMakeLists.txt:13 (add_custom_command):
Target "catch" is an INTERFACE library that may not have PRE_BUILD,
PRE_LINK, or POST_BUILD commands.
from approvaltests.cpp.
@claremacrae Oops... that does make sense. My other thought was to compile in a header file with the catch
interface target that issued a compiler warning. I should be able to take a closer look at this soon.
from approvaltests.cpp.
Thanks!
from approvaltests.cpp.
@jwillikers on second thoughts, I'd quite like to separate out any warnings about using old target names to a separate ticket, if it's important to do, and to not include as part of this ticket...
That way, I can press on sooner with releasing recent improvements.
from approvaltests.cpp.
Remaining:
- Merge
third_party_targets_70
branch to master
from approvaltests.cpp.
@claremacrae 💡 Great idea!
from approvaltests.cpp.
Related Issues (20)
- Add a copyright statement to the released single header HOT 1
- GitHub Actions: Don't run scheduled tasks on forked repos
- Using kdiff3 as diff tool, user has to specify name of output file after merge
- cygwin CI build hangs for 6 hours then fails HOT 5
- warning C4459 in MSVC with /W4 HOT 1
- Does not compile with clang13 due to -Werror/-Wdeprecated-copy-with-dtor HOT 2
- Ninja + Catch2 + mingw64
- useApprovalsSubdirectory() doesn't create the output directory in the expected location HOT 3
- "Unable to create directory" - unable to run test build with mingw provided by qt-installer HOT 5
- with CppUTest: `ApprovalMismatchException` suppresses other tests output HOT 4
- add `code -d {Received} {Approved}` to Reporters list
- Catch2 integration does not handle Generators inside sections HOT 1
- Catch2 v3 integration HOT 5
- Bug with {fmt} integration HOT 2
- CLion reporter does not open correctly if CLion is already open
- In-lining test output (as opposed to saving in files) HOT 4
- Support for catch2 v3.x.x HOT 2
- Diffing tool is never prompted to open HOT 13
- Impossible to use UNC filename in TemplatedCustomNamer [`removeRedundantDirectorySeparators()` breaks use of UNC paths, which contain `\\`] HOT 5
- _mkdir fails when asked to create more than one directory HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from approvaltests.cpp.