diff --git a/test/README b/test/README deleted file mode 100644 index c7493dd..0000000 --- a/test/README +++ /dev/null @@ -1,21 +0,0 @@ -This folder contains files used for unit testing and files that serve -as example scripts for ctools. - -test_cscripts.sh - Unit test for cscripts. - -test_ctools.sh - Unit test for ctools. - -test_python.py - Unit test for ctools Python interface. - -example_models.py - Example Python pipeline for unbinned analysis that is executed - on a number of models (point source, disk source, Gaussian - source, Shell source). - -example_survey.py - This script illustrates how a survey can be simulated and analysed. - The script can be easily extended to adapt specific survey - strategies and simulated source models. diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..ca1a5ea --- /dev/null +++ b/test/README.md @@ -0,0 +1,6 @@ + +ctools unit test +================ + +This folder contains files used for ctools unit testing. +test_cscripts.sh diff --git a/test/data/obs_stacked.xml b/test/data/obs_stacked.xml index 151c335..c54bcea 100644 --- a/test/data/obs_stacked.xml +++ b/test/data/obs_stacked.xml @@ -1,9 +1,9 @@ - - - - + + + + diff --git a/test/data/obs_unbinned.xml b/test/data/obs_unbinned.xml index 4adfdbb..fe07707 100644 --- a/test/data/obs_unbinned.xml +++ b/test/data/obs_unbinned.xml @@ -1,7 +1,7 @@ - + diff --git a/test/test_cscaldb.py b/test/test_cscaldb.py index 83d8a43..f9dbed2 100755 --- a/test/test_cscaldb.py +++ b/test/test_cscaldb.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test cscaldb on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cscaldb = '../cscripts/cscaldb.py' else: cscaldb = 'cscaldb' diff --git a/test/test_csfindobs.py b/test/test_csfindobs.py index c9da2c5..775494c 100755 --- a/test/test_csfindobs.py +++ b/test/test_csfindobs.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csfindobs on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): csfindobs = '../cscripts/csfindobs.py' else: csfindobs = 'csfindobs' diff --git a/test/test_csiactcopy.py b/test/test_csiactcopy.py index ec80654..c969b84 100755 --- a/test/test_csiactcopy.py +++ b/test/test_csiactcopy.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csiactcopy on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csiactcopy = "../cscripts/csiactcopy.py" else: csiactcopy = "csiactcopy" diff --git a/test/test_csiactdata.py b/test/test_csiactdata.py index cb10874..14f6d2b 100755 --- a/test/test_csiactdata.py +++ b/test/test_csiactdata.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csiactdata on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csiactdata = "../cscripts/csiactdata.py" else: csiactdata = "csiactdata" diff --git a/test/test_csiactobs.py b/test/test_csiactobs.py index 06dfd4a..122d659 100755 --- a/test/test_csiactobs.py +++ b/test/test_csiactobs.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csiactobs on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csiactobs = "../cscripts/csiactobs.py" else: csiactobs = "csiactobs" diff --git a/test/test_cslightcrv.py b/test/test_cslightcrv.py index a8f8e9d..6f64efe 100755 --- a/test/test_cslightcrv.py +++ b/test/test_cslightcrv.py @@ -70,7 +70,7 @@ class Test(gammalib.GPythonTestSuite): Test cslightcrv on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cslightcrv = '../cscripts/cslightcrv.py' else: cslightcrv = 'cslightcrv' diff --git a/test/test_csmodelinfo.py b/test/test_csmodelinfo.py index bb1ec1f..79818a6 100755 --- a/test/test_csmodelinfo.py +++ b/test/test_csmodelinfo.py @@ -69,7 +69,7 @@ class Test(gammalib.GPythonTestSuite): Test csmodelinfo on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csmodelinfo = "../cscripts/csmodelinfo.py" else: csmodelinfo = "csmodelinfo" diff --git a/test/test_csmodelmerge.py b/test/test_csmodelmerge.py index c99b5a6..9d505f5 100755 --- a/test/test_csmodelmerge.py +++ b/test/test_csmodelmerge.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csmodelmerge on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csmodelmerge = "../cscripts/csmodelmerge.py" else: csmodelmerge = "csmodelmerge" diff --git a/test/test_csobs2caldb.py b/test/test_csobs2caldb.py index 3a807e4..b294c12 100755 --- a/test/test_csobs2caldb.py +++ b/test/test_csobs2caldb.py @@ -73,7 +73,7 @@ class Test(gammalib.GPythonTestSuite): Test csobs2caldb on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csobs2caldb = "../cscripts/csobs2caldb.py" else: csobs2caldb = "csobs2caldb" diff --git a/test/test_csobsdef.py b/test/test_csobsdef.py index 2d6f838..a2250c2 100755 --- a/test/test_csobsdef.py +++ b/test/test_csobsdef.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csobsdef on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): csobsdef = '../cscripts/csobsdef.py' else: csobsdef = 'csobsdef' diff --git a/test/test_csobsinfo.py b/test/test_csobsinfo.py index 2e151a9..ca3daf7 100755 --- a/test/test_csobsinfo.py +++ b/test/test_csobsinfo.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csobsinfo on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csobsinfo = "../cscripts/csobsinfo.py" else: csobsinfo = "csobsinfo" diff --git a/test/test_cspull.py b/test/test_cspull.py index d1de25a..8cca24a 100755 --- a/test/test_cspull.py +++ b/test/test_cspull.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test cspull on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): cspull = "../cscripts/cspull.py" else: cspull = "cspull" diff --git a/test/test_csresmap.py b/test/test_csresmap.py index 432e06a..5cec03f 100755 --- a/test/test_csresmap.py +++ b/test/test_csresmap.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csresmap on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): csresmap = '../cscripts/csresmap.py' else: csresmap = 'csresmap' diff --git a/test/test_csroot2caldb.py b/test/test_csroot2caldb.py index 004aae0..b0d4289 100644 --- a/test/test_csroot2caldb.py +++ b/test/test_csroot2caldb.py @@ -69,7 +69,7 @@ class Test(gammalib.GPythonTestSuite): Test csroot2caldb on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): csroot2caldb = "../cscripts/csroot2caldb.py" else: csroot2caldb = "csroot2caldb" diff --git a/test/test_cssens.py b/test/test_cssens.py index 370a33c..8f4e000 100755 --- a/test/test_cssens.py +++ b/test/test_cssens.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test cssens on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cssens = '../cscripts/cssens.py' else: cssens = 'cssens' diff --git a/test/test_csspec.py b/test/test_csspec.py index cc2a300..83a78fd 100755 --- a/test/test_csspec.py +++ b/test/test_csspec.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test csspec on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): csspec = '../cscripts/csspec.py' else: csspec = 'csspec' diff --git a/test/test_cstsdist.py b/test/test_cstsdist.py index 9162ba9..10ff345 100755 --- a/test/test_cstsdist.py +++ b/test/test_cstsdist.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test cstsdist on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cstsdist = '../cscripts/cstsdist.py' else: cstsdist = 'cstsdist' diff --git a/test/test_cstsmapmerge.py b/test/test_cstsmapmerge.py index e05752c..8be2a0c 100755 --- a/test/test_cstsmapmerge.py +++ b/test/test_cstsmapmerge.py @@ -66,7 +66,7 @@ class Test(gammalib.GPythonTestSuite): Test cstsmapmerge on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cstsmapmerge = '../cscripts/cstsmapmerge.py' else: cstsmapmerge = 'cstsmapmerge' diff --git a/test/test_csworkflow.py b/test/test_csworkflow.py index 1c78f8c..fda26ab 100755 --- a/test/test_csworkflow.py +++ b/test/test_csworkflow.py @@ -64,7 +64,7 @@ class Test(gammalib.GPythonTestSuite): def _test_cmd(self): # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): csworkflow = '../cscripts/csworkflow.py' else: csworkflow = 'csworkflow' diff --git a/test/test_ctbin.py b/test/test_ctbin.py index eab2c70..22bd625 100755 --- a/test/test_ctbin.py +++ b/test/test_ctbin.py @@ -69,7 +69,7 @@ class Test(gammalib.GPythonTestSuite): Test ctbin on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): ctbin = "../src/ctbin/ctbin" else: ctbin = "ctbin" diff --git a/test/test_ctbkgcube.py b/test/test_ctbkgcube.py index 86f8128..5ae5de0 100755 --- a/test/test_ctbkgcube.py +++ b/test/test_ctbkgcube.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctbkgcube on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctbkgcube = '../src/ctbkgcube/ctbkgcube' else: ctbkgcube = 'ctbkgcube' diff --git a/test/test_ctbutterfly.py b/test/test_ctbutterfly.py index d0ef5ae..6d018c4 100755 --- a/test/test_ctbutterfly.py +++ b/test/test_ctbutterfly.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctbutterfly on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctbutterfly = '../src/ctbutterfly/ctbutterfly' else: ctbutterfly = 'ctbutterfly' diff --git a/test/test_ctcubemask.py b/test/test_ctcubemask.py index e9a6e7e..6380f5a 100755 --- a/test/test_ctcubemask.py +++ b/test/test_ctcubemask.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctcubemask on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctcubemask = '../src/ctcubemask/ctcubemask' else: ctcubemask = 'ctcubemask' diff --git a/test/test_ctedispcube.py b/test/test_ctedispcube.py index 8b0dc3c..38d8ce5 100755 --- a/test/test_ctedispcube.py +++ b/test/test_ctedispcube.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctedispcube on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctedispcube = '../src/ctedispcube/ctedispcube' else: ctedispcube = 'ctedispcube' diff --git a/test/test_cterror.py b/test/test_cterror.py index 7693807..173efaa 100755 --- a/test/test_cterror.py +++ b/test/test_cterror.py @@ -69,7 +69,7 @@ class Test(gammalib.GPythonTestSuite): Test cterror on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cterror = '../src/cterror/cterror' else: cterror = 'cterror' diff --git a/test/test_ctexpcube.py b/test/test_ctexpcube.py index d9c02e1..2d8db47 100755 --- a/test/test_ctexpcube.py +++ b/test/test_ctexpcube.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctexpcube on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctexpcube = '../src/ctexpcube/ctexpcube' else: ctexpcube = 'ctexpcube' diff --git a/test/test_ctlike.py b/test/test_ctlike.py index df82b05..dfdff89 100755 --- a/test/test_ctlike.py +++ b/test/test_ctlike.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctlike on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctlike = '../src/ctlike/ctlike' else: ctlike = 'ctlike' diff --git a/test/test_ctmapcube.py b/test/test_ctmapcube.py index 852c0a7..e83dbe9 100644 --- a/test/test_ctmapcube.py +++ b/test/test_ctmapcube.py @@ -69,7 +69,7 @@ class Test(gammalib.GPythonTestSuite): Test ctmapcube on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): ctmapcube = "../src/ctmapcube/ctmapcube" else: ctmapcube = "ctmapcube" diff --git a/test/test_ctmodel.py b/test/test_ctmodel.py index 3bacae3..33c6475 100755 --- a/test/test_ctmodel.py +++ b/test/test_ctmodel.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctmodel on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctmodel = '../src/ctmodel/ctmodel' else: ctmodel = 'ctmodel' diff --git a/test/test_ctobssim.py b/test/test_ctobssim.py index 4413eee..ec65cf6 100755 --- a/test/test_ctobssim.py +++ b/test/test_ctobssim.py @@ -72,7 +72,7 @@ class Test(gammalib.GPythonTestSuite): Test ctobssim on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile("README"): + if os.path.isfile("README.md"): ctobssim = "../src/ctobssim/ctobssim" else: ctobssim = "ctobssim" diff --git a/test/test_ctpsfcube.py b/test/test_ctpsfcube.py index 626f33c..9fb5e79 100755 --- a/test/test_ctpsfcube.py +++ b/test/test_ctpsfcube.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctpsfcube on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctpsfcube = '../src/ctpsfcube/ctpsfcube' else: ctpsfcube = 'ctpsfcube' diff --git a/test/test_ctselect.py b/test/test_ctselect.py index 1ac97bd..1d2c386 100755 --- a/test/test_ctselect.py +++ b/test/test_ctselect.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctselect on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctselect = '../src/ctselect/ctselect' else: ctselect = 'ctselect' diff --git a/test/test_ctskymap.py b/test/test_ctskymap.py index 330bf44..fe2bc50 100755 --- a/test/test_ctskymap.py +++ b/test/test_ctskymap.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctskymap on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctskymap = '../src/ctskymap/ctskymap' else: ctskymap = 'ctskymap' diff --git a/test/test_cttsmap.py b/test/test_cttsmap.py index ef215d7..d068da2 100755 --- a/test/test_cttsmap.py +++ b/test/test_cttsmap.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test cttsmap on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): cttsmap = '../src/cttsmap/cttsmap' else: cttsmap = 'cttsmap' diff --git a/test/test_ctulimit.py b/test/test_ctulimit.py index 9cd8d31..139d75f 100755 --- a/test/test_ctulimit.py +++ b/test/test_ctulimit.py @@ -62,7 +62,7 @@ class Test(gammalib.GPythonTestSuite): Test ctulimit on the command line. """ # Kluge to set the command (installed version has no README file) - if os.path.isfile('README'): + if os.path.isfile('README.md'): ctulimit = '../src/ctulimit/ctulimit' else: ctulimit = 'ctulimit'