Commit 3b66d031 authored by Eric Cano's avatar Eric Cano
Browse files

Added a central switch to enable/disable Rados based unit tests.

parent 8d29de3d
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 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 3 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, see <http://www.gnu.org/licenses/>.
*/
// A central switch to enable/disable RADOS based tests.
#pragma once
#undef TEST_RADOS
......@@ -20,6 +20,7 @@
#include "BackendVFS.hpp"
#include "BackendRados.hpp"
#include "common/exception/Exception.hpp"
#include "BackendRadosTestSwitch.hpp"
namespace unitTests {
......@@ -141,8 +142,7 @@ TEST_P(BackendAbstractTest, ParametersInterface) {
}
static cta::objectstore::BackendVFS osVFS(__LINE__, __FILE__);
#define TEST_RADOS 0
#if TEST_RADOS
#ifdef TEST_RADOS
static cta::objectstore::BackendRados osRados("tapetest", "tapetest");
INSTANTIATE_TEST_CASE_P(BackendTestRados, BackendAbstractTest, ::testing::Values((cta::objectstore::Backend*)&osRados));
#endif
......
......@@ -25,6 +25,7 @@
#include "common/log/Logger.hpp"
#include "common/log/StringLogger.hpp"
#include "OStoreDB.hpp"
#include "objectstore/BackendRadosTestSwitch.hpp"
namespace unitTests {
......@@ -170,8 +171,7 @@ TEST_P(OStoreDBTest, getBatchArchiveJob) {
}
static cta::objectstore::BackendVFS osVFS(__LINE__, __FILE__);
#define TEST_RADOS 0
#if TEST_RADOS
#ifdef TEST_RADOS
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
INSTANTIATE_TEST_CASE_P(OStoreTestRados, OStoreDBTest,
::testing::Values(OStoreDBTestParams(OStoreDBFactoryRados)));
......
......@@ -26,6 +26,7 @@
#include "OStoreDB/OStoreDBFactory.hpp"
#include "objectstore/BackendRados.hpp"
#include "common/log/DummyLogger.hpp"
#include "objectstore/BackendRadosTestSwitch.hpp"
#include <exception>
#include <gtest/gtest.h>
......@@ -257,8 +258,6 @@ INSTANTIATE_TEST_CASE_P(OStoreSchedulerDatabaseTestVFS, SchedulerDatabaseTest,
::testing::Values(SchedulerDatabaseTestParam(OStoreDBFactoryVFS)));
#endif
#undef TEST_RADOS
#ifdef TEST_RADOS
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
......
......@@ -33,6 +33,7 @@
#include "scheduler/TapeMount.hpp"
#include "tests/TempFile.hpp"
#include "common/log/DummyLogger.hpp"
#include "objectstore/BackendRadosTestSwitch.hpp"
#include <exception>
#include <gtest/gtest.h>
......@@ -619,7 +620,6 @@ INSTANTIATE_TEST_CASE_P(OStoreDBPlusMockSchedulerTestVFS, SchedulerTest,
::testing::Values(SchedulerTestParam(OStoreDBFactoryVFS)));
#endif
#undef TEST_RADOS
#ifdef TEST_RADOS
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
......
......@@ -52,6 +52,7 @@
#include "scheduler/testingMocks/MockArchiveJob.hpp"
#include "scheduler/testingMocks/MockArchiveMount.hpp"
#include "tests/TempFile.hpp"
#include "objectstore/BackendRadosTestSwitch.hpp"
#include <dirent.h>
#include <fcntl.h>
......@@ -1536,7 +1537,6 @@ INSTANTIATE_TEST_CASE_P(OStoreDBPlusMockSchedulerTestVFS, DataTransferSessionTes
::testing::Values(DataTransferSessionTestParam(OStoreDBFactoryVFS)));
#endif
#undef TEST_RADOS
#ifdef TEST_RADOS
static cta::OStoreDBFactory<cta::objectstore::BackendRados> OStoreDBFactoryRados("rados://tapetest@tapetest");
......
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