Skip to content

Commit

Permalink
starting perf test
Browse files Browse the repository at this point in the history
  • Loading branch information
seanavery committed Jul 14, 2023
1 parent 350998a commit 12640eb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ target_link_libraries(${PROJECT_NAME}_test
)

# Add the test as a target
add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test)
add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test)


# Perf executable
add_executable(${PROJECT_NAME}_perf test/test_sdk_perf.cpp)
target_link_libraries(${PROJECT_NAME}_perf
${GSTREAMER_LIBRARIES}
viam-cpp-sdk::viamsdk
)
25 changes: 25 additions & 0 deletions test/test_sdk_perf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <fstream>
#include <string>
#include <unistd.h>
#include <vector>

#include <viam/sdk/components/camera/camera.hpp>
#include <viam/sdk/components/camera/client.hpp>
#include <viam/sdk/robot/client.hpp>
#include <viam/sdk/robot/service.hpp>
#include <viam/sdk/rpc/dial.hpp>

namespace vs = ::viam::sdk;

int main() {
// Connect to robot
std::string robot_address("localhost:8080");
vs::Credentials credentials("");
vs::DialOptions dial_options;
dial_options.set_allow_insecure_downgrade(credentials.payload().empty());

vs::Options options = vs::Options(1, dial_options);

// Get camera resource
return EXIT_SUCCESS;
}

0 comments on commit 12640eb

Please sign in to comment.