Skip to content

Commit a5e17c9

Browse files
committed
Merge branch 'master' into release/1.Y
2 parents 3d092a6 + 46b346d commit a5e17c9

27 files changed

+3007
-1605
lines changed
File renamed without changes.
File renamed without changes.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*.app
2929

3030
# Build directories
31-
*build*
31+
*build*/
3232

3333
# Python stuff
3434
*.pyc

.gitlab-ci.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
before_script:
2-
- ls -la
3-
- apt-get update -y
4-
- apt-get install gcc g++ gfortran make cmake zlib1g-dev python-dateutil python-pyparsing python-numpy python-matplotlib python-pip python-setuptools python-dev -y
5-
gcc_debug:
6-
script:
7-
- "python setup.py --cxx=g++ --cc=gcc --fc=gfortran --type=debug"
8-
- cd build
9-
- make
10-
- ctest
11-
gcc_debug_nocxx11:
12-
script:
13-
- "python setup.py --cxx=g++ --cc=gcc --fc=gfortran --type=debug --cmake-options='-DENABLE_CXX11_SUPPORT=OFF'"
14-
- cd build
15-
- make
16-
- ctest
2+
- ls -la
3+
- apt-get update -y
4+
- apt-get install cmake zlib1g-dev libboost-all-dev python-dateutil python-pyparsing python-numpy python-matplotlib python-pip python-setuptools python-dev -y
5+
- python -V
6+
- cmake --version
7+
- g++ --version
8+
- gcc --version
9+
- gfortran --version
10+
11+
variables:
12+
CTEST_COMMAND: "ctest --parallel 2 --output-on-failure --verbose --dashboard Experimental --track GitLabCI"
13+
14+
gcc:
15+
image: gcc:5.4
16+
script:
17+
- python setup.py --cxx=g++ --cc=gcc --fc=gfortran --type=release
18+
- cd build
19+
- ../.scripts/ci_build.sh
20+
- python ../.scripts/ci_test.py ${CTEST_COMMAND}
21+
- python ../.scripts/ci_print_failing.py
22+
artifacts:
23+
paths:
24+
- build.log
25+
- full_ctest_output.dat

.gitlab/ISSUE_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
<!--- Use labels to help the developers -->
3+
<!--- Remove the unnecessary sections when filing -->
4+
5+
## Expected Behavior
6+
<!--- If you're describing a bug, tell us what should happen -->
7+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
8+
9+
## Current Behavior
10+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
11+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
12+
13+
## Possible Solution
14+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
15+
<!--- or ideas how to implement the addition or change -->
16+
17+
## Steps to Reproduce (for bugs)
18+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
19+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
20+
1.
21+
2.
22+
3.
23+
4.
24+
25+
## Context
26+
<!--- How has this issue affected you? What are you trying to accomplish? -->
27+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
28+
29+
## Your Environment
30+
<!--- Include as many relevant details about the environment you experienced the bug in -->
31+
* Version used:
32+
* Environment name and version (e.g. PHP 5.4 on nginx 1.9.1):
33+
* Server type and version:
34+
* Operating System and version:
35+
* Link to your project:

.gitlab/MERGE_REQUEST_TEMPLATE.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
<!--- Use labels to help the developers -->
3+
<!--- Remove the unnecessary sections when filing -->
4+
5+
## Description
6+
<!--- Describe your changes in detail -->
7+
8+
## Motivation and Context
9+
<!--- Why is this change required? What problem does it solve? -->
10+
<!--- If it fixes an open issue, please link to the issue here. -->
11+
12+
## How Has This Been Tested?
13+
<!--- Please describe in detail how you tested your changes. -->
14+
<!--- Include details of your testing environment, and the tests you ran to -->
15+
<!--- see how your change affects other areas of the code, etc. -->
16+
17+
## Screenshots (if appropriate):
18+
19+
## Todos
20+
<!--- Notable points that this PR has either accomplished or will accomplish. -->
21+
* **Developer Interest**
22+
<!--- Changes affecting developers -->
23+
- [ ] Feature1
24+
* **User-Facing for Release Notes**
25+
<!--- Changes affecting users -->
26+
- [ ] Feature2
27+
28+
## Types of changes
29+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
30+
- [ ] Bug fix (non-breaking change which fixes an issue)
31+
- [ ] New feature (non-breaking change which adds functionality)
32+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
33+
34+
## Questions
35+
<!--- Questions to the developers -->
36+
- [ ] Question1
37+
38+
## Status
39+
<!--- Check this box when ready to be merged -->
40+
- [ ] Ready to go
41+
42+

.scripts/ci_build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
# The return code will capture an error from ANY of the functions in the pipe
4+
set -o pipefail
5+
cmake --build . -- --jobs=2 VERBOSE=1 | tee build.log | grep "Building"
6+
RESULT=$?
7+
8+
if [ $RESULT -eq 0 ]; then
9+
echo build succeeded
10+
else
11+
echo build failed
12+
cat build.log
13+
exit 1
14+
fi

.scripts/ci_print_failing.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python
2+
import re
3+
import sys
4+
5+
badtests = []
6+
testfail = re.compile(r'^\s*(?P<num>\d+) - (?P<name>\w+(?:-\w+)*) \(Failed\)\s*$')
7+
8+
with open('full_ctest_output.dat', 'r') as outfile:
9+
ctestout = outfile.readlines()
10+
11+
ctest_exit_status = int(ctestout[0])
12+
if len(ctestout[1:]) == 0:
13+
sys.stdout.write('\n <<< All test cases have passed! >>>\n\n')
14+
else:
15+
sys.stdout.write('\n <<< Failing outputs follow. >>>\n\n')
16+
17+
for line in ctestout[1:]:
18+
linematch = testfail.match(line)
19+
if linematch:
20+
bad = linematch.group('name')
21+
sys.stdout.write('\n\n {} failed. Here is the output:\n'.format(bad))
22+
23+
badoutfile = 'tests/' + bad + '.log'
24+
25+
with open(badoutfile, 'r') as ofile:
26+
sys.stdout.write(ofile.read())
27+
28+
# <<< return ctest error code >>>
29+
sys.exit(ctest_exit_status)

.scripts/ci_test.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env python
2+
import sys
3+
import time
4+
import subprocess
5+
6+
def run_ctest(command):
7+
"""
8+
Execute CTest command
9+
"""
10+
return subprocess.Popen(command,
11+
bufsize=0,
12+
stdout=subprocess.PIPE,
13+
universal_newlines=True)
14+
15+
ctest_command = sys.argv[1:]
16+
print("CTest command \"{}\"".format(' '.join(ctest_command)))
17+
retcode = run_ctest(ctest_command)
18+
print_all = False
19+
ctestout = ''
20+
while True:
21+
data = retcode.stdout.readline()
22+
# print(data.split())
23+
if not data:
24+
break
25+
26+
if '% tests passed,' in data:
27+
print_all = True
28+
29+
sdata = data.split()
30+
test_line = ('Test' in sdata) and ('sec' in sdata)
31+
start_line = ('Start' in sdata)
32+
if test_line or start_line or print_all:
33+
sys.stdout.write(data) # screen
34+
#print sys.stdout.write(data)
35+
ctestout += data # string
36+
37+
while True:
38+
retcode.poll()
39+
exstat = retcode.returncode
40+
if exstat is not None:
41+
ctest_exit_status = exstat
42+
break
43+
time.sleep(0.1)
44+
45+
# <<< identify failed tests and cat their output >>>
46+
sys.stdout.write("""\n <<< CTest complete with status %d. >>>\n\n""" %
47+
(ctest_exit_status))
48+
49+
ctestout = str(ctest_exit_status) + "\n" + ctestout
50+
51+
with open('full_ctest_output.dat', 'w') as outfile:
52+
outfile.write(ctestout)

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,10 @@ before_script:
349349
- ${Fortran_COMPILER} --version
350350
- python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake' ${STATIC} ${COVERAGE}
351351
- cd build
352+
- ../.scripts/ci_build.sh
352353
script:
353-
- ctest --parallel 2 --output-on-failure --verbose --dashboard Experimental --track TravisCI
354+
- python ../.scripts/ci_test.py ctest --parallel 2 --output-on-failure --verbose --dashboard Experimental --track TravisCI
355+
- python ../.scripts/ci_print_failing.py
354356
after_success:
355357
- |
356358
if [[ "${COVERAGE}" = true ]]; then

0 commit comments

Comments
 (0)