Skip to content

Commit

Permalink
[Tests] Add converted XrdEc test (MicroTest)
Browse files Browse the repository at this point in the history
Adds converted XrdEc tests from CPPUnit to GTest.
In addition, it adds the new references to the XrdEcTests class in the
Reader and Zip class (as friend classes).
  • Loading branch information
AngeloGalav committed Aug 4, 2023
1 parent 467ff0b commit 9066151
Show file tree
Hide file tree
Showing 6 changed files with 786 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/XrdCl/XrdClZipArchive.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
//-----------------------------------------------------------------------------
namespace XrdEc{ class StrmWriter; class Reader; template<bool> class OpenOnlyImpl; };
class MicroTest;
class XrdEcTests;

namespace XrdCl
{
Expand All @@ -63,6 +64,7 @@ namespace XrdCl
template<bool>
friend class XrdEc::OpenOnlyImpl;
friend class ::MicroTest;
friend class ::XrdEcTests;

template<typename RSP>
friend XRootDStatus ReadFromImpl( ZipArchive&, const std::string&, uint64_t, uint32_t, void*, ResponseHandler*, uint16_t );
Expand Down
2 changes: 2 additions & 0 deletions src/XrdEc/XrdEcReader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <unordered_set>

class MicroTest;
class XrdEcTests;

namespace XrdEc
{
Expand All @@ -57,6 +58,7 @@ namespace XrdEc
class Reader
{
friend class ::MicroTest;
friend class ::XrdEcTests;
friend struct block_t;

public:
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_subdirectory( XrdSsiTests )

if( BUILD_XRDEC )
add_subdirectory( XrdEcTests )
add_subdirectory( XrdEc ) # new tests with GTest
endif()

if( BUILD_CEPH )
Expand Down
1 change: 1 addition & 0 deletions tests/XrdCl/XrdClUtilsTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// or submit itself to any jurisdiction.
//------------------------------------------------------------------------------

#include <gtest/gtest.h>
#include "XrdCl/XrdClAnyObject.hh"
#include "GTestXrdHelpers.hh"
#include "XrdCl/XrdClTaskManager.hh"
Expand Down
25 changes: 25 additions & 0 deletions tests/XrdEc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
add_executable(xrdec-unit-tests
MicroTest.cc
../common/Server.cc
../common/Utils.cc
../common/TestEnv.cc
)

target_link_libraries(xrdec-unit-tests
XrdEc
XrdCl
XrdXml
XrdUtils
ZLIB::ZLIB
GTest::GTest
GTest::Main
${ISAL_LIBRARIES}
)

target_include_directories(xrdec-unit-tests
PRIVATE ${CMAKE_SOURCE_DIR}/src
PRIVATE ../common
${ISAL_INCLUDE_DIRS}
)

gtest_discover_tests(xrdec-unit-tests TEST_PREFIX XrdCl::)

0 comments on commit 9066151

Please sign in to comment.