-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor sysman init tests into separate executable for isolated testing. Related-To: VLCLJ-2253 Signed-off-by: Vishnu Khanth <[email protected]>
- Loading branch information
1 parent
e27fdce
commit ab306e0
Showing
5 changed files
with
79 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
# | ||
#Copyright(C) 2023 Intel Corporation | ||
#Copyright(C) 2023-2024 Intel Corporation | ||
# | ||
#SPDX - License - Identifier : MIT | ||
# | ||
|
||
add_lzt_test( | ||
NAME test_sysman_init | ||
NAME test_init_sysman | ||
GROUP "/conformance_tests/tools/sysman" | ||
SOURCES | ||
src/test_init.cpp | ||
src/test_init_sysman.cpp | ||
src/main.cpp | ||
LINK_LIBRARIES level_zero_tests::logging level_zero_tests::utils) | ||
|
||
add_lzt_test( | ||
NAME test_init_sysman_after_core | ||
GROUP "/conformance_tests/tools/sysman" | ||
SOURCES | ||
src/test_init_sysman_after_core.cpp | ||
src/main.cpp | ||
LINK_LIBRARIES level_zero_tests::logging level_zero_tests::utils) | ||
|
||
add_lzt_test( | ||
NAME test_init_sysman_before_core | ||
GROUP "/conformance_tests/tools/sysman" | ||
SOURCES | ||
src/test_init_sysman_before_core.cpp | ||
src/main.cpp | ||
LINK_LIBRARIES level_zero_tests::logging level_zero_tests::utils) | ||
|
27 changes: 27 additions & 0 deletions
27
conformance_tests/sysman/test_sysman_init/src/test_init_sysman.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* | ||
* Copyright (C) 2024 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "gtest/gtest.h" | ||
|
||
#include "logging/logging.hpp" | ||
#include "utils/utils.hpp" | ||
#include "test_harness/test_harness.hpp" | ||
|
||
#include <level_zero/zes_api.h> | ||
|
||
namespace { | ||
|
||
TEST(SysmanInitTests, | ||
GivenCoreNotInitializedWhenSysmanInitializedThenzesDriverGetWorks) { | ||
ASSERT_EQ(ZE_RESULT_SUCCESS, zesInit(0)); | ||
uint32_t pCount = 0; | ||
ASSERT_EQ(ZE_RESULT_SUCCESS, zesDriverGet(&pCount, nullptr)); | ||
ASSERT_GT(pCount, 0); | ||
} | ||
|
||
} // namespace |
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
30 changes: 30 additions & 0 deletions
30
conformance_tests/sysman/test_sysman_init/src/test_init_sysman_before_core.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* | ||
* Copyright (C) 2024 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "gtest/gtest.h" | ||
|
||
#include "logging/logging.hpp" | ||
#include "utils/utils.hpp" | ||
#include "test_harness/test_harness.hpp" | ||
|
||
#include <level_zero/zes_api.h> | ||
|
||
namespace { | ||
|
||
TEST(SysmanInitTests, GivenSysmanInitializedThenCallingCoreInitSucceeds) { | ||
ASSERT_EQ(ZE_RESULT_SUCCESS, zesInit(0)); | ||
uint32_t zesInitCount = 0; | ||
ASSERT_EQ(ZE_RESULT_SUCCESS, zesDriverGet(&zesInitCount, nullptr)); | ||
ASSERT_GT(zesInitCount, 0); | ||
ASSERT_EQ(ZE_RESULT_SUCCESS, zeInit(0)); | ||
uint32_t zeInitCount = 0; | ||
ASSERT_EQ(ZE_RESULT_SUCCESS, zeDriverGet(&zeInitCount, nullptr)); | ||
ASSERT_GT(zeInitCount, 0); | ||
} | ||
|
||
} // namespace |
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