Skip to content

Commit 3819a65

Browse files
committed
Bring parallelism into tests
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
1 parent 78569ac commit 3819a65

File tree

3 files changed

+89
-17
lines changed

3 files changed

+89
-17
lines changed

.circleci/config.yml

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,99 @@ version: 2.1
33
orbs:
44
win: circleci/windows@5.0 # The Windows orb gives you everything you need to start using the
55

6+
commands:
7+
install_dependencies:
8+
parameters:
9+
compiler:
10+
default: ""
11+
type: string
12+
steps:
13+
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh <<parameters.compiler>>
14+
compile_tests:
15+
parameters:
16+
compiler:
17+
default: ""
18+
type: string
19+
steps:
20+
- run: chmod u+x compile_tests.sh && ./compile_tests.sh <<parameters.compiler>>
21+
run_tests:
22+
steps:
23+
- run: pytest erpcgen/test/
24+
- run: python3 test/run_unit_tests.py
25+
626
jobs:
727
build-linux-gcc:
828
machine:
929
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
1030
steps:
1131
- checkout
12-
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
13-
- run: chmod u+x run_tests.sh && ./run_tests.sh
32+
- install_dependencies
33+
- compile_tests
1434
- store_artifacts:
1535
path: ./Release/Linux/erpcgen/erpcgen
36+
test-linux-gcc:
37+
machine:
38+
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
39+
parallelism: 2
40+
steps:
41+
- checkout
42+
- run_tests
43+
1644
build-linux-clang:
1745
machine:
1846
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
1947
steps:
2048
- checkout
21-
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
22-
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
49+
- install_dependencies:
50+
compiler: "clang"
51+
- compile_tests:
52+
compiler: "clang"
2353
# - store_artifacts:
2454
# path: ./Release/Linux/erpcgen/erpcgen
55+
test-linux-clang:
56+
machine:
57+
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
58+
parallelism: 2
59+
steps:
60+
- checkout
61+
- run_tests
62+
2563
build-mac-gcc:
2664
macos:
2765
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
2866
resource_class: macos.x86.medium.gen2
2967
steps:
3068
- checkout
31-
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
32-
- run: chmod u+x run_tests.sh && ./run_tests.sh
69+
- install_dependencies
70+
- compile_tests
3371
- store_artifacts:
3472
path: ./Release/Darwin/erpcgen/erpcgen
73+
test-mac-gcc:
74+
macos:
75+
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
76+
parallelism: 2
77+
steps:
78+
- checkout
79+
- run_tests
80+
3581
build-mac-clang:
3682
macos:
3783
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
3884
resource_class: macos.x86.medium.gen2
3985
steps:
4086
- checkout
41-
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
42-
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
87+
- install_dependencies:
88+
compiler: "clang"
89+
- compile_tests:
90+
compiler: "clang"
91+
test-mac-clang:
92+
macos:
93+
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
94+
parallelism: 2
95+
steps:
96+
- checkout
97+
- run_tests
98+
4399
# - store_artifacts:
44100
# path: ./Release/Darwin/erpcgen/erpcgen
45101
build-windows-mingw:
@@ -70,8 +126,20 @@ workflows:
70126
build-workflow:
71127
jobs:
72128
- build-linux-gcc
129+
- test-linux-gcc:
130+
requires:
131+
- build-linux-gcc
73132
- build-linux-clang
133+
- test-linux-clang:
134+
requires:
135+
- build-linux-clang
74136
- build-mac-gcc
137+
- test-mac-gcc:
138+
requires:
139+
- build-mac-gcc
75140
- build-mac-clang
141+
- test-mac-clang:
142+
requires:
143+
- build-mac-clang
76144
- build-windows-mingw
77145
- build-windows-VS

compile_tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# exit when any command fails
4+
set -e
5+
6+
make clean
7+
if [ "$1" = "clang" ]; then
8+
echo "Compiling by clang compiler."
9+
CC=clang CXX=clang++ make all
10+
else
11+
echo "Compiling by default gnu compiler."
12+
CC=gcc CXX=g++ make all
13+
fi

run_tests.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@
33
# exit when any command fails
44
set -e
55

6-
make clean
7-
if [ "$1" = "clang" ]; then
8-
echo "Compiling by clang compiler."
9-
CC=clang CXX=clang++ make all
10-
else
11-
echo "Compiling by default gnu compiler."
12-
CC=gcc CXX=g++ make all
13-
fi
14-
156
pytest erpcgen/test/
167
python3 test/run_unit_tests.py

0 commit comments

Comments
 (0)