Commit 0800d382c57ba0ba49a9b0929aa13a201af72246

Authored by Jürgen Knödlseder
1 parent 39757301

Add empty unit test scripts for all existing ctools.

This sets up the system completly. From then on, unit test can be implemented.
test/test_ctbin.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctbin tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctbin tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctbin")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctbin functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctbin functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctbin functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctcubemask.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctcubemask tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctcubemask tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctcubemask")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctcubemask functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctcubemask functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctcubemask functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctexpcube.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctexpcube tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctexpcube tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctexpcube")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctexpcube functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctexpcube functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctexpcube functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctlike.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctlike tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctlike tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctlike")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctlike functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctlike functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctlike functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctmodel.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctmodel tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctmodel tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctmodel")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctmodel functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctmodel functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctmodel functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctpsfcube.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctpsfcube tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctpsfcube tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctpsfcube")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctpsfcube functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctpsfcube functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctpsfcube functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctselect.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctselect tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctselect tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctselect")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctselect functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctselect functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctselect functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_ctskymap.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# This scripts performs unit tests for the ctskymap tool.
  4 +#
  5 +# Copyright (C) 2014 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 +import gammalib
  22 +import ctools
  23 +
  24 +
  25 +# ============================ #
  26 +# Test class for ctobssim tool #
  27 +# ============================ #
  28 +class Test(gammalib.GPythonTestSuite):
  29 + """
  30 + Test class for ctskymap tool.
  31 + """
  32 + # Constructor
  33 + def __init__(self):
  34 + """
  35 + Constructor.
  36 + """
  37 + # Call base class constructor
  38 + gammalib.GPythonTestSuite.__init__(self)
  39 +
  40 + # Set members
  41 +
  42 + # Return
  43 + return
  44 +
  45 + # Set test functions
  46 + def set(self):
  47 + """
  48 + Set all test functions.
  49 + """
  50 + # Set test name
  51 + self.name("ctskymap")
  52 +
  53 + # Append tests
  54 + self.append(self.test_functional, "Test ctskymap functionality")
  55 +
  56 + # Return
  57 + return
  58 +
  59 + # Test ctskymap functionnality
  60 + def test_functional(self):
  61 + """
  62 + Test ctskymap functionnality.
  63 + """
  64 + # Return
  65 + return
... ...
test/test_python.py
... ... @@ -23,6 +23,14 @@ import ctools
23 23 import sys
24 24 import os
25 25 import test_ctobssim
  26 +import test_ctselect
  27 +import test_ctbin
  28 +import test_ctlike
  29 +import test_ctmodel
  30 +import test_ctskymap
  31 +import test_ctcubemask
  32 +import test_ctexpcube
  33 +import test_ctpsfcube
26 34 import test_pipelines
27 35  
28 36  
... ... @@ -37,15 +45,39 @@ if __name__ == &#39;__main__&#39;:
37 45 suites = gammalib.GTestSuites("ctools unit testing")
38 46  
39 47 # Allocate test suites and append them to the container
40   - suite_ctobssim = test_ctobssim.Test()
41   - suite_pipelines = test_pipelines.Test()
  48 + suite_ctobssim = test_ctobssim.Test()
  49 + suite_ctselect = test_ctselect.Test()
  50 + suite_ctbin = test_ctbin.Test()
  51 + suite_ctlike = test_ctlike.Test()
  52 + suite_ctmodel = test_ctmodel.Test()
  53 + suite_ctskymap = test_ctskymap.Test()
  54 + suite_ctcubemask = test_ctcubemask.Test()
  55 + suite_ctexpcube = test_ctexpcube.Test()
  56 + suite_ctpsfcube = test_ctpsfcube.Test()
  57 + suite_pipelines = test_pipelines.Test()
42 58  
43 59 # Setup unit tests
44 60 suite_ctobssim.set()
  61 + suite_ctselect.set()
  62 + suite_ctbin.set()
  63 + suite_ctlike.set()
  64 + suite_ctmodel.set()
  65 + suite_ctskymap.set()
  66 + suite_ctcubemask.set()
  67 + suite_ctexpcube.set()
  68 + suite_ctpsfcube.set()
45 69 suite_pipelines.set()
46 70  
47 71 # Append tests to container
48 72 suites.append(suite_ctobssim)
  73 + suites.append(suite_ctselect)
  74 + suites.append(suite_ctbin)
  75 + suites.append(suite_ctlike)
  76 + suites.append(suite_ctmodel)
  77 + suites.append(suite_ctskymap)
  78 + suites.append(suite_ctcubemask)
  79 + suites.append(suite_ctexpcube)
  80 + suites.append(suite_ctpsfcube)
49 81 suites.append(suite_pipelines)
50 82  
51 83 # Set PFILES environment variable
... ...