Commit eed4f53f0a25ae8318c2fea3d88c60882bf107fb
1 parent
6af9bb4d
Add PACKAGE_SOURCE definition that gives the directory where the configure scrip…
…t is run. This directory will be used in unit testing for building absolute path names.
Showing
5 changed files
with
10 additions
and
9 deletions
configure.ac
| ... | ... | @@ -60,6 +60,7 @@ else |
| 60 | 60 | gammalib_prefix=${prefix} |
| 61 | 61 | fi |
| 62 | 62 | AC_DEFINE_UNQUOTED([PACKAGE_PREFIX], "${gammalib_prefix}", [Location where library is installed]) |
| 63 | +AC_DEFINE_UNQUOTED([PACKAGE_SOURCE], "$(PWD)", [Location where source is installed]) | |
| 63 | 64 | |
| 64 | 65 | |
| 65 | 66 | ############################################################################# | ... | ... |
inst/com/test/test_COM.cpp
| ... | ... | @@ -38,8 +38,8 @@ |
| 38 | 38 | /* __ Globals ____________________________________________________________ */ |
| 39 | 39 | |
| 40 | 40 | /* __ Constants __________________________________________________________ */ |
| 41 | -const std::string datadir = "../inst/com/test/data"; | |
| 42 | -const std::string com_caldb = "../inst/com/caldb"; | |
| 41 | +const std::string datadir = PACKAGE_SOURCE"/inst/com/test/data"; | |
| 42 | +const std::string com_caldb = PACKAGE_SOURCE"/inst/com/caldb"; | |
| 43 | 43 | const std::string com_iaq = "u47569_iaq.fits"; // 1-3 MeV |
| 44 | 44 | const std::string com_dre = datadir+"/m50439_dre.fits"; // 1-3 MeV |
| 45 | 45 | const std::string com_drb = datadir+"/m34997_drg.fits"; | ... | ... |
inst/cta/test/test_CTA.cpp
| ... | ... | @@ -40,8 +40,8 @@ |
| 40 | 40 | /* __ Globals ____________________________________________________________ */ |
| 41 | 41 | |
| 42 | 42 | /* __ Constants __________________________________________________________ */ |
| 43 | -const std::string datadir = "../inst/cta/test/data"; | |
| 44 | -const std::string cta_caldb = "../inst/cta/caldb"; | |
| 43 | +const std::string datadir = PACKAGE_SOURCE"/inst/cta/test/data"; | |
| 44 | +const std::string cta_caldb = PACKAGE_SOURCE"/inst/cta/caldb"; | |
| 45 | 45 | const std::string cta_irf = "kb_E_50h_v3"; |
| 46 | 46 | const std::string cta_events = datadir+"/crab_events.fits.gz"; |
| 47 | 47 | const std::string cta_cntmap = datadir+"/crab_cntmap.fits.gz"; | ... | ... |
inst/lat/test/test_LAT.cpp
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | /** |
| 22 | 22 | * @file test_LAT.cpp |
| 23 | 23 | * @brief Testing of LAT classes |
| 24 | - * @author J. Knoedlseder | |
| 24 | + * @author Juergen Knoedlseder | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | /* __ Includes ___________________________________________________________ */ |
| ... | ... | @@ -40,9 +40,9 @@ |
| 40 | 40 | /* __ Globals ____________________________________________________________ */ |
| 41 | 41 | |
| 42 | 42 | /* __ Constants __________________________________________________________ */ |
| 43 | -const std::string lat_caldb = "../inst/lat/caldb"; | |
| 44 | -const std::string dirPass6 = "../inst/lat/test/data/p6v3"; | |
| 45 | -const std::string dirPass7 = "../inst/lat/test/data/p7v6"; | |
| 43 | +const std::string lat_caldb = PACKAGE_SOURCE"/inst/lat/caldb"; | |
| 44 | +const std::string dirPass6 = PACKAGE_SOURCE"/inst/lat/test/data/p6v3"; | |
| 45 | +const std::string dirPass7 = PACKAGE_SOURCE"/inst/lat/test/data/p7v6"; | |
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | /***********************************************************************//** | ... | ... |
inst/mwl/test/test_MWL.cpp
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | /* __ Globals ____________________________________________________________ */ |
| 39 | 39 | |
| 40 | 40 | /* __ Constants __________________________________________________________ */ |
| 41 | -const std::string datadir = "../inst/mwl/test/data"; | |
| 41 | +const std::string datadir = PACKAGE_SOURCE"/inst/mwl/test/data"; | |
| 42 | 42 | const std::string lat_crab_model = datadir+"/crab.xml"; |
| 43 | 43 | const std::string lat_crab_fits = datadir+"/crab.fits"; |
| 44 | 44 | const std::string crab_model = datadir+"/crab_mwl.xml"; | ... | ... |