summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary
diff options
context:
space:
mode:
Diffstat (limited to 'src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary')
-rw-r--r--src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/BUILD14
-rw-r--r--src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/CMakeLists.txt11
-rw-r--r--src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/instrumentationlibrary_test.cc26
3 files changed, 51 insertions, 0 deletions
diff --git a/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/BUILD b/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/BUILD
new file mode 100644
index 000000000..38cc25300
--- /dev/null
+++ b/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/BUILD
@@ -0,0 +1,14 @@
+load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark")
+
+cc_test(
+ name = "instrumentationlibrary_test",
+ srcs = [
+ "instrumentationlibrary_test.cc",
+ ],
+ tags = ["test"],
+ deps = [
+ "//api",
+ "//sdk:headers",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
diff --git a/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/CMakeLists.txt b/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/CMakeLists.txt
new file mode 100644
index 000000000..512266dc8
--- /dev/null
+++ b/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/CMakeLists.txt
@@ -0,0 +1,11 @@
+include(GoogleTest)
+
+foreach(testname instrumentationlibrary_test)
+ add_executable(${testname} "${testname}.cc")
+ target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
+ gtest_add_tests(
+ TARGET ${testname}
+ TEST_PREFIX instrumentationlibrary.
+ TEST_LIST ${testname})
+endforeach()
diff --git a/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/instrumentationlibrary_test.cc b/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/instrumentationlibrary_test.cc
new file mode 100644
index 000000000..a410ca99f
--- /dev/null
+++ b/src/jaegertracing/opentelemetry-cpp/sdk/test/instrumentationlibrary/instrumentationlibrary_test.cc
@@ -0,0 +1,26 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+#include "opentelemetry/nostd/string_view.h"
+#include "opentelemetry/sdk/instrumentationlibrary/instrumentation_library.h"
+
+#include <gtest/gtest.h>
+#include <string>
+#include <vector>
+
+using namespace opentelemetry;
+using namespace opentelemetry::sdk::instrumentationlibrary;
+
+TEST(InstrumentationLibrary, CreateInstrumentationLibrary)
+{
+
+ std::string library_name = "opentelemetry-cpp";
+ std::string library_version = "0.1.0";
+ std::string schema_url = "https://opentelemetry.io/schemas/1.2.0";
+ auto instrumentation_library =
+ InstrumentationLibrary::Create(library_name, library_version, schema_url);
+
+ EXPECT_EQ(instrumentation_library->GetName(), library_name);
+ EXPECT_EQ(instrumentation_library->GetVersion(), library_version);
+ EXPECT_EQ(instrumentation_library->GetSchemaURL(), schema_url);
+}