From 05a16eca88fc11db2f96a1a358cce25cd2049c99 Mon Sep 17 00:00:00 2001
From: mavogel <mavogel@cern.ch>
Date: Wed, 23 Aug 2023 13:02:18 +0200
Subject: [PATCH] Removed the installation of test files.

Any files that are only used for testing the COOL build,
are no longer installed alongside of it. Making the size of
a COOL installation quite a bit smaller.
---
 CMakeLists.txt                       |   3 -
 cmake/.internal/env_dump_build.txt   |  73 +++++++++---------
 cmake/.internal/env_dump_install.txt | 106 ---------------------------
 cmake/CORALConfigTests.cmake         |  10 +--
 overrideSetupCMake.sh                |   2 +-
 src/CoolTest/CMakeLists.txt          |   7 --
 src/PyCool/CMakeLists.txt            |  28 +++----
 src/PyCoolUtilities/CMakeLists.txt   |  25 ++++---
 8 files changed, 69 insertions(+), 185 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e51773e96..7a0a0995d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -200,9 +200,6 @@ file(COPY ${CMAKE_BINARY_DIR}/env DESTINATION ${CMAKE_BINARY_DIR}/TMP.install PA
 configure_file(cmake/run_nightly_tests_cmake.sh.in TMP.install/run_nightly_tests_cmake.sh @ONLY)
 execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/TMP.install/run_nightly_tests_cmake.sh)
 
-install(PROGRAMS ${CMAKE_BINARY_DIR}/TMP.install/cc-run ${CMAKE_BINARY_DIR}/TMP.install/cc-sh ${CMAKE_BINARY_DIR}/TMP.install/run_nightly_tests_cmake.sh DESTINATION .)
-install(DIRECTORY ${CMAKE_BINARY_DIR}/TMP.install/env DESTINATION . USE_SOURCE_PERMISSIONS PATTERN "*.pyc" EXCLUDE PATTERN "*.xenvc" EXCLUDE)
-
 # Workarounds for System Integrity Protection on MacOSX 10.11 (CORALCOOL-2884)
 IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
   add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/bash COMMAND ${CMAKE_COMMAND} -E copy /bin/bash ${CMAKE_BINARY_DIR}/bin/bash DEPENDS /bin/bash)
diff --git a/cmake/.internal/env_dump_build.txt b/cmake/.internal/env_dump_build.txt
index f7db4e043..f88a6c052 100644
--- a/cmake/.internal/env_dump_build.txt
+++ b/cmake/.internal/env_dump_build.txt
@@ -1,8 +1,11 @@
 === Dump BINARY_TAG
-x86_64-centos7-gcc7-opt
+x86_64-centos7-gcc11-dbg
 
 === Dump CC
-/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-90605/x86_64-centos7-gcc62-opt/bin/gcc
+/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-ad0f5/x86_64-centos7/bin/gcc
+
+=== Dump CLING_STANDARD_PCH
+none
 
 === Dump COOL_DISABLE_CORALCONNECTIONPOOLCLEANUP
 1
@@ -23,32 +26,33 @@ Error
 ALL_sqlite
 
 === Dump COOLSYS
-/home/cdelort/git/cool/build.x86_64-centos7-gcc7-opt
+/data/mavogel/git/cool/build.x86_64-centos7-gcc11-dbg
 
 === Dump CORAL_SQLITE_TEMP_STORE_MEMORY
 1
 
 === Dump CORALSYS
-/home/cdelort/git/coral/${BINARY_TAG}
+/data/mavogel/git/coral/${BINARY_TAG}
 
 === Dump CXX
-/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-90605/x86_64-centos7-gcc62-opt/bin/g++
+/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-ad0f5/x86_64-centos7/bin/g++
 
 === Dump FRONTIER_FORCERELOAD
 short
 
 === Dump LCG_releases_base
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}
 
 === Dump LD_LIBRARY_PATH
