Commit e0192925 authored by Eric Cano's avatar Eric Cano
Browse files

Packaged the unit tests and system tests in RPMs for continuous integration.

parent 9f9de3eb
...@@ -150,10 +150,17 @@ endif (${COMPILE_PACKAGING} STREQUAL "1") ...@@ -150,10 +150,17 @@ endif (${COMPILE_PACKAGING} STREQUAL "1")
# COMMENT "Not running the unit tests" VERBATIM) # COMMENT "Not running the unit tests" VERBATIM)
configure_file(tests/valgrind.suppr tests/valgrind.suppr COPYONLY) configure_file(tests/valgrind.suppr tests/valgrind.suppr COPYONLY)
add_custom_target(unittests configure_file(tests/helgrind.suppr tests/helgrind.suppr COPYONLY)
tests/unitTests add_custom_target(fullunittests
COMMAND valgrind --track-fds=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/unitTests tests/cta-unitTests
COMMAND valgrind --tool=helgrind -v --demangle=no --conflict-cache-size=30000000 --error-exitcode=1 tests/unitTests COMMAND valgrind --track-fds=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests
COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests
DEPENDS tests/cta-unitTests tests/valgrind.suppr tests/helgrind.suppr
COMMENT "Running unit tests with memory leak and race conditions detection" VERBATIM)
DEPENDS tests/unittests tests/valgrind.suppr add_custom_target(shortunittests
tests/cta-unitTests
DEPENDS tests/cta-unitTests
COMMENT "Running unit tests" VERBATIM) COMMENT "Running unit tests" VERBATIM)
...@@ -27,3 +27,5 @@ add_library (ctacatalogueunittests SHARED ...@@ -27,3 +27,5 @@ add_library (ctacatalogueunittests SHARED
${CATALOGUE_UNIT_TESTS_LIB_SRC_FILES}) ${CATALOGUE_UNIT_TESTS_LIB_SRC_FILES})
target_link_libraries (ctacatalogueunittests ctacatalogue) target_link_libraries (ctacatalogueunittests ctacatalogue)
install(TARGETS ctacatalogueunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -113,3 +113,5 @@ set (COMMON_UNIT_TESTS_LIB_SRC_FILES ...@@ -113,3 +113,5 @@ set (COMMON_UNIT_TESTS_LIB_SRC_FILES
add_library (ctacommonunittests SHARED add_library (ctacommonunittests SHARED
${COMMON_UNIT_TESTS_LIB_SRC_FILES}) ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
\ No newline at end of file
...@@ -26,7 +26,7 @@ Source: %{name}-%{ctaVersion}-%{ctaRelease}.tar.gz ...@@ -26,7 +26,7 @@ Source: %{name}-%{ctaVersion}-%{ctaRelease}.tar.gz
License: http://cern.ch/castor/DIST/CONDITIONS License: http://cern.ch/castor/DIST/CONDITIONS
Group: Application/cta Group: Application/cta
BuildRoot: %{_builddir}/%{name}-%{version}-root BuildRoot: %{_builddir}/%{name}-%{version}-root
BuildRequires: cmake >= 2.6 redhat-rpm-config spaceMonkey2000-devel BuildRequires: cmake >= 2.6 redhat-rpm-config
# only build debug info if you're building the whole code # only build debug info if you're building the whole code
%description %description
...@@ -58,25 +58,25 @@ cd build ...@@ -58,25 +58,25 @@ cd build
%check %check
%if "%{skip_unit_tests}" == "0" %if "%{skip_unit_tests}" == "0"
cd build cd build
%{__make} test %{__make} shortunittests
%endif %endif
# The packages will be cta-tapeserver, cta-frontend, cta-cli # The packages will be cta-tapeserver, cta-frontend, cta-cli
%package -n cta-tapeserver %package -n cta-taped
Summary: CERN Tape Archive Summary: CERN Tape Archive: tape daemon
Group: Application/CTA Group: Application/CTA
requires: cta-lib requires: cta-lib
%description -n cta-tapeserver %description -n cta-taped
CERN Tape Archive: CERN Tape Archive:
The tape server daemon The tape server daemon
%files -n cta-tapeserver %files -n cta-taped
%defattr(-,root,root) %defattr(-,root,root)
%attr(0755,root,root) %{_bindir}/cta-tapeserverd %attr(0755,root,root) %{_bindir}/cta-taped
%attr(0755,root,root) %{_libdir}/libctamessages.so %attr(0755,root,root) %{_libdir}/libctamessages.so
%package -n cta-frontend %package -n cta-frontend
Summary: CERN Tape Archive Summary: CERN Tape Archive: Xrootd plugin
Group: Application/CTA Group: Application/CTA
requires: cta-lib requires: cta-lib
%description -n cta-frontend %description -n cta-frontend
...@@ -88,7 +88,7 @@ The xroot plugin ...@@ -88,7 +88,7 @@ The xroot plugin
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/xrd.cf.cta %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/xrd.cf.cta
%package -n cta-cli %package -n cta-cli
Summary: CERN Tape Archive Summary: CERN Tape Archive: command line interface
Group: Application/CTA Group: Application/CTA
%description -n cta-cli %description -n cta-cli
CERN Tape Archive: CERN Tape Archive:
...@@ -98,6 +98,7 @@ The xroot plugin ...@@ -98,6 +98,7 @@ The xroot plugin
%attr(0755,root,root) %{_bindir}/cta %attr(0755,root,root) %{_bindir}/cta
%attr(0755,root,root) %{_bindir}/ctaAddAdminUser %attr(0755,root,root) %{_bindir}/ctaAddAdminUser
%package -n cta-lib %package -n cta-lib
Summary: CERN Tape Archive Summary: CERN Tape Archive
Group: Application/CTA Group: Application/CTA
...@@ -110,4 +111,49 @@ The shared libraries ...@@ -110,4 +111,49 @@ The shared libraries
%attr(0755,root,root) %{_libdir}/libctanameserver.so %attr(0755,root,root) %{_libdir}/libctanameserver.so
%attr(0755,root,root) %{_libdir}/libctaremotens.so %attr(0755,root,root) %{_libdir}/libctaremotens.so
%attr(0755,root,root) %{_libdir}/libctascheduler.so %attr(0755,root,root) %{_libdir}/libctascheduler.so
%attr(0755,root,root) %{_libdir}/libctaobjectstore.so %attr(0755,root,root) %{_libdir}/libctaobjectstore.so
\ No newline at end of file %attr(0755,root,root) %{_libdir}/libctamediachangerutils.so
%attr(0755,root,root) %{_libdir}/libctamessages.so
%attr(0755,root,root) %{_libdir}/libctamessagesutils.so
%attr(0755,root,root) %{_libdir}/libctatapereactorutils.so
%attr(0755,root,root) %{_libdir}/libctatapeserverdaemonutils.so
%package -n cta-unittests
Summary: CERN Tape Archive: unit tests
Group: Application/CTA
%description -n cta-unittests
CERN Tape Archive:
unit tests
%files -n cta-unittests
%attr(0755,root,root) %{_bindir}/cta-unitTests
%attr(0755,root,root) %{_bindir}/cta-valgrindUnitTests.sh
%attr(0755,root,root) %{_libdir}/libctacatalogueunittests.so
%attr(0755,root,root) %{_libdir}/libctacommonunittests.so
%attr(0755,root,root) %{_libdir}/libctaexceptionunittests.so
%attr(0755,root,root) %{_libdir}/libctaiounittests.so
%attr(0755,root,root) %{_libdir}/libctalegacymsgunittests.so
%attr(0755,root,root) %{_libdir}/libctamessagesunittests.so
%attr(0755,root,root) %{_libdir}/libctanameserverunittests.so
%attr(0755,root,root) %{_libdir}/libctaobjectstoreunittests.so
%attr(0755,root,root) %{_libdir}/libctaremotensunittests.so
%attr(0755,root,root) %{_libdir}/libctaschedulerunittests.so
%attr(0755,root,root) %{_libdir}/libctaserverunittests.so
%attr(0755,root,root) %{_libdir}/libctatapereactorunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverdaemonunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverdriveunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverfileunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverscsiunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverutilsunittests.so
%attr(0755,root,root) %{_libdir}/libctautilsunittests.so
%attr(0644,root,root) %{_datadir}/%{name}-%{ctaVersion}/unittest/*.suppr
%package -n cta-systemtests
Summary: CERN Tape Archive: system tests with virtual tape drives
Group: Application/CTA
%description -n cta-systemtests
CERN Tape Archive:
system tests with virtual tape drives
%files -n cta-systemtests
%attr(0755,root,root) %{_bindir}/cta-systemTests
%attr(0755,root,root) %{_libdir}/libsystemTestHelperTests.so
...@@ -21,5 +21,7 @@ add_library (ctanameserverunittests SHARED ...@@ -21,5 +21,7 @@ add_library (ctanameserverunittests SHARED
target_link_libraries(ctanameserverunittests target_link_libraries(ctanameserverunittests
ctanameserver) ctanameserver)
install(TARGETS ctanameserverunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_executable(makeMockNameServerBasePath mockNS/makeMockNameServerBasePath.cpp) add_executable(makeMockNameServerBasePath mockNS/makeMockNameServerBasePath.cpp)
target_link_libraries(makeMockNameServerBasePath ctacommon) target_link_libraries(makeMockNameServerBasePath ctacommon)
\ No newline at end of file
...@@ -65,6 +65,7 @@ set(ObjectStoreUnitTests ...@@ -65,6 +65,7 @@ set(ObjectStoreUnitTests
add_library(ctaobjectstoreunittests SHARED ${ObjectStoreUnitTests}) add_library(ctaobjectstoreunittests SHARED ${ObjectStoreUnitTests})
target_link_libraries(ctaobjectstoreunittests target_link_libraries(ctaobjectstoreunittests
protobuf rados ctacommon gtest ctaobjectstore) protobuf rados ctacommon gtest ctaobjectstore)
install(TARGETS ctaobjectstoreunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_executable(makeMinimalVFS makeMinimalVFS.cpp) add_executable(makeMinimalVFS makeMinimalVFS.cpp)
target_link_libraries(makeMinimalVFS target_link_libraries(makeMinimalVFS
......
...@@ -25,3 +25,5 @@ add_library (ctaremotensunittests SHARED ...@@ -25,3 +25,5 @@ add_library (ctaremotensunittests SHARED
target_link_libraries(ctaremotensunittests target_link_libraries(ctaremotensunittests
ctaremotens ctaremotens
ctautils) ctautils)
install(TARGETS ctaremotensunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -47,7 +47,8 @@ add_library (ctaschedulerunittests SHARED ...@@ -47,7 +47,8 @@ add_library (ctaschedulerunittests SHARED
SchedulerDatabaseFactory.cpp SchedulerDatabaseFactory.cpp
SchedulerDatabaseTest.cpp) SchedulerDatabaseTest.cpp)
target_link_libraries (ctaschedulerunittests ${SQLITE3_LIBRARY_RELEASE}) target_link_libraries (ctaschedulerunittests
${SQLITE3_LIBRARY_RELEASE}
target_link_libraries(ctaschedulerunittests
ctascheduler) ctascheduler)
install(TARGETS ctaschedulerunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
\ No newline at end of file
...@@ -10,3 +10,4 @@ add_subdirectory (daemon) ...@@ -10,3 +10,4 @@ add_subdirectory (daemon)
add_executable (cta-taped cta-taped.cpp) add_executable (cta-taped cta-taped.cpp)
target_link_libraries(cta-taped target_link_libraries(cta-taped
ctatapedaemon ctacommon protobuf) ctatapedaemon ctacommon protobuf)
install (TARGETS cta-taped DESTINATION usr/bin)
...@@ -4,3 +4,5 @@ include_directories(${PROJECT_SOURCE_DIR}/tapeserver) ...@@ -4,3 +4,5 @@ include_directories(${PROJECT_SOURCE_DIR}/tapeserver)
add_library (ctaexceptionunittests SHARED add_library (ctaexceptionunittests SHARED
ExceptionTest.cpp) ExceptionTest.cpp)
install(TARGETS ctaexceptionunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -11,3 +11,5 @@ add_library (ctaiounittests SHARED ...@@ -11,3 +11,5 @@ add_library (ctaiounittests SHARED
IoTest.cpp) IoTest.cpp)
target_link_libraries (ctaiounittests target_link_libraries (ctaiounittests
ctaio) ctaio)
install(TARGETS ctaiounittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -30,3 +30,4 @@ add_library (ctalegacymsgunittests SHARED ...@@ -30,3 +30,4 @@ add_library (ctalegacymsgunittests SHARED
target_link_libraries (ctalegacymsgunittests target_link_libraries (ctalegacymsgunittests
ctamessages ctamessages
ctautils) ctautils)
install(TARGETS ctalegacymsgunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -36,3 +36,4 @@ add_library(ctamediachanger ${MEDIA_CHANGER_LIB_SRC_FILES}) ...@@ -36,3 +36,4 @@ add_library(ctamediachanger ${MEDIA_CHANGER_LIB_SRC_FILES})
add_library(ctamediachangerutils SHARED add_library(ctamediachangerutils SHARED
MmcProxyDummy.cpp) MmcProxyDummy.cpp)
install(TARGETS ctamediachangerutils DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -34,6 +34,7 @@ add_library(ctamessagesprotobuf ...@@ -34,6 +34,7 @@ add_library(ctamessagesprotobuf
add_library(ctamessagesutils SHARED add_library(ctamessagesutils SHARED
AcsProxyDummy.cpp AcsProxyDummy.cpp
TapeserverProxyDummy.cpp) TapeserverProxyDummy.cpp)
install(TARGETS ctamessagesutils DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
set(CtaMessageSrcs set(CtaMessageSrcs
AcsProxy.cpp AcsProxy.cpp
...@@ -70,3 +71,4 @@ add_library(ctamessagesunittests SHARED ...@@ -70,3 +71,4 @@ add_library(ctamessagesunittests SHARED
MessagesTest.cpp MessagesTest.cpp
MutexLockerTest.cpp MutexLockerTest.cpp
MutexTest.cpp) MutexTest.cpp)
install(TARGETS ctamessagesunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -24,3 +24,5 @@ add_library (ctaserverunittests SHARED ...@@ -24,3 +24,5 @@ add_library (ctaserverunittests SHARED
ThreadingTests.cpp) ThreadingTests.cpp)
target_link_libraries (ctaserverunittests) target_link_libraries (ctaserverunittests)
install(TARGETS ctaserverunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -106,7 +106,8 @@ castor::server::CondVarSemaphore::~CondVarSemaphore() { ...@@ -106,7 +106,8 @@ castor::server::CondVarSemaphore::~CondVarSemaphore() {
pthread_mutex_lock(&m_mutex); pthread_mutex_lock(&m_mutex);
pthread_mutex_unlock(&m_mutex); pthread_mutex_unlock(&m_mutex);
/* Cleanup */ /* Cleanup */
pthread_cond_destroy(&m_cond); int rc=pthread_cond_destroy(&m_cond);
rc=rc;
pthread_mutex_destroy(&m_mutex); pthread_mutex_destroy(&m_mutex);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -38,10 +38,14 @@ add_library (ctatapereactorutils SHARED ...@@ -38,10 +38,14 @@ add_library (ctatapereactorutils SHARED
DummyPollReactor.cpp DummyPollReactor.cpp
DummyZMQReactor.cpp) DummyZMQReactor.cpp)
install(TARGETS ctatapereactorutils DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_library (ctatapereactorunittests SHARED add_library (ctatapereactorunittests SHARED
PollReactorImplTest.cpp PollReactorImplTest.cpp
ZMQReactorTest.cpp) ZMQReactorTest.cpp)
install(TARGETS ctatapereactorunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
target_link_libraries (ctatapereactorunittests target_link_libraries (ctatapereactorunittests
ctatapereactor ctatapereactor
ctatapereactorutils) ctatapereactorutils)
...@@ -37,3 +37,5 @@ add_library(SCSI Device.cpp Structures.cpp Constants.cpp Exception.cpp) ...@@ -37,3 +37,5 @@ add_library(SCSI Device.cpp Structures.cpp Constants.cpp Exception.cpp)
add_library(ctatapeserverscsiunittests SHARED add_library(ctatapeserverscsiunittests SHARED
DeviceTest.cpp DeviceTest.cpp
StructuresTest.cpp) StructuresTest.cpp)
install(TARGETS ctatapeserverscsiunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -101,11 +101,13 @@ add_executable(cta-tapeserverd TapeDaemon.cpp) ...@@ -101,11 +101,13 @@ add_executable(cta-tapeserverd TapeDaemon.cpp)
target_link_libraries(cta-tapeserverd ctaTapeServerDaemon SCSI System Utils target_link_libraries(cta-tapeserverd ctaTapeServerDaemon SCSI System Utils
File TapeDrive ctacommon ctatapereactor ${LIBCAP_LIB} ${ZLIB_LIBRARIES} File TapeDrive ctacommon ctatapereactor ${LIBCAP_LIB} ${ZLIB_LIBRARIES}
ctamessages zmq ctaio ctautils ctaserverutils) ctamessages zmq ctaio ctautils ctaserverutils)
install (TARGETS cta-tapeserverd DESTINATION usr/bin) #install (TARGETS cta-tapeserverd DESTINATION usr/bin)
add_library(ctatapeserverdaemonutils SHARED add_library(ctatapeserverdaemonutils SHARED
ProcessForkerProxyDummy.cpp) ProcessForkerProxyDummy.cpp)
install(TARGETS ctatapeserverdaemonutils DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_library(ctatapeserverdaemonunittests SHARED add_library(ctatapeserverdaemonunittests SHARED
CatalogueDriveStateTest.cpp CatalogueDriveStateTest.cpp
CatalogueTest.cpp CatalogueTest.cpp
...@@ -129,3 +131,5 @@ target_link_libraries(ctatapeserverdaemonunittests ...@@ -129,3 +131,5 @@ target_link_libraries(ctatapeserverdaemonunittests
ctaserverutils ctaserverutils
ctatapeserverdaemonutils) ctatapeserverdaemonutils)
#ctaschedulerutils #ctaschedulerutils
install(TARGETS ctatapeserverdaemonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
...@@ -73,3 +73,5 @@ target_link_libraries(ctatapeserverdriveunittests ...@@ -73,3 +73,5 @@ target_link_libraries(ctatapeserverdriveunittests
System System
TapeDrive TapeDrive
ctautils) ctautils)
install(TARGETS ctatapeserverdriveunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment