aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeresa Charlin <teresa.charlinreyes@arm.com>2022-02-16 12:57:19 +0000
committerTeresa Charlin <teresa.charlinreyes@arm.com>2022-03-01 16:58:08 +0000
commit62fdf0c64834cd5e45d19528de08c5005044c858 (patch)
treea7fb306380e0afc5867b5e0925e90acd36c22cc2
parentc17679249e43174fc18551b718121c75d933a718 (diff)
downloadarmnn-62fdf0c64834cd5e45d19528de08c5005044c858.tar.gz
IVGCVSW-6602 Put ArmnnTestUtils under abi-compliance checking.
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I82f3bd99b3c1d4d8a013b1e987a533a8071fbeea
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/ArmnnTestUtilsVersion.cmake18
-rw-r--r--include/armnnTestUtils/Version.hpp24
-rwxr-xr-xsrc/armnnTestUtils/CMakeLists.txt3
-rw-r--r--src/armnnTestUtils/TestUtils.cpp2
5 files changed, 49 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e115719cf..7cb957ea20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,8 @@ list(APPEND additional_cmake_files
cmake/ParserVersion.cmake
cmake/Utils.cmake
cmake/GlobalConfig.cmake
- cmake/AddDllCopyCommands.cmake)
+ cmake/AddDllCopyCommands.cmake
+ cmake/ArmnnTestUtilsVersion.cmake)
foreach(cmake_file ${additional_cmake_files})
include(${cmake_file})
diff --git a/cmake/ArmnnTestUtilsVersion.cmake b/cmake/ArmnnTestUtilsVersion.cmake
new file mode 100644
index 0000000000..38fcb97c82
--- /dev/null
+++ b/cmake/ArmnnTestUtilsVersion.cmake
@@ -0,0 +1,18 @@
+#
+# Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+# Read the ArmNN armnnTestUtils version components from file
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../include/armnnTestUtils/Version.hpp armnnTestUtilsVersion)
+
+# Parse the ArmNN armnnTestUtils version components
+string(REGEX MATCH "#define ARMNN_TEST_UTILS_MAJOR_VERSION ([0-9]*)" _ ${armnnTestUtilsVersion})
+set(ARMNN_TEST_UTILS_MAJOR_VERSION ${CMAKE_MATCH_1})
+string(REGEX MATCH "#define ARMNN_TEST_UTILS_MINOR_VERSION ([0-9]*)" _ ${armnnTestUtilsVersion})
+set(ARMNN_TEST_UTILS_MINOR_VERSION ${CMAKE_MATCH_1})
+
+# Define LIB version
+set(ARMNN_TEST_UTILS_LIB_VERSION "${ARMNN_TEST_UTILS_MAJOR_VERSION}.${ARMNN_TEST_UTILS_MINOR_VERSION}")
+# Define LIB soversion
+set(ARMNN_TEST_UTILS_LIB_SOVERSION "${ARMNN_TEST_UTILS_MAJOR_VERSION}") \ No newline at end of file
diff --git a/include/armnnTestUtils/Version.hpp b/include/armnnTestUtils/Version.hpp
new file mode 100644
index 0000000000..39009d5621
--- /dev/null
+++ b/include/armnnTestUtils/Version.hpp
@@ -0,0 +1,24 @@
+//
+// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+/// Macro utils
+#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
+#define STRINGIFY_MACRO(s) #s
+
+// ArmnnTestUtils version components
+#define ARMNN_TEST_UTILS_MAJOR_VERSION 1
+#define ARMNN_TEST_UTILS_MINOR_VERSION 0
+#define ARMNN_TEST_UTILS_PATCH_VERSION 0
+
+/// ARMNN_TEST_UTILS_VERSION: "X.Y.Z"
+/// where:
+/// X = Major version number
+/// Y = Minor version number
+/// Z = Patch version number
+#define ARMNN_TEST_UTILS_VERSION STRINGIFY_VALUE(ARMNN_TEST_UTILS_MAJOR_VERSION) "." \
+ STRINGIFY_VALUE(ARMNN_TEST_UTILS_MINOR_VERSION) "." \
+ STRINGIFY_VALUE(ARMNN_TEST_UTILS_PATCH_VERSION)
diff --git a/src/armnnTestUtils/CMakeLists.txt b/src/armnnTestUtils/CMakeLists.txt
index 061dd90d3d..b90a71e66e 100755
--- a/src/armnnTestUtils/CMakeLists.txt
+++ b/src/armnnTestUtils/CMakeLists.txt
@@ -15,6 +15,7 @@ list(APPEND armnnTestUtils_sources
../../include/armnnTestUtils/TensorCopyUtils.hpp
../../include/armnnTestUtils/WorkloadTestUtils.hpp
../../include/armnnTestUtils/TensorHelpers.hpp
+ ../../include/armnnTestUtils/Version.hpp
CreateWorkload.hpp
CommonTestUtils.cpp
CommonTestUtils.hpp
@@ -57,3 +58,5 @@ install(TARGETS armnnTestUtils
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
add_library(Armnn::armnnTestUtils ALIAS armnnTestUtils)
+
+set_target_properties(armnnTestUtils PROPERTIES VERSION ${ARMNN_TEST_UTILS_LIB_VERSION} SOVERSION ${ARMNN_TEST_UTILS_LIB_SOVERSION}) \ No newline at end of file
diff --git a/src/armnnTestUtils/TestUtils.cpp b/src/armnnTestUtils/TestUtils.cpp
index 9ac0b3986e..3cba826dd2 100644
--- a/src/armnnTestUtils/TestUtils.cpp
+++ b/src/armnnTestUtils/TestUtils.cpp
@@ -7,6 +7,8 @@
#include <armnn/utility/Assert.hpp>
+#include "armnnTestUtils/Version.hpp"
+
using namespace armnn;
void Connect(armnn::IConnectableLayer* from, armnn::IConnectableLayer* to, const armnn::TensorInfo& tensorInfo,