COMMAND
${CMAKE_COMMAND} -E env
LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond:${CMAKE_CURRENT_BINARY_DIR}/../:$ENV{LD_LIBRARY_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} --gtest_filter=*_Anytime
)
SET_TESTS_PROPERTIES(${PROJECT_NAME} PROPERTIES TIMEOUT ${TEST_TIMEOUT})
beyond::ModuleInterface::EntryPoint entry;
};
-TEST_F(AuthenticatorTest, PositiveCreateAsync)
+TEST_F(AuthenticatorTest, PositiveCreateAsync_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveCreate)
+TEST_F(AuthenticatorTest, PositiveCreate_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveConfigure)
+TEST_F(AuthenticatorTest, PositiveConfigure_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveActivateAsync)
+TEST_F(AuthenticatorTest, PositiveActivateAsync_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveActivate)
+TEST_F(AuthenticatorTest, PositiveActivate_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveConfigure_GenerateCert)
+TEST_F(AuthenticatorTest, PositiveConfigure_GenerateCert_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveActivate_GenerateCert)
+TEST_F(AuthenticatorTest, PositiveActivate_GenerateCert_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveGetSecretKey)
+TEST_F(AuthenticatorTest, PositiveGetSecretKey_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
authenticator->Destroy();
}
-TEST_F(AuthenticatorTest, PositiveActivate_NoConfigure)
+TEST_F(AuthenticatorTest, PositiveActivate_NoConfigure_Anytime)
{
char *argv[] = {
const_cast<char *>(::Authenticator::NAME),
COMMAND
${CMAKE_COMMAND} -E env
LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond:${CMAKE_CURRENT_BINARY_DIR}/../:$ENV{LD_LIBRARY_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/${DNS_SD_TEST}
+ ${CMAKE_CURRENT_BINARY_DIR}/${DNS_SD_TEST} --gtest_filter=-*_Runtime
)
SET_TESTS_PROPERTIES(${DNS_SD_TEST} PROPERTIES TIMEOUT ${TEST_TIMEOUT})
const char *serverName = "servernametest";
-TEST(Discovery, Server)
+TEST(Discovery, Server_Runtime)
{
char *argv_server[] = {
const_cast<char *>(BEYOND_PLUGIN_DISCOVERY_DNS_SD_NAME),
EXPECT_GT(client->GetHandle(), 0);
}
-TEST_F(DiscoveryBasicTest, Activate)
+TEST_F(DiscoveryBasicTest, Activate_Runtime)
{
EXPECT_EQ(server->Activate(), 0);
EXPECT_EQ(server->Deactivate(), 0);
EXPECT_EQ(client->Deactivate(), 0);
}
-TEST_F(DiscoveryBasicTest, ActivateTwice)
+TEST_F(DiscoveryBasicTest, ActivateTwice_Runtime)
{
EXPECT_EQ(server->Activate(), 0);
EXPECT_EQ(server->Activate(), -EALREADY);
EXPECT_EQ(server->RemoveItem(nullptr), -EINVAL);
}
-TEST_F(DiscoveryBasicTest, FetchEventData)
+TEST_F(DiscoveryBasicTest, FetchEventData_Runtime)
{
EXPECT_EQ(server->SetItem("uuid", "testuuid", 8), 0);
ASSERT_EQ(server->Activate(), 0);
${CMAKE_COMMAND} -E env
LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond:${CMAKE_CURRENT_BINARY_DIR}/../:${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond-authenticator_ssl/:$ENV{LD_LIBRARY_PATH}
TEST_BASEDIR=${PROJECT_ROOT_DIR}/
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} --gtest_filter=*_Anytime
)
SET_TESTS_PROPERTIES(${PROJECT_NAME} PROPERTIES TIMEOUT ${TEST_TIMEOUT})
.free_storage = 0llu,
};
-TEST_F(PeerTest, PositiveConstructorDevice)
+TEST_F(PeerTest, PositiveConstructorDevice_Anytime)
{
int argc = 1;
char *argv[2];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveConstructorDevice2)
+TEST_F(PeerTest, PositiveConstructorDevice2_Anytime)
{
int argc = 1;
char *argv[2];
peer2->Destroy();
}
-TEST_F(PeerTest, PositiveConstructorDevice_Framework)
+TEST_F(PeerTest, PositiveConstructorDevice_Framework_Anytime)
{
int argc = 3;
char *argv[3];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveConstructorDevice_Framework2)
+TEST_F(PeerTest, PositiveConstructorDevice_Framework2_Anytime)
{
int argc = 5;
char *argv[5];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveConstructorEdge)
+TEST_F(PeerTest, PositiveConstructorEdge_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveConstructorEdge2)
+TEST_F(PeerTest, PositiveConstructorEdge2_Anytime)
{
int argc = 4;
char *argv[4];
peer2->Destroy();
}
-TEST_F(PeerTest, PositiveGetModuleName)
+TEST_F(PeerTest, PositiveGetModuleName_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoEdge)
+TEST_F(PeerTest, PositiveSetInfoEdge_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoEdge_Event)
+TEST_F(PeerTest, PositiveSetInfoEdge_Event_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoEdge2)
+TEST_F(PeerTest, PositiveSetInfoEdge2_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoEdge2_Event)
+TEST_F(PeerTest, PositiveSetInfoEdge2_Event_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoEdge_Port)
+TEST_F(PeerTest, PositiveSetInfoEdge_Port_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, NegativeSetInfoEdge)
+TEST_F(PeerTest, NegativeSetInfoEdge_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveActivateEdge)
+TEST_F(PeerTest, PositiveActivateEdge_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveActivateEdge2)
+TEST_F(PeerTest, PositiveActivateEdge2_Anytime)
{
int argc = 4;
char *argv[4];
peer2->Destroy();
}
-TEST_F(PeerTest, NegativeActivateEdge2_PortInUse)
+TEST_F(PeerTest, NegativeActivateEdge2_PortInUse_Anytime)
{
int argc = 4;
char *argv[4];
peer2->Destroy();
}
-TEST_F(PeerTest, NegativeActivateEdge)
+TEST_F(PeerTest, NegativeActivateEdge_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, NegativeDeactivateEdge_NoActivate)
+TEST_F(PeerTest, NegativeDeactivateEdge_NoActivate_Anytime)
{
int argc = 4;
char *argv[4];
peer->Destroy();
}
-TEST_F(PeerTest, NegativeSetInfoDevice)
+TEST_F(PeerTest, NegativeSetInfoDevice_Anytime)
{
int argc = 1;
char *argv[2];
peer->Destroy();
}
-TEST_F(PeerTest, NegativeSetInfoDevice_InvalidPort)
+TEST_F(PeerTest, NegativeSetInfoDevice_InvalidPort_Anytime)
{
int argc = 1;
char *argv[2];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoDevice)
+TEST_F(PeerTest, PositiveSetInfoDevice_Anytime)
{
int argc = 1;
char *argv[2];
peer->Destroy();
}
-TEST_F(PeerTest, PositiveSetInfoDevice_Event)
+TEST_F(PeerTest, PositiveSetInfoDevice_Event_Anytime)
{
int argc = 1;
char *argv[2];
${PROJECT_NAME}
COMMAND
${CMAKE_COMMAND} -E env
- LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond:${CMAKE_CURRENT_BINARY_DIR}/../:${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond-peer_nn/:${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond-authenticator_ssl/:$ENV{LD_LIBRARY_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
+ LD_LIBRARY_PATH=../../libbeyond:../:../../libbeyond-peer_nn/:../../libbeyond-authenticator_ssl/:../../libbeyond-discovery_dns_sd/:$ENV{LD_LIBRARY_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} --gtest_filter=-*_Runtime
)
SET_TESTS_PROPERTIES(${PROJECT_NAME} PROPERTIES TIMEOUT ${TEST_TIMEOUT})
beyond_authenticator_destroy(handle);
}
-TEST_F(AuthenticatorGeneric, positive_beyond_authenticator_for_peer)
+TEST_F(AuthenticatorGeneric, positive_beyond_authenticator_for_peer_Runtime)
{
beyond_authenticator_h authHandle = beyond_authenticator_create(&s_auth_args);
ASSERT_NE(authHandle, nullptr);
beyond_authenticator_destroy(handle);
}
-TEST_F(AuthenticatorGenericAsync, positive_beyond_authenticator_for_peer)
+TEST_F(AuthenticatorGenericAsync, positive_beyond_authenticator_for_peer_Runtime)
{
int invoked = 0;
beyond_authenticator_h authHandle = beyond_authenticator_create(&s_auth_args);
EXPECT_EQ(ret, -EINVAL);
}
-TEST(discovery, positive_beyond_discovery_activate)
+TEST(discovery, positive_beyond_discovery_activate_Runtime)
{
auto handle = beyond_discovery_create(&s_device_arg);
ASSERT_NE(handle, nullptr);
EXPECT_EQ(ret, -EINVAL);
}
-TEST(discovery, postive_beyond_discovery_event_processing)
+TEST(discovery, postive_beyond_discovery_event_processing_Runtime)
{
GMainLoop *loop;
loop = g_main_loop_new(nullptr, FALSE);
#include <cerrno>
#include <beyond/beyond.h>
+extern "C" {
+static char *peer_nn_argv[] = {
+ (char *)"peer_nn",
+};
+static struct beyond_argument peer_option = {
+ .argc = sizeof(peer_nn_argv) / sizeof(char *),
+ .argv = peer_nn_argv,
+};
+}
+
TEST(peer, positive_beyond_peer_create)
{
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
beyond_peer_destroy(handle);
}
TEST(peer, positive_beyond_peer_destroy)
{
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
beyond_peer_destroy(handle);
}
beyond_peer_destroy(nullptr);
}
-TEST(peer, positive_beyond_peer_configure)
+TEST(peer, positive_beyond_peer_configure_Runtime)
{
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
beyond_config config = { 's', nullptr };
auto ret = beyond_peer_configure(nullptr, &config);
EXPECT_EQ(ret, -EINVAL);
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
ret = beyond_peer_configure(handle, nullptr);
beyond_peer_destroy(handle);
}
-TEST(peer, positive_beyond_peer_set_event_callback)
+TEST(peer, positive_beyond_peer_set_event_callback_Runtime)
{
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
beyond_config config = { 's', nullptr };
EXPECT_EQ(ret, -EINVAL);
}
-TEST(peer, positive_beyond_peer_activate)
+TEST(peer, positive_beyond_peer_activate_Runtime)
{
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
beyond_config config = { 's', nullptr };
beyond_peer_destroy(handle);
}
-TEST(peer, negative_beyond_peer_activate)
+TEST(peer, negative_beyond_peer_activate_Runtime)
{
auto ret = beyond_peer_activate(nullptr);
EXPECT_EQ(ret, -EINVAL);
}
-TEST(peer, positive_beyond_peer_deactivate)
+TEST(peer, positive_beyond_peer_deactivate_Runtime)
{
- auto handle = beyond_peer_create(nullptr);
+ auto handle = beyond_peer_create(&peer_option);
ASSERT_NE(handle, nullptr);
beyond_config config = { 's', nullptr };
${PROJECT_NAME}
COMMAND
${CMAKE_COMMAND} -E env
- LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond:${CMAKE_CURRENT_BINARY_DIR}/../:${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond-peer_nn/:${CMAKE_CURRENT_BINARY_DIR}/../../libbeyond-authenticator_ssl/:$ENV{LD_LIBRARY_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
+ LD_LIBRARY_PATH=../../libbeyond:../:../../libbeyond-peer_nn/:../../libbeyond-authenticator_ssl/:../../libbeyond-discovery_dns_sd/:$ENV{LD_LIBRARY_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} --gtest_filter=*_Anytime
)
SET_TESTS_PROPERTIES(${PROJECT_NAME} PROPERTIES TIMEOUT ${TEST_TIMEOUT})
.alternative_name = "127.0.0.1",
};
-TEST(Authenticator, PositiveCreate)
+TEST(Authenticator, PositiveCreate_Anytime)
{
auto authenticator = beyond::Authenticator::Create(&arg);
ASSERT_NE(authenticator, nullptr);
authenticator->Destroy();
}
-TEST(Authenticator, PositiveDestroy)
+TEST(Authenticator, PositiveDestroy_Anytime)
{
auto authenticator = beyond::Authenticator::Create(&arg);
ASSERT_NE(authenticator, nullptr);
authenticator->Destroy();
}
-TEST(Authenticator, PositiveConfigure_null)
+TEST(Authenticator, PositiveConfigure_null_Anytime)
{
auto authenticator = beyond::Authenticator::Create(&arg);
ASSERT_NE(authenticator, nullptr);
authenticator->Destroy();
}
-TEST(Authenticator, PositiveActivate)
+TEST(Authenticator, PositiveActivate_Anytime)
{
auto authenticator = beyond::Authenticator::Create(&arg);
ASSERT_NE(authenticator, nullptr);
authenticator->Destroy();
}
-TEST(Authenticator, PositiveDeactivate)
+TEST(Authenticator, PositiveDeactivate_Anytime)
{
auto authenticator = beyond::Authenticator::Create(&arg);
ASSERT_NE(authenticator, nullptr);
authenticator->Destroy();
}
-TEST(Authenticator, PositiveGetHandle)
+TEST(Authenticator, PositiveGetHandle_Anytime)
{
auto authenticator = beyond::Authenticator::Create(&arg);
ASSERT_NE(authenticator, nullptr);
.argv = argv_client,
};
-TEST(Discovery, CreateServer)
+TEST(Discovery, CreateServer_Anytime)
{
auto discovery = beyond::Discovery::Create(&args_server);
ASSERT_NE(discovery, nullptr);
discovery->Destroy();
}
-TEST(Discovery, CreateClient)
+TEST(Discovery, CreateClient_Anytime)
{
auto discovery = beyond::Discovery::Create(&args_client);
ASSERT_NE(discovery, nullptr);
discovery->Destroy();
}
-TEST(Discovery, CreateWithNullptr)
+TEST(Discovery, CreateWithNullptr_Anytime)
{
auto discovery = beyond::Discovery::Create(nullptr);
ASSERT_EQ(discovery, nullptr);
}
-TEST(Discovery, CreateWithInvalidModule)
+TEST(Discovery, CreateWithInvalidModule_Anytime)
{
char *argv_invalid[] = {
const_cast<char *>("discovery_invalid"),
ASSERT_EQ(discovery, nullptr);
}
-TEST(Discovery, Destroy)
+TEST(Discovery, Destroy_Anytime)
{
auto discovery = beyond::Discovery::Create(&args_server);
ASSERT_NE(discovery, nullptr);
discovery->Destroy();
}
-TEST(Discovery, Configure)
+TEST(Discovery, Configure_Anytime)
{
auto discovery = beyond::Discovery::Create(&args_server);
ASSERT_NE(discovery, nullptr);
#include <gtest/gtest.h>
#include <unistd.h>
-TEST(EventLoop, Create)
+TEST(EventLoop, Create_Anytime)
{
auto loop = beyond::EventLoop::Create();
ASSERT_NE(loop, nullptr);
loop->Destroy();
}
-TEST(EventLoop, Run)
+TEST(EventLoop, Run_Anytime)
{
auto loop = beyond::EventLoop::Create();
ASSERT_NE(loop, nullptr);
loop->Destroy();
}
-TEST(EventLoop, RunAsync)
+TEST(EventLoop, RunAsync_Anytime)
{
auto loop = beyond::EventLoop::Create(true);
ASSERT_NE(loop, nullptr);
loop->Destroy();
}
-TEST(EventLoop, Stop)
+TEST(EventLoop, Stop_Anytime)
{
auto loop = beyond::EventLoop::Create();
ASSERT_NE(loop, nullptr);
loop->Destroy();
}
-TEST(EventLoop, StopAsync)
+TEST(EventLoop, StopAsync_Anytime)
{
auto loop = beyond::EventLoop::Create(true);
ASSERT_NE(loop, nullptr);
loop->Destroy();
}
-TEST(EventLoop, AddEventHandler_Basic)
+TEST(EventLoop, AddEventHandler_Basic_Anytime)
{
auto loop = beyond::EventLoop::Create();
ASSERT_NE(loop, nullptr);