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

Moved unit tests to a central place and packaged them.

parent d31bfc17
......@@ -359,6 +359,7 @@ ELSE(DEFINED PackageOnly)
if (${COMPILE_SERVER} STREQUAL "1")
add_subdirectory (rtcopy)
endif (${COMPILE_SERVER} STREQUAL "1")
add_subdirectory (test)
ENDIF(DEFINED PackageOnly)
......
add_executable(unitTest unitTest.cpp
../SCSI/DeviceTest.cpp
../SCSI/StructuresTest.cpp
../Utils/RegexTest.cpp
../Drive/DriveTest.cpp
../Exception/ExceptionTest.cpp
../File/StructuresTest.cpp
)
set_property(SOURCE ../SCSI/StructuresTest.cpp
PROPERTY COMPILE_FLAGS -fno-strict-aliasing
)
target_link_libraries(unitTest TapeDrive Exception SCSI System Utils File ${GTEST_LIBRARY} gmock pthread castorcommon)
install(TARGETS unitTest
RUNTIME DESTINATION bin)
install(FILES
SystemTest/device.conf
SystemTest/library_contents.10
SystemTest/library_contents.30
SystemTest/mhvtl.conf
DESTINATION /etc/mhvtl)
install(FILES
SystemTest/tape-server-system-test.sh
DESTINATION bin)
#install(FILES
#SystemTest/device.conf
#SystemTest/library_contents.10
#SystemTest/library_contents.30
#SystemTest/mhvtl.conf
#DESTINATION /etc/mhvtl)
#
#install(FILES
#SystemTest/tape-server-system-test.sh
#DESTINATION bin)
%defattr(-,root,root)
/usr/local/bin/TapeDriveReadWriteTest
/usr/local/bin/unitTest
/etc/mhvtl/*
%attr(755,-,-) /usr/local/bin/tape-server-system-test.sh
%attr(0640,root,root) etc/castor/TPCONFIG.example
%attr(0755,root,root) etc/init.d/taped
%attr(0644,root,root) etc/sysconfig/taped.example
%attr(0644,root,root) etc/logrotate.d/castor-tape-server
%attr(0755,root,root) usr/bin/confdrive
%attr(0755,root,root) usr/bin/mounttape
%attr(0755,root,root) usr/bin/posovl
%attr(0755,root,root) usr/bin/rlstape
%attr(0755,root,root) usr/bin/taped
%attr(0755,root,root) usr/bin/tplabel
castor/tape/tapeserver/test/unitTest
valgrind --leak-check=full --show-reachable=yes --error-exitcode=1 castor/tape/tapeserver/test/unitTest
test/castorUnitTests
valgrind --leak-check=full --show-reachable=yes --error-exitcode=1 test/castorUnitTests
%attr(0755,root,root) usr/bin/castorUnitTests
......@@ -172,20 +172,12 @@ Depends: logrotate, castor-lib = %{version}-%{release}
Description: castor (Cern Advanced STORage system)
Tape server
Package: castor-tape-server2
Package: castor-unit-test
Architecture: any
Depends: castor-lib = %{version}-%{release}
Conflicts: castor-tape-server-nostk, castor-tape-server
Build-Depends: cmake >= 2.6, gtest >= 1.5.0, gmock >= 1.5.0, gtest-devel >= 1.5.0, gmock-devel >= 1.5.0, valgrind >= 3.5.0
Description: castor (Cern Advanced STORage system)
Tape server reimplementation. Under development.
Package: castor-tape-server2-test
Architecture: any
Depends: castor-tape-server2
Description: castor (Cern Advanced STORage system)
Tape server reimplementation. Under development. Unit and system test programs.
Not for production systems.
Unit tests for castor development.
Package: castor-upv-client
Architecture: any
......
# CMakeLists.txt
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Eric.Cano@cern.ch
#
cmake_minimum_required (VERSION 2.6)
add_executable(castorUnitTests
castorUnitTests.cpp
#../castor/exception/ExceptionUnitTest.cpp
../castor/tape/tapeserver/SCSI/DeviceTest.cpp
../castor/tape/tapeserver/SCSI/StructuresTest.cpp
../castor/tape/tapeserver/Utils/RegexTest.cpp
../castor/tape/tapeserver/Drive/DriveTest.cpp
../castor/tape/tapeserver/Exception/ExceptionTest.cpp
../castor/tape/tapeserver/File/StructuresTest.cpp
)
set_property(SOURCE ../SCSI/StructuresTest.cpp
PROPERTY COMPILE_FLAGS -fno-strict-aliasing
)
target_link_libraries(castorUnitTests TapeDrive Exception SCSI System Utils File
${GTEST_LIBRARY} gmock pthread castorcommon)
install(TARGETS castorUnitTests
DESTINATION ${CASTOR_DEST_BIN_DIR})
/******************************************************************************
* unitTest.cpp
* castorUnitTests.cpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
......@@ -25,16 +25,6 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
namespace UnitTests {
/* Fail if the architecture is not 64 bits, as it is not tested,
* and not supported. */
TEST(Architecture, 64bits) {
size_t pointerSizeInBits = 8*sizeof(void *);
ASSERT_EQ(64U, pointerSizeInBits);
}
}
int main(int argc, char** argv) {
// The following line must be executed to initialize Google Mock
// (and Google Test) before running the tests.
......
Supports Markdown
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