ApiTester: Rename files and namespace

This commit is contained in:
Vaidas Gasiunas 2022-02-25 11:22:33 +01:00
parent de46144af7
commit 64873b6873
12 changed files with 61 additions and 61 deletions

View File

@ -97,18 +97,18 @@ if(NOT WIN32 AND NOT IS_ARM_MAC)
test/unit/fdb_api.cpp
test/unit/fdb_api.hpp)
set(SYSTEM_TESTER_SRCS
test/system/fdb_c_system_tester.cpp
test/system/SysTestApiWrapper.cpp
test/system/SysTestApiWrapper.h
test/system/SysTestCorrectnessWorkload.cpp
test/system/SysTestOptions.h
test/system/SysTestScheduler.cpp
test/system/SysTestScheduler.h
test/system/SysTestTransactionExecutor.cpp
test/system/SysTestTransactionExecutor.h
test/system/SysTestWorkload.cpp
test/system/SysTestWorkload.h
set(API_TESTER_SRCS
test/apitester/fdb_c_api_tester.cpp
test/apitester/TesterApiWrapper.cpp
test/apitester/TesterApiWrapper.h
test/apitester/TesterCorrectnessWorkload.cpp
test/apitester/TesterOptions.h
test/apitester/TesterScheduler.cpp
test/apitester/TesterScheduler.h
test/apitester/TesterTransactionExecutor.cpp
test/apitester/TesterTransactionExecutor.h
test/apitester/TesterWorkload.cpp
test/apitester/TesterWorkload.h
../../flow/SimpleOpt.h
)
@ -122,7 +122,7 @@ if(NOT WIN32 AND NOT IS_ARM_MAC)
add_library(fdb_c_unit_tests_version_510 OBJECT ${UNIT_TEST_VERSION_510_SRCS})
add_library(trace_partial_file_suffix_test OBJECT ${TRACE_PARTIAL_FILE_SUFFIX_TEST_SRCS})
add_library(disconnected_timeout_unit_tests OBJECT ${DISCONNECTED_TIMEOUT_UNIT_TEST_SRCS})
add_library(fdb_c_system_tester OBJECT ${SYSTEM_TESTER_SRCS})
add_library(fdb_c_api_tester OBJECT ${API_TESTER_SRCS})
else()
add_executable(fdb_c_performance_test test/performance_test.c test/test.h)
add_executable(fdb_c_ryw_benchmark test/ryw_benchmark.c test/test.h)
@ -133,7 +133,7 @@ if(NOT WIN32 AND NOT IS_ARM_MAC)
add_executable(fdb_c_unit_tests_version_510 ${UNIT_TEST_VERSION_510_SRCS})
add_executable(trace_partial_file_suffix_test ${TRACE_PARTIAL_FILE_SUFFIX_TEST_SRCS})
add_executable(disconnected_timeout_unit_tests ${DISCONNECTED_TIMEOUT_UNIT_TEST_SRCS})
add_executable(fdb_c_system_tester ${SYSTEM_TESTER_SRCS})
add_executable(fdb_c_api_tester ${API_TESTER_SRCS})
strip_debug_symbols(fdb_c_performance_test)
strip_debug_symbols(fdb_c_ryw_benchmark)
strip_debug_symbols(fdb_c_txn_size_test)
@ -155,7 +155,7 @@ if(NOT WIN32 AND NOT IS_ARM_MAC)
target_link_libraries(fdb_c_unit_tests_version_510 PRIVATE fdb_c Threads::Threads)
target_link_libraries(trace_partial_file_suffix_test PRIVATE fdb_c Threads::Threads)
target_link_libraries(disconnected_timeout_unit_tests PRIVATE fdb_c Threads::Threads)
target_link_libraries(fdb_c_system_tester PRIVATE fdb_c Threads::Threads)
target_link_libraries(fdb_c_api_tester PRIVATE fdb_c Threads::Threads)
# do not set RPATH for mako
set_property(TARGET mako PROPERTY SKIP_BUILD_RPATH TRUE)

View File

@ -1,5 +1,5 @@
/*
* SysTestApiWrapper.cpp
* TesterApiWrapper.cpp
*
* This source file is part of the FoundationDB open source project
*
@ -17,11 +17,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SysTestApiWrapper.h"
#include "TesterApiWrapper.h"
#include <cstdint>
#include <iostream>
namespace FDBSystemTester {
namespace FdbApiTester {
namespace {
@ -87,4 +87,4 @@ fdb_error_t FdbApi::setOption(FDBNetworkOption option) {
return fdb_network_set_option(option, reinterpret_cast<const uint8_t*>(""), 0);
}
} // namespace FDBSystemTester
} // namespace FdbApiTester

View File

@ -1,5 +1,5 @@
/*
* SysTestApiWrapper.h
* TesterApiWrapper.h
*
* This source file is part of the FoundationDB open source project
*
@ -30,7 +30,7 @@
#define FDB_API_VERSION 710
#include "bindings/c/foundationdb/fdb_c.h"
namespace FDBSystemTester {
namespace FdbApiTester {
// Wrapper parent class to manage memory of an FDBFuture pointer. Cleans up
// FDBFuture when this instance goes out of scope.
@ -76,6 +76,6 @@ public:
static fdb_error_t setOption(FDBNetworkOption option);
};
} // namespace FDBSystemTester
} // namespace FdbApiTester
#endif

View File

@ -1,5 +1,5 @@
/*
* SysTestCorrectnessWorkload.cpp
* TesterCorrectnessWorkload.cpp
*
* This source file is part of the FoundationDB open source project
*
@ -17,12 +17,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SysTestWorkload.h"
#include "TesterWorkload.h"
#include <memory>
#include <optional>
#include <iostream>
namespace FDBSystemTester {
namespace FdbApiTester {
class ApiCorrectnessWorkload : public WorkloadBase {
public:
@ -58,4 +58,4 @@ std::unique_ptr<IWorkload> createApiCorrectnessWorkload() {
return std::make_unique<ApiCorrectnessWorkload>();
}
} // namespace FDBSystemTester
} // namespace FdbApiTester

View File

@ -1,5 +1,5 @@
/*
* SysTestOptions.h
* TesterOptions.h
*
* This source file is part of the FoundationDB open source project
*
@ -28,7 +28,7 @@
#define FDB_API_VERSION 710
namespace FDBSystemTester {
namespace FdbApiTester {
class TesterOptions {
public:
@ -49,6 +49,6 @@ public:
int numFdbThreads = 1;
};
} // namespace FDBSystemTester
} // namespace FdbApiTester
#endif

View File

@ -1,5 +1,5 @@
/*
* SysTestScheduler.cpp
* TesterScheduler.cpp
*
* This source file is part of the FoundationDB open source project
*
@ -18,7 +18,7 @@
* limitations under the License.
*/
#include "SysTestScheduler.h"
#include "TesterScheduler.h"
#include <memory>
#include <thread>
@ -27,7 +27,7 @@
using namespace boost::asio;
namespace FDBSystemTester {
namespace FdbApiTester {
class AsioScheduler : public IScheduler {
public:
@ -62,4 +62,4 @@ std::unique_ptr<IScheduler> createScheduler(int numThreads) {
return std::make_unique<AsioScheduler>(numThreads);
}
} // namespace FDBSystemTester
} // namespace FdbApiTester

View File

@ -1,5 +1,5 @@
/*
* SysTestScheduler.h
* TesterScheduler.h
*
* This source file is part of the FoundationDB open source project
*
@ -26,7 +26,7 @@
#include <functional>
#include <memory>
namespace FDBSystemTester {
namespace FdbApiTester {
using TTaskFct = std::function<void(void)>;
@ -41,6 +41,6 @@ public:
std::unique_ptr<IScheduler> createScheduler(int numThreads);
} // namespace FDBSystemTester
} // namespace FdbApiTester
#endif

View File

@ -1,5 +1,5 @@
/*
* SysTestTransactionExecutor.cpp
* TesterTransactionExecutor.cpp
*
* This source file is part of the FoundationDB open source project
*
@ -18,13 +18,13 @@
* limitations under the License.
*/
#include "SysTestTransactionExecutor.h"
#include "TesterTransactionExecutor.h"
#include <iostream>
#include <cassert>
#include <memory>
#include <random>
namespace FDBSystemTester {
namespace FdbApiTester {
namespace {
@ -185,4 +185,4 @@ std::unique_ptr<ITransactionExecutor> createTransactionExecutor() {
return std::make_unique<TransactionExecutor>();
}
} // namespace FDBSystemTester
} // namespace FdbApiTester

View File

@ -1,5 +1,5 @@
/*
* SysTestTransactionExecutor.h
* TesterTransactionExecutor.h
*
* This source file is part of the FoundationDB open source project
*
@ -23,13 +23,13 @@
#ifndef SYS_TEST_TRANSACTION_EXECUTOR_H
#define SYS_TEST_TRANSACTION_EXECUTOR_H
#include "SysTestOptions.h"
#include "SysTestApiWrapper.h"
#include "SysTestScheduler.h"
#include "TesterOptions.h"
#include "TesterApiWrapper.h"
#include "TesterScheduler.h"
#include <string_view>
#include <memory>
namespace FDBSystemTester {
namespace FdbApiTester {
class ITransactionContext {
public:
@ -91,6 +91,6 @@ public:
std::unique_ptr<ITransactionExecutor> createTransactionExecutor();
} // namespace FDBSystemTester
} // namespace FdbApiTester
#endif

View File

@ -1,7 +1,7 @@
#include "SysTestWorkload.h"
#include "TesterWorkload.h"
#include <memory>
namespace FDBSystemTester {
namespace FdbApiTester {
void WorkloadBase::init(ITransactionExecutor* txExecutor, IScheduler* sched, TTaskFct cont) {
this->txExecutor = txExecutor;
@ -33,4 +33,4 @@ void WorkloadBase::contIfDone() {
}
}
} // namespace FDBSystemTester
} // namespace FdbApiTester

View File

@ -1,5 +1,5 @@
/*
* SysTestWorkload.h
* TesterWorkload.h
*
* This source file is part of the FoundationDB open source project
*
@ -23,10 +23,10 @@
#ifndef SYS_TEST_WORKLOAD_H
#define SYS_TEST_WORKLOAD_H
#include "SysTestTransactionExecutor.h"
#include "TesterTransactionExecutor.h"
#include <atomic>
namespace FDBSystemTester {
namespace FdbApiTester {
class IWorkload {
public:
@ -56,6 +56,6 @@ private:
std::atomic<int> txRunning;
};
} // namespace FDBSystemTester
} // namespace FdbApiTester
#endif

View File

@ -1,5 +1,5 @@
/*
* fdb_c_system_tester.cpp
* fdb_c_api_tester.cpp
*
* This source file is part of the FoundationDB open source project
*
@ -18,17 +18,17 @@
* limitations under the License.
*/
#include "SysTestOptions.h"
#include "SysTestWorkload.h"
#include "SysTestScheduler.h"
#include "SysTestTransactionExecutor.h"
#include "TesterOptions.h"
#include "TesterWorkload.h"
#include "TesterScheduler.h"
#include "TesterTransactionExecutor.h"
#include <iostream>
#include <memory>
#include <thread>
#include "flow/SimpleOpt.h"
#include "bindings/c/foundationdb/fdb_c.h"
namespace FDBSystemTester {
namespace FdbApiTester {
namespace {
@ -222,9 +222,9 @@ void fdb_check(fdb_error_t e) {
std::unique_ptr<IWorkload> createApiCorrectnessWorkload();
} // namespace FDBSystemTester
} // namespace FdbApiTester
using namespace FDBSystemTester;
using namespace FdbApiTester;
void applyNetworkOptions(TesterOptions& options) {
if (!options.externalClientLibrary.empty()) {