Commit 2edd64663af7491c7b5765539ab8ef54aa45e206

Authored by Jürgen Knödlseder
1 parent e9cb5dd0

Add coverage possibility to test_examples.py script

.gitignore
... ... @@ -83,7 +83,7 @@ test/*.trs
83 83 test/*.txt
84 84 test/*.eps
85 85 test/test_cscripts.sh
86   -test/test_examples.sh
  86 +test/test_examples.py
87 87 test/reports/*.xml
88 88 test/butterfly.txt
89 89 test/.coverage
... ...
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  
... ...
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