Skip to content

Commit 33aa25a

Browse files
committed
Merge branch 'release/2.0.1'
2 parents 74cef3d + deb5050 commit 33aa25a

File tree

4 files changed

+64
-45
lines changed

4 files changed

+64
-45
lines changed

.travis.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
1+
dist: focal
12
language: c++
23
sudo: true
34
matrix:
45
include:
56
- os: linux
67
compiler: clang
78
env:
8-
- CONAN_ARGS="-s arch=x86_64 -s build_type=Release -s compiler=clang -s compiler.libcxx=libstdc++ -s compiler.version=3.5 --build"
9-
- CXX=clang++-3.5
10-
- CC=clang-3.5
9+
- CONAN_ARGS="-s arch=x86_64 -s build_type=Release -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=11 --build"
10+
- CXX=clang++-11
11+
- CC=clang-11
1112
- CMAKE_CXX_FLAGS="-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage"
1213
- CMAKE_EXE_LINKER_FLAGS="--coverage"
1314
addons:
1415
apt:
1516
sources:
16-
- ubuntu-toolchain-r-test
17-
- llvm-toolchain-precise-3.5
17+
- sourceline: 'ppa:ubuntu-toolchain-r/test'
18+
- sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main'
19+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
1820
packages:
19-
- g++-4.9
20-
- clang-3.5
21+
- clang-tools-11
22+
- clang-11
23+
- cmake
2124
- lcov
2225
- os: linux
2326
compiler: gcc
2427
env:
25-
- CONAN_ARGS="-s arch=x86_64 -s build_type=Release -s compiler=gcc -s compiler.libcxx=libstdc++ -s compiler.version=4.9 --build"
26-
- CXX=g++-4.9
27-
- CC=gcc-4.9
28+
- CONAN_ARGS="-s arch=x86_64 -s build_type=Release -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=10 --build"
29+
- CXX=g++-10
30+
- CC=gcc-10
2831
- CMAKE_CXX_FLAGS="-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage"
2932
- CMAKE_EXE_LINKER_FLAGS="-coverage -lgcov"
3033
addons:
3134
apt:
3235
sources:
33-
- ubuntu-toolchain-r-test
36+
- sourceline: 'ppa:ubuntu-toolchain-r/test'
3437
packages:
35-
- g++-4.9
38+
- g++-10
39+
- cmake
3640
- lcov
3741

3842
install:
39-
- "[ $CXX = g++ ] && export CXX=g++-4.9 || true"
40-
- "[ $CXX = clang++ ] && export CXX=clang++-3.5 || true"
43+
- "[ $CXX = g++ ] && export CXX=g++-10 || true"
44+
- "[ $CXX = clang++ ] && export CXX=clang++-11 || true"
4145

4246
before_script:
4347
- sudo pip install conan
@@ -53,7 +57,7 @@ script:
5357
5458
after_success:
5559
- |
56-
if [ "$CXX" = "g++-4.9" ]; then
60+
if [ "$CXX" = "g++-10" ]; then
5761
cd ${TRAVIS_BUILD_DIR}
5862
lcov --directory . --capture --output-file coverage.info # capture coverage info
5963
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,14 @@ This will create the following directory structure:
4747
```
4848
hackerrank-cpp
4949
|-- src
50-
| |-- CMakeLists.txt
50+
| |
5151
| +-- algorithms
52-
| |-- CMakeLists.txt
52+
| |
5353
| +-- implementation
54-
| |-- CMakeLists.txt
54+
| |
5555
| +-- diagonal_difference
5656
| |-- diagonal_difference.cpp
5757
| |-- diagonal_difference.h
58+
| |-- diagonal_difference_test.cpp
5859
| +-- CMakeLists.txt
59-
+-- test
60-
|-- CMakeLists.txt
61-
+-- algorithms
62-
|-- CMakeLists.txt
63-
+-- implementation
64-
|-- CMakeLists.txt
65-
+-- diagonal_difference
66-
|-- diagonal_difference_test.cpp
67-
+-- CMakeLists.txt
6860
```