-/home/cdelort/git/cool/build.${BINARY_TAG}/lib
-/home/cdelort/git/coral/${BINARY_TAG}/lib
-/home/cdelort/git/cool/build.${BINARY_TAG}/examples/lib
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib
-/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-90605/x86_64-centos7-gcc62-opt/lib64
+/data/mavogel/git/cool/build.${BINARY_TAG}/lib
+/data/mavogel/git/coral/${BINARY_TAG}/lib
+/data/mavogel/git/cool/build.${BINARY_TAG}/examples/lib
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/lib
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/lib64
+/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-ad0f5/x86_64-centos7/lib64
 
 === Dump MANPATH
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/man
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/man
 /usr/share/man
 /usr/local/share/man
 
@@ -59,47 +63,48 @@ american_america.WE8ISO8859P1
 EXTENDED
 
 === Dump PATH
-/home/cdelort/git/cool/build.${BINARY_TAG}/bin
-/home/cdelort/git/cool/build.${BINARY_TAG}/tests/bin
-/home/cdelort/git/cool/build.${BINARY_TAG}/examples/bin
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/bin
-/home/cdelort/git/coral/${BINARY_TAG}/bin
-/cvmfs/sft.cern.ch/lcg/releases/CMake/3.11.1-daf3a/${BINARY_TAG}/bin
+/data/mavogel/git/cool/build.${BINARY_TAG}/bin
+/data/mavogel/git/cool/build.${BINARY_TAG}/tests/bin
+/data/mavogel/git/cool/build.${BINARY_TAG}/examples/bin
+/data/mavogel/git/cool/build.${BINARY_TAG}/CoolTest/bin
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/bin
+/data/mavogel/git/coral/${BINARY_TAG}/bin
+/cvmfs/sft.cern.ch/lcg/releases/CMake/3.26.2-0664a/${BINARY_TAG}/bin
 /usr/local/bin
 /usr/bin
 /bin
 
 === Dump PWD
-/home/cdelort/git/cool/cmake/.internal
+/data/mavogel/git/cool/cmake/.internal
 
 === Dump PYTHONPATH
-/home/cdelort/git/cool/build.${BINARY_TAG}/python
-/home/cdelort/git/cool/build.${BINARY_TAG}/lib
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib/python2.7/site-packages
-/home/cdelort/git/coral/${BINARY_TAG}/lib
-/home/cdelort/git/coral/${BINARY_TAG}/python
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib
+/data/mavogel/git/cool/build.${BINARY_TAG}/python
+/data/mavogel/git/cool/build.${BINARY_TAG}/lib
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/lib/python3.9/site-packages
+/data/mavogel/git/coral/${BINARY_TAG}/lib
+/data/mavogel/git/coral/${BINARY_TAG}/python
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/lib
 
 === Dump QMTEST_CLASS_PATH
-/home/cdelort/git/cool/build.${BINARY_TAG}/CoolTest/qmtest
+/data/mavogel/git/cool/build.${BINARY_TAG}/CoolTest/qmtest
 
 === Dump QT_QPA_PLATFORM_PLUGIN_PATH
-/cvmfs/sft.cern.ch/lcg/releases/qt5/5.11.1-0d217/${BINARY_TAG}/plugins
+/cvmfs/sft.cern.ch/lcg/releases/qt5/5.15.9-97789/${BINARY_TAG}/plugins
 
 === Dump ROOT_INCLUDE_PATH
-/home/cdelort/git/cool/build.${BINARY_TAG}/include
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/include
-/home/cdelort/git/coral/${BINARY_TAG}/include
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/include/python2.7
+/data/mavogel/git/cool/build.${BINARY_TAG}/include
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/include
+/data/mavogel/git/coral/${BINARY_TAG}/include
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/include/python3.9
 
 === Dump ROOTSYS
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}
 
 === Dump TNS_ADMIN
-/afs/cern.ch/sw/lcg/app/releases/CORAL/internal/oracle/admin
+/eos/project-o/oracle/public/admin
 
 === Dump VALGRIND_LIB
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib/valgrind
+/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/${BINARY_TAG}/lib/valgrind
 
 === Dump VERBOSE
 1
