Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testing_example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
testing_example
Commits
0ee77a62
Commit
0ee77a62
authored
5 years ago
by
Sebastian Ohlmann
Browse files
Options
Downloads
Patches
Plain Diff
Add CI, including compiling gtest
parent
651d5ac6
No related branches found
No related tags found
1 merge request
!1
Add CI
Pipeline
#63106
passed
5 years ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+18
-0
18 additions, 0 deletions
.gitlab-ci.yml
Makefile
+10
-6
10 additions, 6 deletions
Makefile
get_gtest.sh
+11
-0
11 additions, 0 deletions
get_gtest.sh
with
39 additions
and
6 deletions
.gitlab-ci.yml
0 → 100644
+
18
−
0
View file @
0ee77a62
# use MPCDF module environment
image
:
gitlab-registry.mpcdf.mpg.de/mpcdf/module-image
default
:
before_script
:
-
module load cmake git
test-gcc9
:
script
:
-
module load gcc/9
-
CC=gcc CXX=g++ CXXFLAGS="-std=c++11" ./get_gtest.sh
-
make CC=gcc CXX=g++ CXXFLAGS="-std=c++11 -I$PWD/googletest/install/include" LDFLAGS="-L$PWD/googletest/install/lib64"
test-intel19
:
script
:
-
module load intel/19.0.4
-
CC=icc CXX=icpc CXXFLAGS="-std=c++11" ./get_gtest.sh
-
make CC=icc CXX=icpc CXXFLAGS="-std=c++11 -I$PWD/googletest/install/include" LDFLAGS="-L$PWD/googletest/install/lib64"
This diff is collapsed.
Click to expand it.
Makefile
+
10
−
6
View file @
0ee77a62
SRC
=
src/main.cpp
SRC
=
src/main.cpp
TESTS
=
tests
COV
=
coverage
COV
=
coverage
OUT_T
=
test_output
OUT_T
=
test_output
OUT_E
=
expected_output
OUT_E
=
expected_output
APP
=
program
APP
=
program
CXX
=
g++
CXX
=
g++
BROWSER
=
google-chrome
BROWSER
=
google-chrome
TESTS
=
tests
TEST_APP
=
runTests
TEST_SRC
=
$(
TESTS
)
/test_funcs.cpp
LDFLAGS_GTEST
=
-lgtest
-lpthread
# Default
# Default
all
:
distclean compile test
all
:
distclean compile test
# Compiling section
# Compiling section
compile
:
compile
:
$(
CXX
)
-o
$(
APP
)
$(
SRC
)
$(
CXX
)
$(
CXXFLAGS
)
-o
$(
APP
)
$(
SRC
)
compile_coverage
:
compile_coverage
:
$(
CXX
)
-o
$(
APP
)
--coverage
$(
SRC
)
$(
CXX
)
$(
CXXFLAGS
)
-o
$(
APP
)
--coverage
$(
SRC
)
# Testing section
# Testing section
test
:
simple_tests regression_test unit_tests
test
:
simple_tests regression_test unit_tests
...
@@ -31,8 +34,9 @@ regression_test:
...
@@ -31,8 +34,9 @@ regression_test:
diff
$(
OUT_T
)
$(
OUT_E
)
diff
$(
OUT_T
)
$(
OUT_E
)
unit_tests
:
unit_tests
:
cd
$(
TESTS
)
&&
cmake CMakeLists.txt
&&
make
$(
CXX
)
$(
CXXFLAGS
)
-o
test_funcs.o
-c
$(
TEST_SRC
)
./
$(
TESTS
)
/runTests
$(
CXX
)
$(
CXXFLAGS
)
test_funcs.o
-o
$(
TEST_APP
)
$(
LDFLAGS
)
$(
LDFLAGS_GTEST
)
./
$(
TEST_APP
)
# Coverage section
# Coverage section
coverage
:
clean clean_coverage compile_coverage simple_tests
coverage
:
clean clean_coverage compile_coverage simple_tests
...
@@ -50,7 +54,7 @@ clean:
...
@@ -50,7 +54,7 @@ clean:
rm
-f
$(
APP
)
rm
-f
$(
APP
)
clean_tests
:
clean_tests
:
rm
-rf
$(
TESTS
)
/CMakeFiles
$(
TESTS
)
/CMakeCache.txt
$(
TESTS
)
/cmake_install.cmake
$(
TESTS
)
/CMakeFiles
$(
TESTS
)
/runTests
$(
OUT_E
)
$(
OUT_T
)
rm
-rf
$(
TESTS
)
/CMakeFiles
$(
TESTS
)
/CMakeCache.txt
$(
TESTS
)
/cmake_install.cmake
$(
TESTS
)
/CMakeFiles
$(
TESTS
)
/runTests
$(
OUT_E
)
$(
OUT_T
)
$(
TEST_APP
)
*
.o
clean_coverage
:
clean_coverage
:
rm
-rf
*
.gcno
*
.gcda
$(
APP
)
.info
$(
COV
)
rm
-rf
*
.gcno
*
.gcda
$(
APP
)
.info
$(
COV
)
...
...
This diff is collapsed.
Click to expand it.
get_gtest.sh
0 → 100755
+
11
−
0
View file @
0ee77a62
#!/bin/bash
# already there
[[
-d
googletest
]]
&&
exit
0
# otherwise download and build
git clone https://github.com/google/googletest.git
mkdir
-p
googletest/build
cd
googletest/build
cmake ..
-DCMAKE_INSTALL_PREFIX
=
../install
make
&&
make
install
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment