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 #25 from lycantropos/remove-conan
Browse files Browse the repository at this point in the history
conan removal
  • Loading branch information
lycantropos committed Nov 9, 2017
2 parents 270e88c + d8894ea commit 57bd6a4
Show file tree
Hide file tree
Showing 41 changed files with 141 additions and 179 deletions.
2 changes: 2 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ values =
dev
beta

[bumpversion:file:CMakeLists.txt]

[bumpversion:file:docker-compose.yml]

[bumpversion:file:Doxyfile]
Expand Down
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ services:
- docker

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- lcov
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- docker-ce
- lcov

script:
- ./run-tests.sh
Expand Down
112 changes: 58 additions & 54 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.8)
project(cauldron)
project(cauldron
VERSION 0.0.0
DESCRIPTION "Property-based testing inspired by hypothesis")

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
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/")
Expand All @@ -11,8 +12,7 @@ include(CodeCoverage)

set(CMAKE_CXX_STANDARD 14)

SET(BASEPATH "${CMAKE_SOURCE_DIR}")
INCLUDE_DIRECTORIES("${BASEPATH}")
include_directories(${CMAKE_SOURCE_DIR})

string(CONCAT
CMAKE_CXX_FLAGS
Expand Down Expand Up @@ -45,54 +45,58 @@ set(SOURCE_FILES
cauldron/characters.cpp
cauldron/strings.cpp)

add_library(cauldron ${HEADER_FILES} ${SOURCE_FILES})
add_library(cauldron STATIC ${SOURCE_FILES})
set_target_properties(cauldron PROPERTIES VERSION ${PROJECT_VERSION})

set(TESTS_HEADER_FILES
tests/globals.h
tests/factories.h
tests/operators.h
tests/predicates.h
tests/statistics.h
tests/ordered_pair.h
tests/utils.h
tests/builder_tests/wrapper.h)
set(TESTS_SOURCE_FILES
tests/globals.cpp
tests/factories.cpp
tests/operators.cpp
tests/predicates.cpp
tests/utils.cpp
tests/main.cpp
tests/test_just.cpp
tests/test_booleans.cpp
tests/test_integers.cpp
tests/test_floats.cpp
tests/test_characters.cpp
tests/test_strings.cpp
tests/vectors_tests/fundamental/test_booleans.cpp
tests/vectors_tests/fundamental/test_integers.cpp
tests/vectors_tests/fundamental/test_floats.cpp
tests/vectors_tests/fundamental/test_characters.cpp
tests/vectors_tests/compound/test_strings.cpp
tests/sets_tests/fundamental/test_booleans.cpp
tests/sets_tests/fundamental/test_integers.cpp
tests/sets_tests/fundamental/test_floats.cpp
tests/sets_tests/fundamental/test_characters.cpp
tests/sets_tests/compound/test_strings.cpp
tests/builder_tests/fundamental/test_booleans.cpp
tests/builder_tests/fundamental/test_integers.cpp
tests/builder_tests/fundamental/test_floats.cpp
tests/builder_tests/fundamental/test_characters.cpp
tests/builder_tests/compound/test_strings.cpp
tests/union_tests/fundamental/test_booleans.cpp
tests/union_tests/fundamental/test_integers.cpp
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})
target_link_libraries(main ${CONAN_LIBS})
install(TARGETS cauldron
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")
install(FILES ${HEADER_FILES}
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/cauldron")

enable_testing()
add_test(NAME cauldron_tests COMMAND main)
if (TESTS)
set(TESTS_HEADER_FILES
tests/globals.h
tests/factories.h
tests/operators.h
tests/predicates.h
tests/statistics.h
tests/ordered_pair.h
tests/utils.h
tests/builder_tests/wrapper.h)
set(TESTS_SOURCE_FILES
tests/globals.cpp
tests/factories.cpp
tests/operators.cpp
tests/predicates.cpp
tests/utils.cpp
tests/main.cpp
tests/test_just.cpp
tests/test_booleans.cpp
tests/test_integers.cpp
tests/test_floats.cpp
tests/test_characters.cpp
tests/test_strings.cpp
tests/vectors_tests/fundamental/test_booleans.cpp
tests/vectors_tests/fundamental/test_integers.cpp
tests/vectors_tests/fundamental/test_floats.cpp
tests/vectors_tests/fundamental/test_characters.cpp
tests/vectors_tests/compound/test_strings.cpp
tests/sets_tests/fundamental/test_booleans.cpp
tests/sets_tests/fundamental/test_integers.cpp
tests/sets_tests/fundamental/test_floats.cpp
tests/sets_tests/fundamental/test_characters.cpp
tests/sets_tests/compound/test_strings.cpp
tests/builder_tests/fundamental/test_booleans.cpp
tests/builder_tests/fundamental/test_integers.cpp
tests/builder_tests/fundamental/test_floats.cpp
tests/builder_tests/fundamental/test_characters.cpp
tests/builder_tests/compound/test_strings.cpp
tests/union_tests/fundamental/test_booleans.cpp
tests/union_tests/fundamental/test_integers.cpp
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})
endif ()
24 changes: 9 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
FROM lycantropos/cmake:3.9.1
ARG CMAKE_VERSION

RUN apt-get update && \
apt-get install -y python-dev \
python-pip \
python-setuptools
FROM lycantropos/cmake:${CMAKE_VERSION}

RUN python -m pip install conan
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

COPY conanfile.txt .

RUN mkdir build && \
cd build && \
conan install ..

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

Expand All @@ -25,7 +18,8 @@ COPY tests/ ./tests/

WORKDIR build

RUN cmake .. && \
cmake --build . --target all -- -j 2
RUN cmake -DTESTS=ON .. && \
make -j2 && \
make install

CMD ["./bin/main"]
CMD ["./main"]
40 changes: 0 additions & 40 deletions conanfile.py

This file was deleted.

5 changes: 0 additions & 5 deletions conanfile.txt

This file was deleted.

7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ version: '3'

services:
cauldron:
build: .
build:
context: .
args:
CMAKE_VERSION: 3.9.5
CATCH2_VERSION: 2.0.1
image: lycantropos/cauldron:0.0.0
container_name: cauldron
entrypoint: /opt/cauldron/docker-entrypoint.sh
volumes:
- ./conanfile.txt:/opt/cauldron/conanfile.txt
- ./CMakeModules:/opt/cauldron/CMakeModules
- ./CMakeLists.txt:/opt/cauldron/CMakeLists.txt
- ./cauldron:/opt/cauldron/cauldron
Expand Down
11 changes: 5 additions & 6 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

set -ex

conan install ..
cmake ..
cmake --build . --target all -- -j 2
cmake -DTESTS=ON ..
make -j2
make install

./bin/main
./main

lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' \
'/opt/cauldron/tests/*' \
'/root/.conan/*' \
'*/tests/*' \
--output-file coverage.info
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

docker-compose up --exit-code-from cauldron
docker-compose up --build --exit-code-from cauldron

STATUS=$?

Expand Down
10 changes: 0 additions & 10 deletions test_package/CMakeLists.txt

This file was deleted.

25 changes: 0 additions & 25 deletions test_package/conanfile.py

This file was deleted.

12 changes: 0 additions & 12 deletions test_package/example.cpp

This file was deleted.

1 change: 1 addition & 0 deletions tests/builder_tests/compound/test_strings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cauldron/characters.h>
#include <cauldron/strings.h>
#include <cauldron/builder.h>

#include <tests/factories.h>
#include <tests/predicates.h>
#include <tests/operators.h>
Expand Down
1 change: 1 addition & 0 deletions tests/builder_tests/fundamental/test_booleans.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <catch.hpp>
#include <cauldron/booleans.h>
#include <cauldron/builder.h>

#include <tests/builder_tests/wrapper.h>


Expand Down
1 change: 1 addition & 0 deletions tests/builder_tests/fundamental/test_characters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <cauldron/just.h>
#include <cauldron/characters.h>
#include <cauldron/builder.h>

#include <tests/factories.h>
#include <tests/predicates.h>
#include <tests/operators.h>
Expand Down
1 change: 1 addition & 0 deletions tests/builder_tests/fundamental/test_floats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <cauldron/integers.h>
#include <cauldron/floats.h>
#include <cauldron/builder.h>

#include <tests/predicates.h>
#include <tests/operators.h>
#include <tests/ordered_pair.h>
Expand Down
1 change: 1 addition & 0 deletions tests/builder_tests/fundamental/test_integers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <cauldron/just.h>
#include <cauldron/integers.h>
#include <cauldron/builder.h>

#include <tests/factories.h>
#include <tests/predicates.h>
#include <tests/operators.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <catch.hpp>


int main(int argc, const char *argv[]) {
int main(int argc, char *argv[]) {
int result = Catch::Session().run(argc, argv);
return result;
}

0 comments on commit 57bd6a4

Please sign in to comment.