Skip to content

Commit 70a01d5

Browse files
committed
ENH: Add Docker test configuration.
1 parent 43d5e91 commit 70a01d5

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

test/Docker/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM debian:8
2+
MAINTAINER Insight Software Consortium <[email protected]>
3+
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
curl \
7+
cmake \
8+
git \
9+
libexpat1-dev \
10+
libhdf5-dev \
11+
libjpeg-dev \
12+
libpng12-dev \
13+
libpython3-dev \
14+
libtiff5-dev \
15+
python \
16+
ninja-build \
17+
wget \
18+
vim \
19+
zlib1g-dev
20+
21+
RUN mkdir -p /usr/src/ITKMinimalPathExtraction-build
22+
WORKDIR /usr/src
23+
24+
# 2015-09-17
25+
ENV ITK_GIT_TAG af1a72fc24ad8e58be0e9af71d791043dcdbca1a
26+
RUN git clone git://itk.org/ITK.git && \
27+
cd ITK && \
28+
git checkout ${ITK_GIT_TAG} && \
29+
cd ../ && \
30+
mkdir ITK-build && \
31+
cd ITK-build && \
32+
cmake \
33+
-G Ninja \
34+
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
35+
-DBUILD_EXAMPLES:BOOL=OFF \
36+
-DBUILD_TESTING:BOOL=OFF \
37+
-DBUILD_SHARED_LIBS:BOOL=ON \
38+
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \
39+
-DITK_LEGACY_REMOVE:BOOL=ON \
40+
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \
41+
-DITK_USE_SYSTEM_LIBRARIES:BOOL=ON \
42+
-DModule_ITKOptimizers:BOOL=ON \
43+
-DModule_ITKPath:BOOL=ON \
44+
-DModule_ITKFastMarching:BOOL=ON \
45+
-DModule_ITKTestKernel:BOOL=ON \
46+
-DModule_ITKIOSpatialObjects:BOOL=ON \
47+
../ITK && \
48+
ninja && \
49+
find . -name '*.o' -delete
50+

test/Docker/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
script_dir="`cd $(dirname $0); pwd`"
4+
5+
docker build -t insighttoolkit/minimalpathextraction-test $script_dir

test/Docker/run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
script_dir="`cd $(dirname $0); pwd`"
4+
5+
docker run \
6+
--rm \
7+
-v $script_dir/../..:/usr/src/ITKMinimalPathExtraction \
8+
insighttoolkit/minimalpathextraction-test \
9+
/usr/src/ITKMinimalPathExtraction/test/Docker/test.sh

test/Docker/test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# This is a script to build the modules and run the test suite in the base
4+
# Docker container.
5+
6+
die() {
7+
echo "Error: $@" 1>&2
8+
exit 1;
9+
}
10+
11+
cd /usr/src/ITKMinimalPathExtraction-build || die "Could not cd into the build directory"
12+
13+
cmake \
14+
-G Ninja \
15+
-DITK_DIR:PATH=/usr/src/ITK-build \
16+
-DCMAKE_BUILD_TYPE:STRING=Release \
17+
/usr/src/ITKMinimalPathExtraction || die "CMake configuration failed"
18+
ctest -VV -D Experimental || die "ctest failed"

0 commit comments

Comments
 (0)