Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Ansgar Burchardt
dune-docker
Commits
cc96d9d3
Verified
Commit
cc96d9d3
authored
Jul 07, 2016
by
Ansgar Burchardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install duneci-ctest.
parent
2fb98d74
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
4 deletions
+108
-4
.gitignore
.gitignore
+1
-0
Makefile
Makefile
+5
-2
base-8/Dockerfile
base-8/Dockerfile
+3
-1
base-9/Dockerfile
base-9/Dockerfile
+3
-1
base-common/duneci-ctest
base-common/duneci-ctest
+96
-0
No files found.
.gitignore
View file @
cc96d9d3
/*-stamp
/base-?/duneci-ctest
Makefile
View file @
cc96d9d3
...
...
@@ -2,12 +2,15 @@ all: base-8-stamp base-9-stamp dune-2.3-stamp dune-2.4-stamp dune-fufem-stamp du
clean
:
rm
-f
--
./
*
-stamp
rm
-f
--
base-8/duneci-ctest base-9/duneci-ctest
base-8-stamp
:
base-8/Dockerfile
base-8-stamp
:
base-8/Dockerfile base-common/duneci-ctest
cp
base-common/duneci-ctest base-8/duneci-ctest
docker build
--no-cache
-t
duneci/base:8 base-8
touch
$@
base-9-stamp
:
base-9/Dockerfile
base-9-stamp
:
base-9/Dockerfile base-common/duneci-ctest
cp
base-common/duneci-ctest base-9/duneci-ctest
docker build
--no-cache
-t
duneci/base:9 base-9
touch
$@
...
...
base-8/Dockerfile
View file @
cc96d9d3
...
...
@@ -35,6 +35,8 @@ RUN apt-get update && apt-get dist-upgrade --no-install-recommends --yes \
RUN
adduser
--disabled-password
--home
/duneci duneci
USER
duneci
WORKDIR
/duneci
RUN
mkdir
-p
/duneci/modules
RUN
mkdir
-p
/duneci/bin
/duneci/modules
ENV
DUNE_CONTROL_PATH=.:/duneci/modules
ENV
PATH=/duneci/bin:$PATH
COPY
opts.clang opts.gcc /duneci/
COPY
duneci-ctest /duneci/bin/
base-9/Dockerfile
View file @
cc96d9d3
...
...
@@ -35,6 +35,8 @@ RUN apt-get update && apt-get dist-upgrade --no-install-recommends --yes \
RUN
adduser
--disabled-password
--home
/duneci duneci
USER
duneci
WORKDIR
/duneci
RUN
mkdir
-p
/duneci/modules
RUN
mkdir
-p
/duneci/bin
/duneci/modules
ENV
DUNE_CONTROL_PATH=.:/duneci/modules
ENV
PATH=/duneci/bin:$PATH
COPY
opts.clang opts.gcc /duneci/
COPY
duneci-ctest /duneci/bin/
base-common/duneci-ctest
0 → 100755
View file @
cc96d9d3
#! /usr/bin/env python3
# Wrapper around CTest for DUNE
# Author: Ansgar Burchardt <Ansgar.Burchardt@tu-dresden.de>
import
errno
import
glob
import
os.path
import
shutil
import
subprocess
import
sys
import
xml.etree.ElementTree
def
printTest
(
test
):
status
=
test
.
get
(
"Status"
)
name
=
test
.
find
(
"Name"
).
text
fullName
=
test
.
find
(
"FullName"
).
text
output
=
test
.
find
(
"Results"
).
find
(
"Measurement"
).
find
(
"Value"
).
text
print
(
"======================================================================"
)
print
(
"Name: {}"
.
format
(
name
))
print
(
"FullName: {}"
.
format
(
fullName
))
print
(
"Status: {}"
.
format
(
status
.
upper
()))
if
output
:
print
(
"Output:"
)
for
line
in
output
.
splitlines
():
print
(
" "
,
line
)
print
()
def
handleTest
(
test
):
status
=
test
.
get
(
"Status"
)
name
=
test
.
find
(
"Path"
).
text
if
status
==
"passed"
:
passed
=
True
elif
status
==
"notrun"
:
printTest
(
test
)
passed
=
True
else
:
printTest
(
test
)
passed
=
False
return
passed
def
findCTestOutput
():
files
=
glob
.
glob
(
"Testing/*/Test.xml"
)
if
len
(
files
)
!=
1
:
fn
=
files
.
join
(
", "
)
raise
Exception
(
"Found multiple CTest output files: {}"
.
format
(
files
.
join
(
", "
)))
return
files
[
0
]
def
handleCTestOutput
():
path
=
findCTestOutput
()
with
open
(
path
,
"r"
)
as
fh
:
tree
=
xml
.
etree
.
ElementTree
.
parse
(
fh
)
root
=
tree
.
getroot
()
testing
=
root
.
find
(
"Testing"
)
passed
=
True
for
test
in
testing
.
findall
(
"Test"
):
testPassed
=
handleTest
(
test
)
passed
=
passed
and
testPassed
return
passed
def
runCTest
(
argv
=
[]):
cmd
=
[
"ctest"
,
"--output-on-failure"
,
"--dashboard"
,
"ExperimentalTest"
,
"--no-compress-output"
,
]
cmd
.
extend
(
argv
)
subprocess
.
run
(
cmd
,
check
=
False
)
def
checkDirectory
():
if
not
os
.
path
.
exists
(
"CMakeCache.txt"
):
raise
Exception
(
"ERROR: dune-ctest must be run in a cmake build directory"
)
def
removeCTestOutput
():
try
:
shutil
.
rmtree
(
"Testing"
)
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
def
main
():
try
:
checkDirectory
()
removeCTestOutput
()
runCTest
(
argv
=
sys
.
argv
[
1
:])
passed
=
handleCTestOutput
()
status
=
0
if
passed
else
1
sys
.
exit
(
status
)
except
Exception
as
e
:
print
(
"Internal error: {}"
.
format
(
e
))
sys
.
exit
(
127
)
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment