-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (89 loc) · 3.09 KB
/
unit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Catch2
on: [push]
jobs:
platform-compatibility:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, ubuntu-22.04]
fail-fast: false
steps:
- name: Display Compiler Version
run: g++ --version
- name: Install MPFR
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -y
sudo apt-get install -y libmpfr-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew update
brew install mpfr
fi
- name: Checkout Repository
uses: actions/checkout@v3
- name: Execute Tests
run: make test
code-coverage:
runs-on: ubuntu-22.04
env:
working-directory: .test/unit
steps:
- name: Display Compiler Version
run: clang++ --version
- name: Install lcov
run: |
sudo apt-get update -y
sudo apt-get install -y lcov
- name: Install MPFR
run: sudo apt-get install -y libmpfr-dev
- name: Checkout Repository
uses: actions/checkout@v3
- name: Copy Library Directory
working-directory: ${{env.working-directory}}
run: cp -r ../../hypercomplex hypercomplex
- name: Compile Test Program
working-directory: ${{env.working-directory}}
run: g++ -DUSEMPFR=1 -O0 -fprofile-arcs -ftest-coverage -fno-elide-constructors -Wall --std=c++17 --coverage -o test test.cpp -lmpfr -lgmp
- name: Execute Test Program
working-directory: ${{env.working-directory}}
run: ./test [unit]
- name: Generate Coverage Report
working-directory: ${{env.working-directory}}
run: |
gcov test.cpp
lcov --capture --directory . --output-file coverage.info
rm -rf *.gcov test.gc*
- name: Submit Report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: .test/unit/coverage.info
fail_ci_if_error: true
verbose: true
memcheck:
runs-on: ubuntu-22.04
env:
working-directory: .test/unit
steps:
- name: Display Compiler Version
run: g++ --version
- name: Install MPFR
run: |
sudo apt-get update -y
sudo apt-get install -y libmpfr-dev
- name: Install Valgrind
run: sudo apt install -y valgrind
- name: Checkout Repository
uses: actions/checkout@v3
- name: Copy Library Directory
working-directory: ${{env.working-directory}}
run: cp -r ../../hypercomplex hypercomplex
- name: Compile Test Program
working-directory: ${{env.working-directory}}
run: g++ -DUSEMPFR=1 -O0 -Wall --std=c++17 -o test test.cpp -lmpfr -lgmp
- name: Analyze Test Program Exec
working-directory: ${{env.working-directory}}
run: |
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind.txt ./test [unit]
cat valgrind.txt
grep -q -w "All heap blocks were freed -- no leaks are possible" "valgrind.txt"