Cherry picked the changes for CTest for unit tests from the master
Fix fatal typo ignoring potential change in the content of maps

(cherry picked from commit 55576ee33351d4c98d92b05a62a0920596955d50)

This also happens coincidentally (!) to fix ROOT-6064.
Add mathcore/test directory for cmake/cdash
Copy the tar file HistFactoryTest in the build dir