diff --git a/cmake/.internal/env_dump_install.txt b/cmake/.internal/env_dump_install.txt
index 1cc7984b2..e69de29bb 100644
--- a/cmake/.internal/env_dump_install.txt
+++ b/cmake/.internal/env_dump_install.txt
@@ -1,106 +0,0 @@
-=== Dump BINARY_TAG
-x86_64-centos7-gcc7-opt
-
-=== Dump CC
-/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-90605/x86_64-centos7-gcc62-opt/bin/gcc
-
-=== Dump COOL_DISABLE_CORALCONNECTIONPOOLCLEANUP
-1
-
-=== Dump COOL_ENABLE_COOLMSGREPORTER
-1
-
-=== Dump COOL_MSGLEVEL
-Error
-
-=== Dump COOL_MVINSERTION_PREFETCH_MAXROWS
-1000
-
-=== Dump COOL_PYCOOLTEST_SKIP_ROOT8458
-1
-
-=== Dump COOL_QMTEST_TARGET
-ALL_sqlite
-
-=== Dump COOLSYS
-/home/cdelort/git/cool/${BINARY_TAG}
-
-=== Dump CORAL_SQLITE_TEMP_STORE_MEMORY
-1
-
-=== Dump CORALSYS
-/home/cdelort/git/coral/${BINARY_TAG}
-
-=== Dump CXX
-/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-90605/x86_64-centos7-gcc62-opt/bin/g++
-
-=== Dump FRONTIER_FORCERELOAD
-short
-
-=== Dump LCG_releases_base
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}
-
-=== Dump LD_LIBRARY_PATH
-/home/cdelort/git/cool/${BINARY_TAG}/lib
-/home/cdelort/git/coral/${BINARY_TAG}/lib
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib
-/home/cdelort/git/cool/${BINARY_TAG}/examples/lib
-/cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-90605/x86_64-centos7-gcc62-opt/lib64
-
-=== Dump MANPATH
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/man
-/usr/share/man
-/usr/local/share/man
-
-=== Dump NLS_LANG
-american_america.WE8ISO8859P1
-
-=== Dump ORA_FPU_PRECISION
-EXTENDED
-
-=== Dump PATH
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/bin
-/home/cdelort/git/coral/${BINARY_TAG}/bin
-/home/cdelort/git/cool/${BINARY_TAG}/bin
-/home/cdelort/git/cool/${BINARY_TAG}/tests/bin
-/home/cdelort/git/cool/${BINARY_TAG}/examples/bin
-/cvmfs/sft.cern.ch/lcg/releases/CMake/3.11.1-daf3a/${BINARY_TAG}/bin
-/usr/local/bin
-/usr/bin
-/bin
-
-=== Dump PWD
-/home/cdelort/git/cool/cmake/.internal
-
-=== Dump PYTHONPATH
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib/python2.7/site-packages
-/home/cdelort/git/coral/${BINARY_TAG}/lib
-/home/cdelort/git/coral/${BINARY_TAG}/python
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib
-/home/cdelort/git/cool/${BINARY_TAG}/python
-/home/cdelort/git/cool/${BINARY_TAG}/lib
-
-=== Dump QMTEST_CLASS_PATH
-/home/cdelort/git/cool/${BINARY_TAG}/CoolTest/qmtest
-
-=== Dump QT_QPA_PLATFORM_PLUGIN_PATH
-/cvmfs/sft.cern.ch/lcg/releases/qt5/5.11.1-0d217/${BINARY_TAG}/plugins
-
-=== Dump ROOT_INCLUDE_PATH
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/include
-/home/cdelort/git/coral/${BINARY_TAG}/include
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/include/python2.7
-/home/cdelort/git/cool/${BINARY_TAG}/include
-
-=== Dump ROOTSYS
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}
-
-=== Dump TNS_ADMIN
-/afs/cern.ch/sw/lcg/app/releases/CORAL/internal/oracle/admin
-
-=== Dump VALGRIND_LIB
-/cvmfs/sft.cern.ch/lcg/views/LCG_94/${BINARY_TAG}/lib/valgrind
-
-=== Dump VERBOSE
-1
-
diff --git a/cmake/CORALConfigTests.cmake b/cmake/CORALConfigTests.cmake
index 214ebb47e..f01a42ff0 100644
--- a/cmake/CORALConfigTests.cmake
+++ b/cmake/CORALConfigTests.cmake
@@ -22,20 +22,14 @@ function(coral_add_unit_test name)
   set_target_properties(${bin_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/bin)
   target_link_libraries(${bin_name} ${ARG_LIBS} ${CPPUNIT_LIBRARIES})
   add_dependencies(POST_BUILD_BANNER ${bin_name})
-  # FIXME: these will be enabled later on
-  #add_test(NAME ${test_name}
-  #         COMMAND ${env_cmd} ${bin_name}
-  #         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/${name})
-  # Install the test executables
-  install(TARGETS ${bin_name} DESTINATION tests/bin)
 endfunction()
 
 # Copy and install python tests into the build and install areas
 include(CORALConfigScripts)
 macro(copy_and_install_python_test _name)
   if (LCG_python3 STREQUAL on) # CORALCOOL-2976
-    copy_and_install_program(${_name} tests_python3 tests/bin tests/bin)
+    copy_to_build(${_name} tests_python3 tests/bin)
   else()
-    copy_and_install_program(${_name} tests tests/bin tests/bin)
+    copy_to_build(${_name} tests tests/bin)
   endif()
 endmacro()
diff --git a/overrideSetupCMake.sh b/overrideSetupCMake.sh
index 98620fcb7..34fbab948 100644
--- a/overrideSetupCMake.sh
+++ b/overrideSetupCMake.sh
@@ -1,4 +1,4 @@
-CORAL_base=
+CORAL_base=../coral
 if [ "$USER" == "gitlab-runner" ]; then
   CORAL_base=./coral
 elif [ "$USER" == "cdelort" ]; then
diff --git a/src/CoolTest/CMakeLists.txt b/src/CoolTest/CMakeLists.txt
index f0d5c77c0..8a9dd9876 100644
--- a/src/CoolTest/CMakeLists.txt
+++ b/src/CoolTest/CMakeLists.txt
@@ -1,18 +1,11 @@
 configure_file(qmtest/qmtestRun.sh.in ${CMAKE_BINARY_DIR}/qmtestRun.sh @ONLY)
 execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/qmtestRun.sh)
