-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for 2024 Actions and Dockerfile
- Loading branch information
Showing
7 changed files
with
47 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Build container image | ||
run: docker build -t gtest . | ||
- name: Test in container | ||
run: docker run -t gtest |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
FROM ubuntu:xenial | ||
MAINTAINER Kevin Buffardi ([email protected]) | ||
LABEL title="Unit Testing CPP" | ||
FROM ubuntu:latest | ||
LABEL title="CPP Container" | ||
LABEL version=0.1 | ||
ENV GTEST_REPO=/googletest | ||
ENV GTEST_DIR=${GTEST_REPO}/googletest | ||
ENV CXXFLAGS=-std=c++11 | ||
ENV WORKDIR=/usr/src | ||
WORKDIR /usr/src | ||
|
||
# Set Docker arguments | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive \ | ||
apt-get install -y \ | ||
build-essential \ | ||
g++ \ | ||
cmake \ | ||
git-all | ||
git-all \ | ||
dos2unix | ||
|
||
# Setup GoogleTest | ||
RUN git clone https://github.com/google/googletest ${GTEST_REPO} && \ | ||
mkdir ${GTEST_REPO}/build && \ | ||
cd ${GTEST_REPO}/build && \ | ||
cmake .. -DBUILD_GMOCK=OFF && \ | ||
make && \ | ||
make install && \ | ||
cd ${WORKDIR} | ||
RUN git clone --depth=1 https://github.com/google/googletest ${GTEST_REPO} | ||
RUN mkdir ${GTEST_REPO}/build && cd ${GTEST_REPO}/build \ | ||
&& cmake .. -DBUILD_GMOCK=OFF && make && cd ${WORKDIR} | ||
|
||
# Copy repo source into container | ||
COPY . ${WORKDIR} | ||
|
||
# Assure Unix linefeed for all files | ||
RUN find . -type f -print0 | xargs -0 dos2unix -- | ||
|
||
# Build and run tests | ||
CMD ["sh","-c","sed -i -e 's/\r$//' test_runner.sh; ${WORKDIR}/test_runner.sh; gcov -rbc *.cpp"] | ||
# Build project | ||
CMD sh -c ${WORKDIR}/test_runner.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
make clean | ||
make | ||
./PiezasTest | ||
gcov -rbc Piezas.cpp |