Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #29 from lycantropos/readme
Browse files Browse the repository at this point in the history
README
  • Loading branch information
lycantropos committed Nov 18, 2017
2 parents ba71717 + 0a7ea94 commit b1c0b0e
Show file tree
Hide file tree
Showing 13 changed files with 480 additions and 58 deletions.
8 changes: 4 additions & 4 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ values =
beta

[bumpversion:file:CMakeLists.txt]
search = VERSION {current_version}
replace = {new_version}

[bumpversion:file:docker-compose.yml]
search = cauldron:{current_version}
replace = {new_version}

[bumpversion:file:Doxyfile]

[bumpversion:file:conanfile.py]
search = __version__ = {current_version}
replace = {new_version}

[bumpversion:file:docs/conf.py]

17 changes: 6 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.9)
project(cauldron
VERSION 0.0.0
DESCRIPTION "Property-based testing inspired by hypothesis")

option(TESTS "enables building tests script" OFF)

# add the project specific cmake modules directory to the cmake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")

string(CONCAT
Expand Down Expand Up @@ -33,28 +32,23 @@ set(HEADER_FILES
cauldron/vectors.h
cauldron/sets.h
cauldron/builder.h)

set(SOURCE_FILES
cauldron/booleans.cpp
cauldron/characters.cpp
cauldron/strings.cpp)

add_library(cauldron STATIC ${SOURCE_FILES})

set_target_properties(cauldron PROPERTIES VERSION ${PROJECT_VERSION})

install(TARGETS cauldron
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")

install(FILES ${HEADER_FILES}
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/cauldron")

if (TESTS)
include(CheckIncludeFileCXX)

check_include_file_cxx(catch.hpp HAVE_CATCH_HPP)
if (NOT HAVE_CATCH_HPP)
message(FATAL_ERROR "Catch header not found.")
endif ()

# include the cmake code coverage module
include(CodeCoverage)

string(CONCAT
Expand All @@ -72,6 +66,7 @@ if (TESTS)
tests/ordered_pair.h
tests/utils.h
tests/builder_tests/wrapper.h)

set(TESTS_SOURCE_FILES
tests/globals.cpp
tests/factories.cpp
Expand Down Expand Up @@ -105,10 +100,10 @@ if (TESTS)
tests/union_tests/fundamental/test_floats.cpp
tests/union_tests/fundamental/test_characters.cpp
tests/union_tests/compound/test_strings.cpp)

add_executable(main
${HEADER_FILES} ${SOURCE_FILES}
${TESTS_HEADER_FILES} ${TESTS_SOURCE_FILES})

# cmake code coverage module target
setup_target_for_coverage(${PROJECT_NAME}_coverage main coverage)
endif ()
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ ARG CMAKE_VERSION

FROM lycantropos/cmake:${CMAKE_VERSION}

ARG CATCH2_VERSION
ENV CATCH2_VERSION=${CATCH2_VERSION}
RUN wget -P /usr/local/include https://github.com/catchorg/Catch2/releases/download/v${CATCH2_VERSION}/catch.hpp

WORKDIR /opt/cauldron
ARG CATCH_VERSION
ENV CATCH_VERSION=${CATCH_VERSION}
RUN cd /usr/local/include && \
curl -LJO https://github.com/catchorg/Catch2/releases/download/v${CATCH_VERSION}/catch.hpp

RUN apt-get update && \
apt-get install -y lcov

WORKDIR /opt/cauldron

COPY CMakeModules ./CMakeModules/
COPY CMakeLists.txt .
COPY cauldron/ ./cauldron/
COPY tests/ ./tests/
COPY run-plain-tests.sh ./run-plain-tests.sh

WORKDIR build

RUN cmake -DTESTS=ON .. && \
make -j2 && \
make -j$(nproc --all) && \
make install

CMD ["./main"]
ENTRYPOINT ["/opt/cauldron/run-plain-tests.sh"]

0 comments on commit b1c0b0e

Please sign in to comment.