Skip to content

Commit

Permalink
🔧 Update conanfile definition to include tests
Browse files Browse the repository at this point in the history
The conanfile has been updated to include the unit tests in the build
process.
  • Loading branch information
bitwizeshift committed Nov 30, 2020
1 parent 4b09071 commit a5e7ea5
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ExpectedConan(ConanFile):
# Package Info
name = "Expected"
version = "0.0.1"
description = "Expect the unexpected"
description = " A lightweight C++11-compatible error-handling mechanism"
url = "https://github.com/bitwizeshift/Expected"
author = "Matthew Rodusek <[email protected]>"
license = "MIT"
Expand All @@ -17,7 +17,8 @@ class ExpectedConan(ConanFile):
exports_sources = ( "CMakeLists.txt",
"cmake/*",
"include/*",
"LICENSE" )
"test/*",
"LICENSE")

# Settings
options = {}
Expand All @@ -27,26 +28,18 @@ class ExpectedConan(ConanFile):
# Dependencies
build_requires = ("Catch2/2.7.1@catchorg/stable")


def configure_cmake(self):
def package(self):
cmake = CMake(self)

cmake.definitions["EXPECTED_COMPILE_UNIT_TESTS"] = "ON"
cmake.configure()
return cmake


def build(self):
cmake = self.configure_cmake()
# Compile and run the unit tests
cmake.build()
# cmake.test()
cmake.build(target="test")


def package(self):
cmake = self.configure_cmake()
cmake.install()

self.copy(pattern="LICENSE", dst="licenses")


def package_id(self):
self.info.header_only()

0 comments on commit a5e7ea5

Please sign in to comment.