Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[boost] Fix test package on macOS when *:shared=True #16348

Merged
merged 6 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions recipes/boost/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)

include(CTest)
enable_testing()

if(BOOST_NAMESPACE)
Expand Down
9 changes: 3 additions & 6 deletions recipes/boost/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from conan.tools.build import can_run
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import chdir
from conan.tools.scm import Version


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
Expand Down Expand Up @@ -56,7 +54,6 @@ def build(self):
cmake.build()

def test(self):
if not can_run(self):
return
with chdir(self, self.folders.build_folder):
self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun")
if can_run(self):
cmake = CMake(self)
cmake.test()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bear in mind that one of the reasons we used ctest rather than cmake.test() is to ensure that in the event of the tools.build:skip_test config being abled, this test still runs unconditionally, as cmake.test() generally applies to library tests rather than executables in the test package