Skip to content

Commit

Permalink
Add unit test stage
Browse files Browse the repository at this point in the history
  • Loading branch information
ll-nick committed Oct 25, 2024
1 parent 73f816c commit f83fb54
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@ USER blinky

WORKDIR /home/blinky/

FROM base AS unittest

# Build unit tests
RUN mkdir /tmp/arbitration_graphs/build && \
cd /tmp/arbitration_graphs/build && \
cmake -DBUILD_TESTS=true .. && \
cmake --build .

# Run unit tests
# Return with non-zero exit code if a test fails
# See https://unix.stackexchange.com/a/392973 for reference
CMD find /tmp/arbitration_graphs/build -type f -executable -name '*-gtest-*' -exec \
sh -c 'for test; do echo "Running test: $test"; $test || exit 1; done' _ {} +

0 comments on commit f83fb54

Please sign in to comment.