appveyor.yml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
version: '{build}'
22

3-
os: Visual Studio 2015
3+
os: Visual Studio 2019
44

55
environment:
66
matrix:
7-
- compiler: msvc-14-seh
8-
generator: "Visual Studio 14 2015"
9-
conan_args: "-s arch=x86 -s build_type=Release -s compiler=\"Visual Studio\" -s compiler.version=14 --build"
10-
11-
- compiler: msvc-14-seh
12-
generator: "Visual Studio 14 2015 Win64"
13-
conan_args: "-s arch=x86_64 -s build_type=Release -s compiler=\"Visual Studio\" -s compiler.version=14 --build"
14-
15-
configuration:
16-
- Debug
17-
18-
build:
19-
verbosity: detailed
7+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
8+
compiler: msvc-15-seh
9+
generator: "Visual Studio 15 2017 Win64"
10+
platform: "x64"
11+
configuration: "Debug"
12+
build_system: cmake
13+
conan_args: "-s arch=x86_64 -s build_type=Debug -s compiler=\"Visual Studio\" -s compiler.version=15 --build"
14+
15+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
16+
compiler: msvc-15-seh
17+
generator: "Visual Studio 15 2017"
18+
platform: "Win32"
19+
configuration: "Debug"
20+
build_system: cmake
21+
conan_args: "-s arch=x86 -s build_type=Debug -s compiler=\"Visual Studio\" -s compiler.version=15 --build"
22+
23+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
24+
compiler: msvc-16-seh
25+
generator: "Visual Studio 16 2019"
26+
platform: "x64"
27+
configuration: "Debug"
28+
arch: "-A x64"
29+
build_system: cmake
30+
conan_args: "-s arch=x86_64 -s build_type=Debug -s compiler=\"Visual Studio\" -s compiler.version=16 --build"
31+
32+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
33+
compiler: msvc-16-seh
34+
generator: "Visual Studio 16 2019"
35+
platform: "Win32"
36+
configuration: "Debug"
37+
arch: "-A Win32"
38+
build_system: cmake
39+
conan_args: "-s arch=x86 -s build_type=Debug -s compiler=\"Visual Studio\" -s compiler.version=16 --build"
2040

2141
install:
2242
- cmd: |
@@ -32,10 +52,10 @@ build_script:
3252
cd build
3353
echo conan install ../conanfile.txt %conan_args%
3454
conan install ../conanfile.txt %conan_args%
35-
echo cmake -G "%generator%" -DUSE_CONAN_LIBS=true -DCMAKE_VERBOSE_MAKEFILE=true ..
36-
cmake -G "%generator%" -DUSE_CONAN_LIBS=true -DCMAKE_VERBOSE_MAKEFILE=true ..
37-
echo msbuild /m hackerrank.sln
38-
msbuild /m hackerrank.sln
55+
echo cmake -G "%generator%" %arch% -DUSE_CONAN_LIBS=true -DCMAKE_VERBOSE_MAKEFILE=true ..
56+
cmake -G "%generator%" %arch% -DUSE_CONAN_LIBS=true -DCMAKE_VERBOSE_MAKEFILE=true ..
57+
echo msbuild /m hackerrank.sln /p:Configuration=%configuration% /p:Platform=%platform%
58+
msbuild /m hackerrank.sln /p:Configuration=%configuration% /p:Platform=%platform%
3959
4060
test_script:
4161
- cmd: |

scripts/cmake/hackerrank_challenge.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ macro(hackerrank_challenge_test)
4646

4747
file(GLOB GTEST_BINARIES "${PROJECT_BINARY_DIR}/bin/gtest*")
4848
file(COPY ${GTEST_BINARIES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
49+
50+
file(GLOB GMOCK_BINARIES "${PROJECT_BINARY_DIR}/bin/gmock*")
51+
file(COPY ${GMOCK_BINARIES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
4952
endmacro()

0 commit comments

Comments
 (0)