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

Parallelized execution of valgrind tests.

parent ab57cdaa
...@@ -225,3 +225,45 @@ add_custom_target(shortunittests ...@@ -225,3 +225,45 @@ add_custom_target(shortunittests
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess
COMMENT "Running unit tests" VERBATIM) COMMENT "Running unit tests" VERBATIM)
add_custom_target(helgrindBase
echo ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=-OStoreDBPlusMockSchedulerTestVFS*:OStoreTestVFS*:OStoreDBPlusMockSchedulerTestVFS*:InMemory*
COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=-OStoreDBPlusMockSchedulerTestVFS*:OStoreTestVFS*:OStoreDBPlusMockSchedulerTestVFS*:InMemory*
COMMAND echo ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests-multiProcess
COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests-multiProcess
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr
COMMENT "Running unit tests with race conditions detection (except slow sections)" VERBATIM)
add_custom_target(helgrindScheduler
echo ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=OStoreDBPlusMockSchedulerTestVFS/Scheduler*
COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=OStoreDBPlusMockSchedulerTestVFS/Scheduler*
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr
COMMENT "Running unit tests with race conditions detection (Mock scheduler section)" VERBATIM)
add_custom_target(helgrindOStoreDB
echo ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=OStoreTestVFS*
COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=OStoreTestVFS*
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr
COMMENT "Running unit tests with race conditions detection (Object store DB section)" VERBATIM)
add_custom_target(helgrindDataTransfer
echo ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=OStoreDBPlusMockSchedulerTestVFS/DataTransferSessionTest*
COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=OStoreDBPlusMockSchedulerTestVFS/DataTransferSessionTest*
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr
COMMENT "Running unit tests with race conditions detection (Data transfer section)" VERBATIM)
add_custom_target(helgrindInMemoryCatalogue
echo ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=InMemory/*
COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS_W_SUPPR} -q tests/cta-unitTests --gtest_filter=InMemory/*
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr
COMMENT "Running unit tests with race conditions detection (In memory catalogue section)" VERBATIM)
add_custom_target(parallelHelgrind
echo
DEPENDS helgrindBase helgrindMockSechduler helgrindOStoreDB helgrindDataTransfer helgrindInMemoryCatalogue)
...@@ -242,6 +242,7 @@ Unit tests and system tests with virtual tape drives ...@@ -242,6 +242,7 @@ Unit tests and system tests with virtual tape drives
%{_bindir}/cta-systemTests %{_bindir}/cta-systemTests
%{_libdir}/libctadaemonunittests-multiprocess.so* %{_libdir}/libctadaemonunittests-multiprocess.so*
%attr(0644,root,root) %{_datadir}/%{name}-%{ctaVersion}/unittest/*.suppr %attr(0644,root,root) %{_datadir}/%{name}-%{ctaVersion}/unittest/*.suppr
%attr(0644,root,root) %{_datadir}/%{name}-%{ctaVersion}/unittest/parallelTestsMakefile
%package -n cta-objectstore-tools %package -n cta-objectstore-tools
Summary: CERN Tape Archive: object store tools Summary: CERN Tape Archive: object store tools
......
...@@ -108,6 +108,7 @@ install(TARGETS cta-catalogueUnitTests cta-unitTests cta-unitTests-multiProcess ...@@ -108,6 +108,7 @@ install(TARGETS cta-catalogueUnitTests cta-unitTests cta-unitTests-multiProcess
install(TARGETS systemTestHelperTests DESTINATION usr/${CMAKE_INSTALL_LIBDIR}) install(TARGETS systemTestHelperTests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
configure_file(cta-valgrindUnitTests.sh.in ${CMAKE_CURRENT_BINARY_DIR}/cta-valgrindUnitTests.sh) configure_file(cta-valgrindUnitTests.sh.in ${CMAKE_CURRENT_BINARY_DIR}/cta-valgrindUnitTests.sh)
configure_file(parallelTestsMakefile.in ${CMAKE_CURRENT_BINARY_DIR}/parallelTestsMakefile)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cta-valgrindUnitTests.sh cta-unitPlusSystemTests.sh DESTINATION usr/bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cta-valgrindUnitTests.sh cta-unitPlusSystemTests.sh DESTINATION usr/bin)
install(FILES valgrind.suppr helgrind.suppr DESTINATION usr/share/cta-${CTA_VERSION}/unittest/) install(FILES valgrind.suppr helgrind.suppr ${CMAKE_CURRENT_BINARY_DIR}/parallelTestsMakefile DESTINATION usr/share/cta-${CTA_VERSION}/unittest/)
#!/bin/bash #!/bin/bash
# exit from the script on any error. # exit from the script on any error.
set -e set -e
/usr/bin/cta-unitTests
/usr/bin/cta-unitTests-multiProcess make -f /usr/share/cta-@CTA_VERSION@/parallelTestsMakefile -j 4
valgrind @VALGRIND_OPTS_STR@ --suppressions=/usr/share/cta-@CTA_VERSION@/unittest/valgrind.suppr \
/usr/bin/cta-unitTests
valgrind --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests
valgrind @VALGRIND_OPTS_STR@ --suppressions=/usr/share/cta-@CTA_VERSION@/unittest/valgrind.suppr \
--child-silent-after-fork=yes /usr/bin/cta-unitTests-multiProcess
valgrind --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests-multiProcess
.phony: all
all: valgrind valgrindMultiprocess helgrindBase helgrindScheduler helgrindOStoreDB helgrindDataTransfer helgrindInMemoryCatalogue helgrindMultiprocess
valgrind:
valgrind -q @VALGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/valgrind.suppr \
/usr/bin/cta-unitTests
valgrindMultiprocess:
valgrind -q @VALGRIND_OPTS_STR@ --child-silent-after-fork=yes \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/valgrind.suppr \
/usr/bin/cta-unitTests-multiProcess
helgrindBase:
valgrind -q --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests \
--gtest_filter=-OStoreDBPlusMockSchedulerTestVFS*:OStoreTestVFS*:OStoreDBPlusMockSchedulerTestVFS*:InMemory*
helgrindScheduler:
valgrind -q --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests \
--gtest_filter=OStoreDBPlusMockSchedulerTestVFS/Scheduler*
helgrindOStoreDB:
valgrind -q --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests \
--gtest_filter=OStoreTestVFS*
helgrindDataTransfer:
valgrind -q --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests \
--gtest_filter=OStoreDBPlusMockSchedulerTestVFS/DataTransferSessionTest*
helgrindInMemoryCatalogue:
valgrind -q --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests \
--gtest_filter=InMemory/*
helgrindMultiprocess:
valgrind -q --tool=helgrind @HELGRIND_OPTS_STR@ \
--suppressions=/usr/share/cta-@CTA_VERSION@/unittest/helgrind.suppr \
/usr/bin/cta-unitTests-multiProcess
\ No newline at end of file
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