Commit e71941d0b2f22ac701208d6ad1ed39f776cd1fee
Merge branch 'devel' of https://cta-gitlab.irap.omp.eu/ctools/ctools into 1807-s…
…how_obs-example-script
Showing
7 changed files
with
14 additions
and
43 deletions
.gitignore
configure.ac
| ... | ... | @@ -1025,7 +1025,7 @@ AC_CONFIG_FILES([Makefile |
| 1025 | 1025 | test/test_cscripts.sh |
| 1026 | 1026 | test/test_python_ctools.sh |
| 1027 | 1027 | test/test_python_cscripts.sh |
| 1028 | - test/test_examples.sh | |
| 1028 | + test/test_examples.py | |
| 1029 | 1029 | pyext/Makefile |
| 1030 | 1030 | pyext/setup.py |
| 1031 | 1031 | pyext/ctools/__init__.py |
| ... | ... | @@ -1039,7 +1039,7 @@ AC_CONFIG_FILES([Makefile |
| 1039 | 1039 | [if test -f test/test_cscripts.sh; then chmod +x test/test_cscripts.sh; fi; |
| 1040 | 1040 | if test -f test/test_python_ctools.sh; then chmod +x test/test_python_ctools.sh; fi; |
| 1041 | 1041 | if test -f test/test_python_cscripts.sh; then chmod +x test/test_python_cscripts.sh; fi; |
| 1042 | - if test -f test/test_examples.sh; then chmod +x test/test_examples.sh; fi; | |
| 1042 | + if test -f test/test_examples.py; then chmod +x test/test_examples.py; fi; | |
| 1043 | 1043 | if test -f testconf.sh; then chmod +x testconf.sh; fi]) |
| 1044 | 1044 | AC_OUTPUT |
| 1045 | 1045 | ... | ... |
examples/generate_prod3_irfs.py
| ... | ... | @@ -69,31 +69,31 @@ if __name__ == '__main__': |
| 69 | 69 | for entry in entries: |
| 70 | 70 | |
| 71 | 71 | # Set optional attributes |
| 72 | - if entry.has_key('rebin'): | |
| 72 | + if 'rebin' in entry: | |
| 73 | 73 | rebin = entry['rebin'] |
| 74 | 74 | else: |
| 75 | 75 | rebin = False |
| 76 | - if entry.has_key('eascale'): | |
| 76 | + if 'eascale' in entry: | |
| 77 | 77 | eascale = entry['eascale'] |
| 78 | 78 | else: |
| 79 | 79 | eascale = 1.0 |
| 80 | - if entry.has_key('bgdscale'): | |
| 80 | + if 'bgdscale' in entry: | |
| 81 | 81 | bgdscale = entry['bgdscale'] |
| 82 | 82 | else: |
| 83 | 83 | bgdscale = 1.0 |
| 84 | - if entry.has_key('bgdethres'): | |
| 84 | + if 'bgdethres' in entry: | |
| 85 | 85 | bgdethres = entry['bgdethres'] |
| 86 | 86 | else: |
| 87 | 87 | bgdethres = 1000.0 |
| 88 | - if entry.has_key('bgdinfill'): | |
| 88 | + if 'bgdinfill' in entry: | |
| 89 | 89 | bgdinfill = entry['bgdinfill'] |
| 90 | 90 | else: |
| 91 | 91 | bgdinfill = False |
| 92 | - if entry.has_key('oversample'): | |
| 92 | + if 'oversample' in entry: | |
| 93 | 93 | oversample = entry['oversample'] |
| 94 | 94 | else: |
| 95 | 95 | oversample = 1 |
| 96 | - if entry.has_key('norm1d'): | |
| 96 | + if 'norm1d' in entry: | |
| 97 | 97 | norm1d = entry['norm1d'] |
| 98 | 98 | else: |
| 99 | 99 | norm1d = False | ... | ... |
sonar-project.properties
| ... | ... | @@ -15,17 +15,13 @@ sonar.links.scm=https://cta-gitlab.irap.omp.eu/ctools/ctools |
| 15 | 15 | # Path to source directories |
| 16 | 16 | sonar.sources=. |
| 17 | 17 | |
| 18 | -# Path to tests | |
| 19 | -#sonar.tests=test | |
| 20 | - | |
| 21 | 18 | # Path to include directories |
| 22 | 19 | sonar.cxx.includeDirectories=pyext,/home/jenkins/gcc/gcc492/include/c++/4.9.2,/home/jenkins/gcc/gcc492/include/c++/4.9.2/tr1,/home/jenkins/gcc/gcc492/include/c++/4.9.2/ext,/home/jenkins/gcc/gcc492/include/c++/4.9.2/x86_64-unknown-linux-gnu,/home/jenkins/gcc/gcc492/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include,/usr/include,/usr/include/bits,/usr/include/gnu,/usr/include/linux |
| 23 | 20 | sonar.cxx.missingIncludeWarnings=False |
| 24 | 21 | |
| 25 | 22 | # Exclusions |
| 26 | -sonar.exclusions=pyext/ctools/**,pyext/build/**,pyext/setup.py,doc/**,test/dev/** | |
| 27 | -sonar.coverage.exclusions=pyext/ctools/**,pyext/build/**,examples/**,doc/**,test/dev/** | |
| 28 | -#sonar.test.exclusions= | |
| 23 | +sonar.exclusions=cscripts/tests/**,pyext/build/**,pyext/ctools/*_wrap.cpp,pyext/ctools/tests/**,doc/**,test/dev/** | |
| 24 | +sonar.coverage.exclusions=test/science_verification.py,test/test_examples.py | |
| 29 | 25 | |
| 30 | 26 | # C++ configuration |
| 31 | 27 | sonar.cxx.cppcheck.reportPath=cppcheck-result.xml | ... | ... |
test/Makefile.am
| ... | ... | @@ -9,7 +9,7 @@ if WITH_PYTHON |
| 9 | 9 | TEST_CSCRIPTS = test_cscripts.sh |
| 10 | 10 | TEST_PYTHON_CTOOLS = test_python_ctools.sh |
| 11 | 11 | TEST_PYTHON_CSCRIPTS = test_python_cscripts.sh |
| 12 | - TEST_PYTHON_EXAMPLES = test_examples.sh | |
| 12 | + TEST_PYTHON_EXAMPLES = test_examples.py | |
| 13 | 13 | TEST_PYTHON_ENV = PYTHONPATH=$(top_builddir):$(top_builddir)/pyext:$(top_builddir)/pyext/build/ctools/ctools:$(pythondir):$(pyexecdir):$(PYTHONPATH) |
| 14 | 14 | endif |
| 15 | 15 | ... | ... |
test/test_examples.py renamed to test/test_examples.py.in
| ... | ... | @@ -58,7 +58,7 @@ class Test(gammalib.GPythonTestSuite): |
| 58 | 58 | String with name to be used for logging |
| 59 | 59 | """ |
| 60 | 60 | # Setup command |
| 61 | - cmd = '../examples/' + name + '.py' | |
| 61 | + cmd = '@PYTHON_COVERAGE@../examples/' + name + '.py' | |
| 62 | 62 | if len(args) > 0: |
| 63 | 63 | cmd += ' ' + args |
| 64 | 64 | ... | ... |
test/test_examples.sh.in deleted
| 1 | -#! /bin/sh | |
| 2 | -# ========================================================================== | |
| 3 | -# This script launches the examples unit tests | |
| 4 | -# | |
| 5 | -# Copyright (C) 2016 Juergen Knoedlseder | |
| 6 | -# | |
| 7 | -# This program is free software: you can redistribute it and/or modify | |
| 8 | -# it under the terms of the GNU General Public License as published by | |
| 9 | -# the Free Software Foundation, either version 3 of the License, or | |
| 10 | -# (at your option) any later version. | |
| 11 | -# | |
| 12 | -# This program is distributed in the hope that it will be useful, | |
| 13 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | -# GNU General Public License for more details. | |
| 16 | -# | |
| 17 | -# You should have received a copy of the GNU General Public License | |
| 18 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 19 | -# | |
| 20 | -# ========================================================================== | |
| 21 | - | |
| 22 | -# | |
| 23 | -# Run the examples test | |
| 24 | -# ===================== | |
| 25 | -@PYTHON_COVERAGE@./test_examples.py |