-install(PROGRAMS ${CMAKE_BINARY_DIR}/qmtestRun.sh DESTINATION .)
 
 include(CORALConfigScripts)
 file(GLOB _files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/qmtest qmtest/QMTest/configuration qmtest/*.qms qmtest/*.qmt qmtest/*/*.qmt qmtest/*/*.qms qmtest/*/*/*.qmt qmtest/*/*/*.qms qmtest/*/*/*/*.qmt qmtest/*.qmc qmtest/COOLTests.py qmtest/text_result_stream.py qmtest/sedValgrindLog.sh)
 foreach(_file ${_files})
   if(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/qmtest/${_file})
     copy_to_build(${_file} qmtest CoolTest/qmtest)
-    get_filename_component(_dstdir CoolTest/qmtest/${_file} PATH)
-    if(${_file} MATCHES ".sh")
-      install(PROGRAMS ${CMAKE_BINARY_DIR}/CoolTest/qmtest/${_file} DESTINATION ${_dstdir})
-    else()
-      install(FILES ${CMAKE_BINARY_DIR}/CoolTest/qmtest/${_file} DESTINATION ${_dstdir})
-    endif()
   endif()
 endforeach(_file)
 
diff --git a/src/PyCool/CMakeLists.txt b/src/PyCool/CMakeLists.txt
index 902661949..eb7174c18 100644
--- a/src/PyCool/CMakeLists.txt
+++ b/src/PyCool/CMakeLists.txt
@@ -20,20 +20,20 @@ coral_install_python_modules()
 
 # Copy and install python tests into the build and install areas
 include(CORALConfigScripts)
-copy_and_install_python_test(test_ChannelSelection.py)
-copy_and_install_python_test(test_Channels.py)
-copy_and_install_python_test(test_CoolFunctionality.py)
-copy_and_install_python_test(test_coolBlob.py)
-copy_and_install_python_test(test_coralAttributeList.py)
-copy_and_install_python_test(test_coralBlob.py)
-copy_and_install_python_test(test_FolderSpecification.py)
-copy_and_install_python_test(test_IDatabase.py)
-copy_and_install_python_test(test_IDatabaseSvc.py)
-copy_and_install_python_test(test_IFolder.py)
-copy_and_install_python_test(test_IFolderSet.py)
-copy_and_install_python_test(test_IObjectIterator.py)
-copy_and_install_python_test(test_IObject.py)
-copy_and_install_python_test(test_RecordSpecification.py)
+copy_to_build(test_ChannelSelection.py tests tests/bin)
+copy_to_build(test_Channels.py tests tests/bin)
+copy_to_build(test_CoolFunctionality.py tests tests/bin)
+copy_to_build(test_coolBlob.py tests tests/bin)
+copy_to_build(test_coralAttributeList.py tests tests/bin)
+copy_to_build(test_coralBlob.py tests tests/bin)
+copy_to_build(test_FolderSpecification.py tests tests/bin)
+copy_to_build(test_IDatabase.py tests tests/bin)
+copy_to_build(test_IDatabaseSvc.py tests tests/bin)
+copy_to_build(test_IFolder.py tests tests/bin)
+copy_to_build(test_IFolderSet.py tests tests/bin)
+copy_to_build(test_IObjectIterator.py tests tests/bin)
+copy_to_build(test_IObject.py tests tests/bin)
+copy_to_build(test_RecordSpecification.py tests tests/bin)
 
 # Set ROOT environment variables (from cmake variables set in FindROOT.cmake)
 if (ROOT_FOUND)
diff --git a/src/PyCoolUtilities/CMakeLists.txt b/src/PyCoolUtilities/CMakeLists.txt
index 8f86bf62f..f357fff9e 100644
--- a/src/PyCoolUtilities/CMakeLists.txt
+++ b/src/PyCoolUtilities/CMakeLists.txt
@@ -4,15 +4,16 @@ coral_install_python_modules()
 
 # Copy and install python tests into the build and install areas
 include(CORALConfigScripts)
-copy_and_install_python_test(test_PyCoolConsole.py)
-copy_and_install_python_test(test_PyCoolCopy.py)
-copy_and_install_python_test(test_PyCoolPayloader.py)
-copy_and_install_python_test(test_PyCoolTool.py)
-copy_and_install_python_test(test_Regression.py)
-copy_and_install_python_test(test_Replication.py)
-copy_and_install_python_test(Regression/createReferenceDb.py)
-copy_and_install_python_test(Regression/testReferenceDb1RO.py)
-copy_and_install_python_test(Regression/testReferenceDb1RW.py)
-copy_and_install_python_test(Regression/testReferenceDb2RO.py)
-copy_and_install_python_test(Regression/testReferenceDbAll.py)
-copy_and_install_python_test(Regression/testReferenceDb_driver.py)
+copy_to_build(test_PyCoolConsole.py tests tests/bin)
+copy_to_build(test_PyCoolCopy.py tests tests/bin)
+copy_to_build(test_PyCoolPayloader.py tests tests/bin)
+copy_to_build(test_PyCoolTool.py tests tests/bin)
+copy_to_build(test_Regression.py tests tests/bin)
+copy_to_build(test_Replication.py tests tests/bin)
+copy_to_build(Regression/createReferenceDb.py tests tests/bin)
+copy_to_build(Regression/testReferenceDb1RO.py tests tests/bin)
+copy_to_build(Regression/testReferenceDb1RW.py tests tests/bin)
+copy_to_build(Regression/testReferenceDb2RO.py tests tests/bin)
+copy_to_build(Regression/testReferenceDbAll.py tests tests/bin)
+copy_to_build(Regression/testReferenceDb_driver.py tests tests/bin)
+
-- 
GitLab