Skip to content

Commit

Permalink
Merge pull request #30 from nemtrif/ci
Browse files Browse the repository at this point in the history
Continuous Integration
  • Loading branch information
nemtrif authored Apr 15, 2019
2 parents a0a2d9d + 335a3ee commit 7412592
Show file tree
Hide file tree
Showing 16 changed files with 569 additions and 376 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

jobs:
build:
docker:
- image: nemtrif/utf8cpp:3.0.1
steps:
- checkout
- run: git submodule update --init --recursive --remote
- run: mkdir build
- run: cd build && cmake ..
- run: cd build && cmake --build .
- run: cd build && ctest -VV
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "extern/gtest"]
path = extern/gtest
url = [email protected]:google/googletest.git
26 changes: 8 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required (VERSION 3.0.2)
project (utf8cpp VERSION 2.3.6 LANGUAGES CXX)
project (utf8cpp VERSION 3.0.2 LANGUAGES CXX)

option(UTF8_TESTS "Enable tests for UTF8-CPP" On)
option(UTF8_SAMPLES "Enable building samples for UTF8-CPP" On)

add_library(utf8cpp INTERFACE)
target_include_directories(utf8cpp INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>"
$<INSTALL_INTERFACE:include/utf8cpp>
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>"
$<INSTALL_INTERFACE:include/utf8cpp>
)
add_library(utf8::cpp ALIAS utf8cpp)

Expand All @@ -23,22 +23,12 @@ install(TARGETS utf8cpp EXPORT utf8cppConfig)
install(EXPORT utf8cppConfig DESTINATION ${DEF_INSTALL_CMAKE_DIR})

if(UTF8_SAMPLES)
add_executable(docsample ${PROJECT_SOURCE_DIR}/samples/docsample.cpp)

target_link_libraries(docsample PRIVATE utf8::cpp)
add_executable(docsample ${PROJECT_SOURCE_DIR}/samples/docsample.cpp)
target_link_libraries(docsample PRIVATE utf8::cpp)
endif()

if(UTF8_TESTS)
add_executable(smoke ${PROJECT_SOURCE_DIR}/test_drivers/smoke_test/test.cpp)
add_executable(cpp11 ${PROJECT_SOURCE_DIR}/test_drivers/smoke_test/cpp11.cpp)
add_executable(negative ${PROJECT_SOURCE_DIR}/test_drivers/negative/negative.cpp)

target_link_libraries(smoke PRIVATE utf8::cpp)
target_link_libraries(cpp11 PRIVATE utf8::cpp)
target_link_libraries(negative PRIVATE utf8::cpp)

enable_testing()
add_test(smoke_test smoke)
add_test(cpp11_test cpp11)
add_test(negative_test negative ${PROJECT_SOURCE_DIR}/test_data/negative/utf8_invalid.txt)
enable_testing()
add_subdirectory(extern/gtest)
add_subdirectory(tests)
endif()
1 change: 1 addition & 0 deletions extern/gtest
Submodule gtest added at 2fe3bd
1 change: 0 additions & 1 deletion source/utf8/cpp11.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ DEALINGS IN THE SOFTWARE.

#include "checked.h"
#include <string>
#include <cassert>

namespace utf8
{
Expand Down
78 changes: 0 additions & 78 deletions test_drivers/smoke_test/cpp11.cpp

This file was deleted.

Loading

0 comments on commit 7412592

Please sign in to comment.