-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from OpenVisualCloud/unit-tests
Add skeleton for unit tests
- Loading branch information
Showing
6 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2024 Intel Corporation | ||
|
||
set -eo pipefail | ||
SCRIPT_DIR="$(readlink -f "$(dirname -- "${BASH_SOURCE[0]}")")" | ||
|
||
# Run all tests verbosely | ||
ctest --test-dir ${SCRIPT_DIR}/out --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Find source files for tests | ||
file(GLOB TEST_SOURCES "*.cc") | ||
|
||
set(MP_LIB media_proxy_lib) | ||
|
||
# Add an executable for tests | ||
add_executable(mcm_unit_tests ${TEST_SOURCES}) | ||
|
||
# Link the executable with gtest and gtest_main | ||
target_link_libraries(mcm_unit_tests PRIVATE gtest gtest_main ${MP_LIB}) | ||
target_include_directories(mcm_unit_tests PUBLIC | ||
${CMAKE_SOURCE_DIR}/media-proxy/include | ||
# Include generated *.pb.h files | ||
${CMAKE_BINARY_DIR}/media-proxy/ | ||
) | ||
|
||
# Add tests to CTest | ||
add_test(NAME mcm_unit_tests COMMAND mcm_unit_tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <gtest/gtest.h> | ||
#include "proxy_context.h" | ||
|
||
// TODO: Create real tests | ||
TEST(ProxyContextTests, ProxyContextConstructor) { | ||
ProxyContext ctx; | ||
EXPECT_EQ(ctx.getTCPListenPort(), 8002); | ||
EXPECT_EQ(ctx.getRPCListenAddress(), "0.0.0.0:8001"); | ||
EXPECT_EQ(ctx.getTCPListenAddress(), "0.0.0.0:8002"); | ||
} |