Skip to content

Commit 527420d

Browse files
authored
Codacy (#16)
* add badge * only calculate coverage for gcc
1 parent 42c295a commit 527420d

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

.travis.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ matrix:
1818
- g++-8
1919
env:
2020
- MATRIX_EVAL="export CC=gcc-8; export CXX=g++-8;"
21+
after_success:
22+
# install lcov
23+
- wget https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-1.14.tar.gz
24+
- tar xvfz lcov-1.14.tar.gz;
25+
- sudo make install -C lcov-1.14
26+
- lcov --version
27+
# compile and run with coverage
28+
- cmake -H. -Bbuild/coverage -DCMAKE_BUILD_TYPE=Debug -DLARS_EVENT_ENABLE_TESTS=On -DENABLE_TEST_COVERAGE=On -DCMAKE_CXX_COMPILER=g++-8
29+
- cmake --build build/coverage
30+
- cmake --build build/coverage --target test
31+
# create coverage report
32+
- lcov --gcov-tool $(which gcov-8) --directory . --capture --no-external --exclude "*tests*" --exclude "*_deps*" --quiet --output-file coverage.info
33+
# output coverage
34+
- lcov --gcov-tool $(which gcov-8) --list coverage.info
35+
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
2136

2237
- os: linux
2338
compiler: clang
@@ -53,19 +68,3 @@ script:
5368
# examples
5469
- cmake -Hexamples -Bbuild/examples
5570
- cmake --build build/examples
56-
57-
after_success:
58-
# install lcov
59-
- wget https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-1.14.tar.gz
60-
- tar xvfz lcov-1.14.tar.gz;
61-
- sudo make install -C lcov-1.14
62-
- lcov --version
63-
# compile and run with coverage
64-
- cmake -H. -Bbuild/coverage -DCMAKE_BUILD_TYPE=Debug -DLARS_EVENT_ENABLE_TESTS=On -DENABLE_TEST_COVERAGE=On -DCMAKE_CXX_COMPILER=g++-8
65-
- cmake --build build/coverage
66-
- cmake --build build/coverage --target test
67-
# create coverage report
68-
- lcov --gcov-tool $(which gcov-8) --directory . --capture --no-external --exclude "*tests*" --exclude "*_deps*" --quiet --output-file coverage.info
69-
# output coverage
70-
- lcov --gcov-tool $(which gcov-8) --list coverage.info
71-
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
[![Build Status](https://travis-ci.com/TheLartians/Event.svg?branch=master)](https://travis-ci.com/TheLartians/Event)
22
[![codecov](https://codecov.io/gh/TheLartians/Event/branch/master/graph/badge.svg)](https://codecov.io/gh/TheLartians/Event)
3+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2db87434675a4e2d8d1e5f10cd5d2387)](https://app.codacy.com/app/TheLartians/Event?utm_source=github.com&utm_medium=referral&utm_content=TheLartians/Event&utm_campaign=Badge_Grade_Dashboard)
34

45
# lars::Event
56

67
A thread-safe event-listener template and observable value implementation for C++17.
78

8-
# Examples
9+
## Examples
910

1011
Full examples can be found in the [examples directory](https://github.com/TheLartians/Event/tree/master/examples).
1112

12-
## lars::Event
13+
### Using lars::Event
1314

1415
```c++
1516
lars::Event<float,float> onClick;
@@ -18,7 +19,7 @@ onClick.emit(0,0); // emits event to all observers
1819
observer.reset(); // removes observer from event
1920
```
2021
21-
## lars::ObservableValue
22+
### Using lars::ObservableValue
2223
2324
```c++
2425
lars::ObservableValue a = 1;
@@ -29,7 +30,7 @@ std::cout << "The result is " << *sum << std::endl; // -> the result is 3
2930
a.set(3); // -> The result changed to 5
3031
```
3132

32-
# Installation and usage
33+
## Installation and usage
3334

3435
With [CPM](https://github.com/TheLartians/CPM), lars::Event can be used in a CMake project simply by adding the following to the project's `CMakeLists.txt`.
3536

0 commit comments

Comments
 (0)