-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com> Source: cbc868c
- Loading branch information
1 parent
3f7f48d
commit 6b0ffc5
Showing
22 changed files
with
102 additions
and
48 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
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
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
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,15 @@ | ||
# | ||
# Copyright (C) 2024 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
if(NOT DEFINED AUB_STREAM_PROJECT_NAME) | ||
add_library(aub_stream_stubs OBJECT EXCLUDE_FROM_ALL | ||
${CMAKE_CURRENT_SOURCE_DIR}/aub_stream_interface_stub.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/aub_stream_stubs.cpp | ||
) | ||
target_include_directories(aub_stream_stubs PRIVATE | ||
${AUB_STREAM_HEADERS_DIR} | ||
) | ||
endif() |
4 changes: 2 additions & 2 deletions
4
.../source/aub/aub_stream_interface_stub.cpp → ...tream_stubs/aub_stream_interface_stub.cpp
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,22 @@ | ||
/* | ||
* Copyright (C) 2018-2024 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "aubstream/aubstream.h" | ||
|
||
#include <limits> | ||
|
||
namespace aub_stream { | ||
|
||
extern "C" { | ||
void injectMMIOList(MMIOList mmioList){}; | ||
void setTbxServerPort(uint16_t port){}; | ||
void setTbxServerIp(std::string server){}; | ||
void setTbxFrontdoorMode(bool frontdoor){}; | ||
void setAubStreamCaller(uint32_t caller){}; | ||
} | ||
|
||
} // namespace aub_stream |
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,17 @@ | ||
# | ||
# Copyright (C) 2024 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
project(mock_aubstream) | ||
|
||
add_library( | ||
mock_aubstream EXCLUDE_FROM_ALL OBJECT | ||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt | ||
${CMAKE_CURRENT_SOURCE_DIR}/mock_aubstream.cpp | ||
) | ||
|
||
create_project_source_tree(mock_aubstream) | ||
set_target_properties(mock_aubstream PROPERTIES FOLDER "test mocks") | ||
target_include_directories(mock_aubstream PRIVATE ${AUB_STREAM_HEADERS_DIR}) |
27 changes: 16 additions & 11 deletions
27
.../source/aub_mem_dump/aub_stream_stubs.cpp → .../common/mock_aubstream/mock_aubstream.cpp
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 |
---|---|---|
@@ -1,34 +1,39 @@ | ||
/* | ||
* Copyright (C) 2018-2023 Intel Corporation | ||
* Copyright (C) 2018-2024 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "aubstream/aubstream.h" | ||
|
||
#include <limits> | ||
|
||
namespace aub_stream_stubs { | ||
uint16_t tbxServerPort = 4321; | ||
std::string tbxServerIp = "127.0.0.1"; | ||
bool tbxFrontdoorMode = false; | ||
uint32_t aubStreamCaller = std::numeric_limits<uint32_t>::max(); | ||
aub_stream::MMIOList mmioListInjected; | ||
} // namespace aub_stream_stubs | ||
|
||
namespace aub_stream { | ||
|
||
extern "C" { | ||
void injectMMIOList(MMIOList mmioList){}; | ||
void setTbxServerPort(uint16_t port) { aub_stream_stubs::tbxServerPort = port; }; | ||
void injectMMIOList(MMIOList mmioList) { | ||
aub_stream_stubs::mmioListInjected = mmioList; | ||
aub_stream_stubs::mmioListInjected.shrink_to_fit(); | ||
} | ||
void setTbxServerPort(uint16_t port) { | ||
aub_stream_stubs::tbxServerPort = port; | ||
} | ||
void setTbxServerIp(std::string server) { | ||
// better to avoid reassigning global variables which assume memory allocations since | ||
// we could step into false-positive memory leak detection with embedded leak check helper | ||
if (aub_stream_stubs::tbxServerIp != server) | ||
if (aub_stream_stubs::tbxServerIp != server) { | ||
aub_stream_stubs::tbxServerIp = server; | ||
}; | ||
void setTbxFrontdoorMode(bool frontdoor) { aub_stream_stubs::tbxFrontdoorMode = frontdoor; }; | ||
void setAubStreamCaller(uint32_t caller) { aub_stream_stubs::aubStreamCaller = caller; }; | ||
} | ||
} | ||
void setTbxFrontdoorMode(bool frontdoor) { | ||
aub_stream_stubs::tbxFrontdoorMode = frontdoor; | ||
} | ||
void setAubStreamCaller(uint32_t caller) { | ||
} | ||
|
||
} // namespace aub_stream |
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