mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 05:52:19 +08:00
use test_files from source location in ults
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
685b9396d4
commit
dc78375d46
@@ -819,9 +819,14 @@ endif()
|
||||
|
||||
set(NEO_SCRIPT_PROJECTS_FOLDER "neo scripts")
|
||||
|
||||
set(NEO_SHARED_BUILTINS_DIR "${NEO_SOURCE_DIR}/shared/source/built_ins/kernels")
|
||||
set(NEO_SHARED_TEST_FILES_DIR "${NEO_SOURCE_DIR}/shared/test/common/test_files")
|
||||
set(NEO_OPENCL_TEST_FILES_DIR "${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files")
|
||||
|
||||
configure_file(config.h.in ${NEO_BUILD_DIR}/config.h)
|
||||
configure_file(driver_version.h.in ${NEO_BUILD_DIR}/driver_version.h) # Put Driver version into define
|
||||
configure_file(lib_names.h.in ${NEO_BUILD_DIR}/lib_names.h)
|
||||
configure_file(test_files_setup.h.in ${NEO_BUILD_DIR}/test_files_setup.h)
|
||||
|
||||
if(BUILD_WITH_L0)
|
||||
add_subdirectory_unique(level_zero)
|
||||
|
||||
@@ -20,7 +20,7 @@ components:
|
||||
infra:
|
||||
branch: master
|
||||
dest_dir: infra
|
||||
revision: 31ea9daa3f63cf497a221d6a45b58b4542cf8cfa
|
||||
revision: ee8c59b4691c71c36e289126259a644fdbfea559
|
||||
type: git
|
||||
internal:
|
||||
branch: master
|
||||
|
||||
@@ -116,12 +116,7 @@ function(neo_copy_test_files target product)
|
||||
COMMAND echo deleting and re-creating ${product} cache directory...
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${outputdir}/cl_cache
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}/cl_cache
|
||||
COMMAND echo copying built-in kernel files from ${BUILT_IN_KERNEL_DIR}/kernels to ${outputdir}/test_files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILT_IN_KERNEL_DIR}/kernels ${outputdir}/test_files
|
||||
COMMAND echo copying test files from ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files to ${outputdir}/test_files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files ${outputdir}/test_files
|
||||
COMMAND WORKING_DIRECTORY ${TargetDir}
|
||||
DEPENDS ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files
|
||||
)
|
||||
add_dependencies(${target} copy_compiler_files)
|
||||
set_target_properties(${target} PROPERTIES FOLDER "${PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}")
|
||||
@@ -130,19 +125,13 @@ endfunction()
|
||||
function(neo_copy_test_files_with_revision target product revision_id)
|
||||
set(outputdir "${TargetDir}/${product}/${revision_id}")
|
||||
add_custom_target(${target})
|
||||
add_dependencies(${target} copy_test_kernel_${product}_${revision_id})
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND echo deleting and re-creating ${product} cache directory...
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${outputdir}/cl_cache
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}/cl_cache
|
||||
COMMAND echo copying built-in kernel files from ${BUILT_IN_KERNEL_DIR}/kernels to ${outputdir}/test_files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILT_IN_KERNEL_DIR}/kernels ${outputdir}/test_files
|
||||
COMMAND echo copying test files from ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files to ${outputdir}/test_files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files ${outputdir}/test_files
|
||||
COMMAND WORKING_DIRECTORY ${TargetDir}
|
||||
DEPENDS ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_files
|
||||
)
|
||||
add_dependencies(${target} copy_compiler_files)
|
||||
set_target_properties(${target} PROPERTIES FOLDER "${PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}/${revision_id}")
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/helpers/hash.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/test_files.h"
|
||||
#include "shared/test/common/libult/global_environment.h"
|
||||
#include "shared/test/common/mocks/mock_builtins.h"
|
||||
#include "shared/test/common/mocks/mock_builtinslib.h"
|
||||
@@ -238,7 +239,7 @@ TEST_F(BuiltInTests, WhenBuildingListOfBuiltinsThenBuiltinsHaveBeenGenerated) {
|
||||
size_t size = 0;
|
||||
|
||||
for (auto &fileName : getBuiltInFileNames(supportsImages)) {
|
||||
appendBuiltInStringFromFile(fileName, size);
|
||||
appendBuiltInStringFromFile(sharedBuiltinsDir + "/" + fileName, size);
|
||||
ASSERT_NE(0u, size);
|
||||
}
|
||||
|
||||
@@ -1401,7 +1402,7 @@ TEST_F(BuiltInTests, GivenFiledNameWhenLoadingImplKernelFromFileStorageThenValid
|
||||
};
|
||||
MockFileStorage mockEmbeddedStorage("root");
|
||||
|
||||
BuiltinResourceT br = mockEmbeddedStorage.loadImpl("test_files/copybuffer.cl");
|
||||
BuiltinResourceT br = mockEmbeddedStorage.loadImpl(clFiles + "copybuffer.cl");
|
||||
EXPECT_NE(0u, br.size());
|
||||
|
||||
BuiltinResourceT bnr = mockEmbeddedStorage.loadImpl("unknown.cl");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -11,20 +11,20 @@
|
||||
namespace NEO {
|
||||
|
||||
std::vector<std::string> builtInFileNames = {
|
||||
"test_files/aux_translation.builtin_kernel",
|
||||
"test_files/copy_buffer_to_buffer.builtin_kernel",
|
||||
"test_files/fill_buffer.builtin_kernel",
|
||||
"test_files/copy_buffer_rect.builtin_kernel",
|
||||
"test_files/copy_kernel_timestamps.builtin_kernel"};
|
||||
"aux_translation.builtin_kernel",
|
||||
"copy_buffer_to_buffer.builtin_kernel",
|
||||
"fill_buffer.builtin_kernel",
|
||||
"copy_buffer_rect.builtin_kernel",
|
||||
"copy_kernel_timestamps.builtin_kernel"};
|
||||
|
||||
std::vector<std::string> imageBuiltInFileNames = {
|
||||
"test_files/fill_image1d.builtin_kernel",
|
||||
"test_files/fill_image2d.builtin_kernel",
|
||||
"test_files/fill_image3d.builtin_kernel",
|
||||
"test_files/copy_image_to_image1d.builtin_kernel",
|
||||
"test_files/copy_image_to_image2d.builtin_kernel",
|
||||
"test_files/copy_image_to_image3d.builtin_kernel",
|
||||
"test_files/copy_buffer_to_image3d.builtin_kernel",
|
||||
"test_files/copy_image3d_to_buffer.builtin_kernel"};
|
||||
"fill_image1d.builtin_kernel",
|
||||
"fill_image2d.builtin_kernel",
|
||||
"fill_image3d.builtin_kernel",
|
||||
"copy_image_to_image1d.builtin_kernel",
|
||||
"copy_image_to_image2d.builtin_kernel",
|
||||
"copy_image_to_image3d.builtin_kernel",
|
||||
"copy_buffer_to_image3d.builtin_kernel",
|
||||
"copy_image3d_to_buffer.builtin_kernel"};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/helpers/test_files.h"
|
||||
|
||||
#include "opencl/test/unit_test/built_ins/built_ins_file_names.h"
|
||||
|
||||
namespace NEO {
|
||||
@@ -21,7 +23,7 @@ std::vector<std::string> getBuiltInFileNames(bool imagesSupport) {
|
||||
}
|
||||
|
||||
std::string getBuiltInHashFileName(uint64_t hash, bool imagesSupport) {
|
||||
std::string hashName = "test_files/" + std::to_string(hash);
|
||||
std::string hashName = sharedFiles + "/" + std::to_string(hash);
|
||||
if (imagesSupport) {
|
||||
hashName.append("_images");
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ TEST(EventsTracker, givenTwoEventsWithCommonParentEventThenDumpingProperGraph) {
|
||||
}
|
||||
|
||||
TEST(EventsTracker, whenCalingCreateDumpStreamThenGettingValidFstreamInstance) {
|
||||
std::string testFileName("test_files\\EventsTracker_testfile.gv");
|
||||
std::string testFileName("EventsTracker_testfile.gv");
|
||||
std::shared_ptr<std::ostream> stream = EventsTracker::getEventsTracker().createDumpStream(testFileName);
|
||||
|
||||
EXPECT_TRUE(stream->good());
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "opencl/test/unit_test/ult_config_listener.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
@@ -335,13 +336,8 @@ int main(int argc, char **argv) {
|
||||
nBinaryKernelFiles.append(testFiles);
|
||||
testFiles = nBinaryKernelFiles;
|
||||
|
||||
std::string nClFiles = getRunPath(argv[0]);
|
||||
std::string nClFiles = NEO_OPENCL_TEST_FILES_DIR;
|
||||
nClFiles.append("/");
|
||||
nClFiles.append(hardwarePrefix[productFamily]);
|
||||
nClFiles.append("/");
|
||||
nClFiles.append(std::to_string(revId));
|
||||
nClFiles.append("/");
|
||||
nClFiles.append(clFiles);
|
||||
clFiles = nClFiles;
|
||||
|
||||
std::string executionDirectory(hardwarePrefix[productFamily]);
|
||||
|
||||
@@ -12,9 +12,6 @@ list(GET mt_test_config 3 eu_per_ss)
|
||||
list(GET mt_test_config 4 revision_id)
|
||||
|
||||
add_custom_target(run_${product}_${revision_id}_mt_unit_tests DEPENDS igdrcl_mt_tests)
|
||||
if(NOT WIN32)
|
||||
add_dependencies(run_${product}_${revision_id}_mt_unit_tests copy_test_files_${product}_${revision_id})
|
||||
endif()
|
||||
|
||||
unset(GTEST_OUTPUT)
|
||||
if(DEFINED GTEST_OUTPUT_DIR)
|
||||
|
||||
@@ -406,7 +406,7 @@ TEST(DecoderTests, GivenProperStructWhenReadingStructFieldsThenFieldsVectorGetsP
|
||||
|
||||
TEST(DecoderTests, GivenProperPatchListFileWhenParsingTokensThenFileIsParsedCorrectly) {
|
||||
MockDecoder decoder;
|
||||
decoder.pathToPatch = "test_files/";
|
||||
decoder.pathToPatch = clFiles;
|
||||
decoder.parseTokens();
|
||||
|
||||
EXPECT_EQ(static_cast<uint32_t>(28), (decoder.programHeader.size));
|
||||
@@ -532,7 +532,7 @@ TEST(DecoderTests, GivenValidBinaryWithoutPatchTokensWhenProcessingBinaryThenBin
|
||||
|
||||
std::stringstream ptmFile;
|
||||
MockDecoder decoder;
|
||||
decoder.pathToPatch = "test_files/";
|
||||
decoder.pathToPatch = clFiles;
|
||||
decoder.pathToDump = "non_existing_folder/";
|
||||
decoder.parseTokens();
|
||||
|
||||
@@ -583,7 +583,7 @@ TEST(DecoderTests, GivenValidBinaryWhenProcessingBinaryThenProgramAndKernelAndPa
|
||||
std::vector<char> binary(binaryString.begin(), binaryString.end());
|
||||
std::stringstream ptmFile;
|
||||
MockDecoder decoder;
|
||||
decoder.pathToPatch = "test_files/";
|
||||
decoder.pathToPatch = clFiles;
|
||||
decoder.pathToDump = "non_existing_folder/";
|
||||
decoder.parseTokens();
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/compiler_interface/compiler_options/compiler_options.h"
|
||||
#include "shared/test/common/helpers/test_files.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
||||
|
||||
@@ -25,7 +26,7 @@ BDWTEST_F(MockOfflineCompilerBdwTests, givenDebugOptionAndBdwThenInternalOptionS
|
||||
"-options",
|
||||
"-g",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"bdw"};
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "environment.h"
|
||||
#include "limits.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#ifdef WIN32
|
||||
const char *fSeparator = "\\";
|
||||
@@ -119,6 +120,10 @@ int main(int argc, char **argv) {
|
||||
testFiles = nTestFiles;
|
||||
binaryNameSuffix.append(familyNameWithType);
|
||||
|
||||
std::string nClFiles = NEO_OPENCL_TEST_FILES_DIR;
|
||||
nClFiles.append("/");
|
||||
clFiles = nClFiles;
|
||||
|
||||
#ifdef WIN32
|
||||
#include <direct.h>
|
||||
if (_chdir(familyNameWithType.c_str())) {
|
||||
|
||||
@@ -37,10 +37,11 @@ TEST(OclocApiTests, WhenOclocVersionIsCalledThenCurrentOclocVersionIsReturned) {
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, WhenGoodArgsAreGivenThenSuccessIsReturned) {
|
||||
std::string clFileName(clFiles + "copybuffer.cl");
|
||||
const char *argv[] = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFileName.c_str(),
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
unsigned int argc = sizeof(argv) / sizeof(const char *);
|
||||
@@ -58,10 +59,11 @@ TEST(OclocApiTests, WhenGoodArgsAreGivenThenSuccessIsReturned) {
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, GivenQuietModeAndValidArgumentsWhenRunningOclocThenSuccessIsReturnedAndBuildSucceededMessageIsNotPrinted) {
|
||||
std::string clFileName(clFiles + "copybuffer.cl");
|
||||
const char *argv[] = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFileName.c_str(),
|
||||
"-q",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
@@ -175,10 +177,11 @@ TEST(OclocApiTests, GivenInvalidQueryWhenQueryingThenErrorIsReturned) {
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, WhenGoodFamilyNameIsProvidedThenSuccessIsReturned) {
|
||||
std::string clFileName(clFiles + "copybuffer.cl");
|
||||
const char *argv[] = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFileName.c_str(),
|
||||
"-device",
|
||||
NEO::familyName[NEO::DEFAULT_PLATFORM::hwInfo.platform.eRenderCoreFamily]};
|
||||
unsigned int argc = sizeof(argv) / sizeof(const char *);
|
||||
@@ -268,15 +271,16 @@ TEST(OclocApiTests, givenInputOptionsCalledOptionsWhenCmdlineIsPrintedThenQuotes
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, givenInvalidInputOptionsAndInternalOptionsFilesWhenCmdlineIsPrintedThenTheyArePrinted) {
|
||||
ASSERT_TRUE(fileExists("test_files/shouldfail.cl"));
|
||||
ASSERT_TRUE(fileExists("test_files/shouldfail_options.txt"));
|
||||
ASSERT_TRUE(fileExists("test_files/shouldfail_internal_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "shouldfail.cl"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "shouldfail_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "shouldfail_internal_options.txt"));
|
||||
|
||||
std::string clFileName(clFiles + "shouldfail.cl");
|
||||
const char *argv[] = {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/shouldfail.cl",
|
||||
clFileName.c_str(),
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
unsigned int argc = sizeof(argv) / sizeof(const char *);
|
||||
@@ -297,7 +301,9 @@ TEST(OclocApiTests, givenInvalidInputOptionsAndInternalOptionsFilesWhenCmdlineIs
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, GivenInvalidOptionsAndInternalOptionsCommandArgumentsWhenCmdlineIsPrintedThenTheyAreNotPrinted) {
|
||||
ASSERT_TRUE(fileExists("test_files/shouldfail.cl"));
|
||||
std::string clFileName(clFiles + "shouldfail.cl");
|
||||
|
||||
ASSERT_TRUE(fileExists(clFileName));
|
||||
|
||||
const char *argv[] = {
|
||||
"ocloc",
|
||||
@@ -307,7 +313,7 @@ TEST(OclocApiTests, GivenInvalidOptionsAndInternalOptionsCommandArgumentsWhenCmd
|
||||
"-internal_options",
|
||||
"-invalid_internal_option",
|
||||
"-file",
|
||||
"test_files/shouldfail.cl",
|
||||
clFileName.c_str(),
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
unsigned int argc = sizeof(argv) / sizeof(const char *);
|
||||
@@ -328,14 +334,15 @@ TEST(OclocApiTests, GivenInvalidOptionsAndInternalOptionsCommandArgumentsWhenCmd
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, givenInvalidOclocOptionsFileWhenCmdlineIsPrintedThenTheyArePrinted) {
|
||||
ASSERT_TRUE(fileExists("test_files/valid_kernel.cl"));
|
||||
ASSERT_TRUE(fileExists("test_files/valid_kernel_ocloc_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "valid_kernel.cl"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "valid_kernel_ocloc_options.txt"));
|
||||
std::string clFileName(clFiles + "valid_kernel.cl");
|
||||
|
||||
const char *argv[] = {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/valid_kernel.cl",
|
||||
clFileName.c_str(),
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
unsigned int argc = sizeof(argv) / sizeof(const char *);
|
||||
@@ -683,4 +690,4 @@ TEST(OclocApiTests, GivenInvalidParameterWhenLinkingThenErrorIsReturned) {
|
||||
const std::string expectedExecuteError{"Error: Linker cannot be executed due to unsuccessful initialization!\n"};
|
||||
const std::string expectedErrorMessage = expectedInitError + expectedExecuteError;
|
||||
EXPECT_EQ(expectedErrorMessage, output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenMutiplePlatformWhenSecon
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
platformTarget};
|
||||
|
||||
@@ -605,7 +605,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenClosedRangeTooExtensiveW
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configString.str()};
|
||||
|
||||
@@ -710,7 +710,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenTwoPlatformsWhenFatBinar
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
platformsTarget};
|
||||
|
||||
@@ -764,7 +764,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenPlatformsClosedRangeWhen
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
platformsTarget};
|
||||
|
||||
@@ -813,7 +813,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenPlatformsOpenRangeToWhen
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
platformsTarget};
|
||||
|
||||
@@ -862,7 +862,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenPlatformsOpenRangeFromWh
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
platformsTarget};
|
||||
|
||||
@@ -916,7 +916,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenTwoConfigsWhenFatBinaryB
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configsTarget};
|
||||
|
||||
@@ -961,7 +961,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenProductConfigOpenRangeFr
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configsTarget};
|
||||
|
||||
@@ -1006,7 +1006,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenProductConfigOpenRangeTo
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configsTarget};
|
||||
|
||||
@@ -1059,7 +1059,7 @@ TEST_F(OclocFatBinaryGetTargetConfigsForFatbinary, GivenProductConfigClosedRange
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configsTarget};
|
||||
|
||||
@@ -1382,7 +1382,7 @@ TEST(OclocFatBinaryHelpersTest, GivenPreviousCompilationErrorWhenBuildingFatbina
|
||||
const std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1410,7 +1410,7 @@ TEST(OclocFatBinaryHelpersTest, GivenPreviousCompilationSuccessAndFailingBuildWh
|
||||
const std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1451,7 +1451,7 @@ TEST(OclocFatBinaryHelpersTest, GivenNonEmptyBuildLogWhenBuildingFatbinaryForTar
|
||||
const std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1488,7 +1488,7 @@ TEST(OclocFatBinaryHelpersTest, GivenQuietModeWhenBuildingFatbinaryForTargetThen
|
||||
const std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-q",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -91,7 +91,7 @@ bool isAnyIrSectionDefined(const SectionHeaders §ionHeaders) {
|
||||
}
|
||||
|
||||
TEST_F(MultiCommandTests, WhenBuildingMultiCommandThenSuccessIsReturned) {
|
||||
nameOfFileWithArgs = "test_files/ImAMulitiComandMinimalGoodFile.txt";
|
||||
nameOfFileWithArgs = "ImAMulitiComandMinimalGoodFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
@@ -101,7 +101,7 @@ TEST_F(MultiCommandTests, WhenBuildingMultiCommandThenSuccessIsReturned) {
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -117,7 +117,7 @@ TEST_F(MultiCommandTests, WhenBuildingMultiCommandThenSuccessIsReturned) {
|
||||
}
|
||||
|
||||
TEST_F(MultiCommandTests, GivenOutputFileWhenBuildingMultiCommandThenSuccessIsReturned) {
|
||||
nameOfFileWithArgs = "test_files/ImAMulitiComandMinimalGoodFile.txt";
|
||||
nameOfFileWithArgs = "ImAMulitiComandMinimalGoodFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
@@ -127,7 +127,7 @@ TEST_F(MultiCommandTests, GivenOutputFileWhenBuildingMultiCommandThenSuccessIsRe
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -150,7 +150,7 @@ TEST_F(MultiCommandTests, GivenOutputFileWhenBuildingMultiCommandThenSuccessIsRe
|
||||
}
|
||||
|
||||
TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWhenBuildingMultiCommandThenSuccessIsReturned) {
|
||||
nameOfFileWithArgs = "test_files/ImAMulitiComandMinimalGoodFile.txt";
|
||||
nameOfFileWithArgs = "ImAMulitiComandMinimalGoodFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
@@ -160,7 +160,7 @@ TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWhenBuildingMultiCommandThenSuc
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-out_dir",
|
||||
@@ -199,7 +199,7 @@ TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWithProductConfigValueWhenBuild
|
||||
}
|
||||
}
|
||||
|
||||
nameOfFileWithArgs = "test_files/ImAMulitiComandMinimalGoodFile.txt";
|
||||
nameOfFileWithArgs = "ImAMulitiComandMinimalGoodFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
@@ -209,7 +209,7 @@ TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWithProductConfigValueWhenBuild
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configStr,
|
||||
"-out_dir",
|
||||
@@ -235,11 +235,11 @@ TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWithProductConfigValueWhenBuild
|
||||
}
|
||||
|
||||
TEST_F(MultiCommandTests, GivenMissingTextFileWithArgsWhenBuildingMultiCommandThenInvalidFileErrorIsReturned) {
|
||||
nameOfFileWithArgs = "test_files/ImANotExistedComandFile.txt";
|
||||
nameOfFileWithArgs = "ImANotExistedComandFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
"test_files/ImANaughtyFile.txt",
|
||||
"ImANaughtyFile.txt",
|
||||
"-q",
|
||||
};
|
||||
|
||||
@@ -253,7 +253,7 @@ TEST_F(MultiCommandTests, GivenMissingTextFileWithArgsWhenBuildingMultiCommandTh
|
||||
DebugManager.flags.PrintDebugMessages.set(false);
|
||||
}
|
||||
TEST_F(MultiCommandTests, GivenLackOfClFileWhenBuildingMultiCommandThenInvalidFileErrorIsReturned) {
|
||||
nameOfFileWithArgs = "test_files/ImAMulitiComandMinimalGoodFile.txt";
|
||||
nameOfFileWithArgs = "ImAMulitiComandMinimalGoodFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
@@ -263,7 +263,7 @@ TEST_F(MultiCommandTests, GivenLackOfClFileWhenBuildingMultiCommandThenInvalidFi
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/ImANaughtyFile.cl",
|
||||
clFiles + "ImANaughtyFile.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -280,7 +280,7 @@ TEST_F(MultiCommandTests, GivenLackOfClFileWhenBuildingMultiCommandThenInvalidFi
|
||||
deleteFileWithArgs();
|
||||
}
|
||||
TEST_F(MultiCommandTests, GivenOutputFileListFlagWhenBuildingMultiCommandThenSuccessIsReturned) {
|
||||
nameOfFileWithArgs = "test_files/ImAMulitiComandMinimalGoodFile.txt";
|
||||
nameOfFileWithArgs = "ImAMulitiComandMinimalGoodFile.txt";
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"multi",
|
||||
@@ -292,7 +292,7 @@ TEST_F(MultiCommandTests, GivenOutputFileListFlagWhenBuildingMultiCommandThenSuc
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -342,7 +342,7 @@ TEST(MultiCommandWhiteboxTest, GivenVerboseModeAndDefinedOutputFilenameAndDirect
|
||||
|
||||
std::vector<std::string> singleArgs = {
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-output",
|
||||
"SpecialOutputFilename",
|
||||
"-out_dir",
|
||||
@@ -612,7 +612,7 @@ TEST_F(OfflineCompilerTests, Given32BitModeFlagWhenParsingThenInternalOptionsCon
|
||||
"ocloc",
|
||||
"compile",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
flag,
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
@@ -636,7 +636,7 @@ TEST_F(OfflineCompilerTests, Given64BitModeFlagWhenParsingThenInternalOptionsCon
|
||||
"ocloc",
|
||||
"compile",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
flag,
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
@@ -656,7 +656,7 @@ TEST_F(OfflineCompilerTests, Given32BitModeFlagAnd64BitModeFlagWhenParsingThenEr
|
||||
"ocloc",
|
||||
"compile",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-32",
|
||||
"-64",
|
||||
"-device",
|
||||
@@ -690,7 +690,7 @@ TEST_F(OfflineCompilerTests, GivenFlagStringWhenParsingThenInternalBooleanIsSetA
|
||||
"ocloc",
|
||||
"compile",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
flagString,
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
@@ -719,7 +719,7 @@ TEST_F(OfflineCompilerTests, GivenArgsWhenOfflineCompilerIsCreatedThenSuccessIsR
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -757,7 +757,7 @@ TEST_F(OfflineCompilerTests, givenProperDeviceIdHexAsDeviceArgumentThenSuccessIs
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
deviceString.str()};
|
||||
|
||||
@@ -780,7 +780,7 @@ TEST_F(OfflineCompilerTests, givenIncorrectDeviceIdHexThenInvalidDeviceIsReturne
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"0x0"};
|
||||
|
||||
@@ -797,7 +797,7 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWithMissingRevisionValueWhenIn
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"9.1."};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -812,7 +812,7 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWithInvalidPatternThenInvalidD
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"9.1.."};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -827,7 +827,7 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWithMissingMajorValueWhenInval
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
".1.2"};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -842,7 +842,7 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWhenInvalidRevisionValueIsPass
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"9.0.a"};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -857,7 +857,7 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWhenInvalidMinorValueIsPassedT
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"9.a"};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -872,7 +872,7 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWhenPassedValuesAreOutOfRangeT
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"256.350"};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -909,7 +909,7 @@ TEST_F(OfflineCompilerTests, givenIncorrectDeviceIdWithIncorrectHexPatternThenIn
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"0xnonexist"};
|
||||
testing::internal::CaptureStdout();
|
||||
@@ -930,7 +930,7 @@ TEST_F(OfflineCompilerTests, givenDebugOptionThenInternalOptionShouldContainKern
|
||||
"-options",
|
||||
"-g",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -949,7 +949,7 @@ TEST_F(OfflineCompilerTests, givenDashGInBiggerOptionStringWhenInitializingThenI
|
||||
"-options",
|
||||
"-gNotRealDashGOption",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -965,7 +965,7 @@ TEST_F(OfflineCompilerTests, givenExcludeIrFromZebinInternalOptionWhenInitIsPerf
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-internal_options",
|
||||
"-ze-allow-zebin -ze-exclude-ir-from-zebin",
|
||||
"-device",
|
||||
@@ -981,7 +981,7 @@ TEST_F(OfflineCompilerTests, givenValidArgumentsAndFclInitFailureWhenInitIsPerfo
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1004,7 +1004,7 @@ TEST_F(OfflineCompilerTests, givenValidArgumentsAndIgcInitFailureWhenInitIsPerfo
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1027,7 +1027,7 @@ TEST_F(OfflineCompilerTests, givenExcludeIrArgumentWhenInitIsPerformedThenIrExcl
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-exclude_ir",
|
||||
"-internal_options",
|
||||
"-ze-allow-zebin",
|
||||
@@ -1046,7 +1046,7 @@ TEST_F(OfflineCompilerTests, givenExcludeIrArgumentAndExcludeIrFromZebinInternal
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-exclude_ir",
|
||||
"-internal_options",
|
||||
"-ze-allow-zebin -ze-exclude-ir-from-zebin",
|
||||
@@ -1068,7 +1068,7 @@ TEST_F(OfflineCompilerTests, givenExcludeIrArgumentWhenCompilingKernelThenIrShou
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-exclude_ir",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
@@ -1093,7 +1093,7 @@ TEST_F(OfflineCompilerTests, givenLackOfExcludeIrArgumentWhenCompilingKernelThen
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1117,7 +1117,7 @@ TEST_F(OfflineCompilerTests, givenZeroSizeInputFileWhenInitializationIsPerformed
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1137,7 +1137,7 @@ TEST_F(OfflineCompilerTests, givenInvalidIgcOutputWhenCompilingKernelThenOutOfHo
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1160,7 +1160,7 @@ TEST_F(OfflineCompilerTests, givenIgcBuildFailureWhenCompilingKernelThenBuildPro
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1183,7 +1183,7 @@ TEST_F(OfflineCompilerTests, givenInvalidFclOutputWhenCompilingKernelThenOutOfHo
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1206,7 +1206,7 @@ TEST_F(OfflineCompilerTests, givenFclTranslationContextCreationFailureWhenCompil
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1230,7 +1230,7 @@ TEST_F(OfflineCompilerTests, givenFclTranslationContextCreationFailureAndErrorMe
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1254,7 +1254,7 @@ TEST_F(OfflineCompilerTests, givenVariousClStdValuesWhenCompilingSourceThenCorre
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1301,7 +1301,7 @@ TEST_F(OfflineCompilerTests, GivenArgsWhenBuildingThenBuildSucceeds) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1341,7 +1341,7 @@ TEST_F(OfflineCompilerTests, GivenArgsWhenBuildingWithDeviceConfigValueThenBuild
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
configStr};
|
||||
|
||||
@@ -1368,7 +1368,7 @@ TEST_F(OfflineCompilerTests, GivenLlvmTextWhenBuildingThenBuildSucceeds) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-llvm_text"};
|
||||
@@ -1391,7 +1391,7 @@ TEST_F(OfflineCompilerTests, WhenFclNotNeededThenDontLoadIt) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-spirv_input"};
|
||||
@@ -1407,7 +1407,7 @@ TEST_F(OfflineCompilerTests, WhenParsingBinToCharArrayThenCorrectResult) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1451,7 +1451,7 @@ TEST_F(OfflineCompilerTests, GivenCppFileWhenBuildingThenBuildSucceeds) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-cpp_file"};
|
||||
@@ -1474,7 +1474,7 @@ TEST_F(OfflineCompilerTests, GivenOutputDirWhenBuildingThenBuildSucceeds) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-out_dir",
|
||||
@@ -1511,7 +1511,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidFileWhenBuildingThenInvalidFileErrorIsR
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/ImANaughtyFile.cl",
|
||||
clFiles + "ImANaughtyFile.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1529,7 +1529,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidFlagWhenBuildingThenInvalidCommandLineE
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-n",
|
||||
"test_files/ImANaughtyFile.cl",
|
||||
clFiles + "ImANaughtyFile.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1562,7 +1562,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidOptionsWhenBuildingThenInvalidCommandLi
|
||||
std::vector<std::string> argvB = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/ImANaughtyFile.cl",
|
||||
clFiles + "ImANaughtyFile.cl",
|
||||
"-device"};
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argvB.size(), argvB, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
@@ -1578,7 +1578,7 @@ TEST_F(OfflineCompilerTests, GivenNonexistantDeviceWhenCompilingThenInvalidDevic
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
"foobar"};
|
||||
|
||||
@@ -1594,7 +1594,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidKernelWhenBuildingThenBuildProgramFailu
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/shouldfail.cl",
|
||||
clFiles + "shouldfail.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1667,8 +1667,10 @@ TEST(OfflineCompilerTest, GivenDelimitersWhenGettingStringThenParseIsCorrect) {
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
std::string kernelFileName(sharedBuiltinsDir + "/copy_buffer_to_buffer.builtin_kernel");
|
||||
|
||||
size_t srcSize = 0;
|
||||
auto ptrSrc = loadDataFromFile("test_files/copy_buffer_to_buffer.builtin_kernel", srcSize);
|
||||
auto ptrSrc = loadDataFromFile(kernelFileName.c_str(), srcSize);
|
||||
|
||||
const std::string src = ptrSrc.get();
|
||||
ASSERT_EQ(srcSize, src.size());
|
||||
@@ -1804,7 +1806,7 @@ TEST(OfflineCompilerTest, GivenSourceCodeWhenBuildingThenSuccessIsReturned) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -1825,7 +1827,7 @@ TEST(OfflineCompilerTest, givenSpvOnlyOptionPassedWhenCmdLineParsedThenGenerateO
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-output",
|
||||
"myOutputFileName",
|
||||
"-spv_only",
|
||||
@@ -1860,7 +1862,7 @@ TEST(OfflineCompilerTest, GivenKernelWhenNoCharAfterKernelSourceThenBuildWithSuc
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/emptykernel.cl",
|
||||
clFiles + "emptykernel.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2041,7 +2043,7 @@ TEST(OfflineCompilerTest, givenIntermediateRepresentationInputWhenBuildSourceCod
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/emptykernel.cl",
|
||||
clFiles + "emptykernel.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2079,7 +2081,7 @@ TEST(OfflineCompilerTest, givenUseLlvmBcFlagWhenBuildingIrBinaryThenProperTransl
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/emptykernel.cl",
|
||||
clFiles + "emptykernel.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2100,13 +2102,13 @@ TEST(OfflineCompilerTest, givenUseLlvmBcFlagWhenBuildingIrBinaryThenProperTransl
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenBinaryInputThenDontTruncateSourceAtFirstZero) {
|
||||
std::vector<std::string> argvLlvm = {"ocloc", "-llvm_input", "-file", "test_files/binary_with_zeroes",
|
||||
std::vector<std::string> argvLlvm = {"ocloc", "-llvm_input", "-file", clFiles + "binary_with_zeroes",
|
||||
"-device", gEnvironment->devicePrefix.c_str()};
|
||||
auto mockOfflineCompiler = std::make_unique<MockOfflineCompiler>();
|
||||
mockOfflineCompiler->initialize(argvLlvm.size(), argvLlvm);
|
||||
EXPECT_LT(0U, mockOfflineCompiler->sourceCode.size());
|
||||
|
||||
std::vector<std::string> argvSpirV = {"ocloc", "-spirv_input", "-file", "test_files/binary_with_zeroes",
|
||||
std::vector<std::string> argvSpirV = {"ocloc", "-spirv_input", "-file", clFiles + "binary_with_zeroes",
|
||||
"-device", gEnvironment->devicePrefix.c_str()};
|
||||
mockOfflineCompiler = std::make_unique<MockOfflineCompiler>();
|
||||
mockOfflineCompiler->initialize(argvSpirV.size(), argvSpirV);
|
||||
@@ -2125,7 +2127,7 @@ TEST(OfflineCompilerTest, givenSpirvInputFileWhenCmdLineHasOptionsThenCorrectOpt
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/emptykernel.cl",
|
||||
clFiles + "emptykernel.cl",
|
||||
"-spirv_input",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
@@ -2150,7 +2152,7 @@ TEST(OfflineCompilerTest, givenOutputFileOptionWhenSourceIsCompiledThenOutputFil
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-output",
|
||||
"myOutputFileName",
|
||||
"-device",
|
||||
@@ -2178,7 +2180,7 @@ TEST(OfflineCompilerTest, givenDebugDataAvailableWhenSourceIsBuiltThenDebugDataF
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-output",
|
||||
"myOutputFileName",
|
||||
"-device",
|
||||
@@ -2236,14 +2238,14 @@ TEST(OfflineCompilerTest, givenInputOptionsAndInternalOptionsFilesWhenOfflineCom
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
ASSERT_TRUE(fileExists("test_files/shouldfail_options.txt"));
|
||||
ASSERT_TRUE(fileExists("test_files/shouldfail_internal_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "shouldfail_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "shouldfail_internal_options.txt"));
|
||||
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/shouldfail.cl",
|
||||
clFiles + "shouldfail.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2269,13 +2271,13 @@ TEST(OfflineCompilerTest, givenInputOptionsFileWithSpecialCharsWhenOfflineCompil
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
ASSERT_TRUE(fileExists("test_files/simple_kernels_opts_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "simple_kernels_opts_options.txt"));
|
||||
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/simple_kernels_opts.cl",
|
||||
clFiles + "simple_kernels_opts.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2290,13 +2292,13 @@ TEST(OfflineCompilerTest, givenInputOptionsAndOclockOptionsFileWithForceStosOptW
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
ASSERT_TRUE(fileExists("test_files/stateful_copy_buffer_ocloc_options.txt"));
|
||||
ASSERT_TRUE(fileExists(clFiles + "stateful_copy_buffer_ocloc_options.txt"));
|
||||
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/stateful_copy_buffer.cl",
|
||||
clFiles + "stateful_copy_buffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2486,8 +2488,8 @@ TEST(OfflineCompilerTest, givenCompilerWhenBuildSourceCodeFailsThenGenerateElfBi
|
||||
TEST(OfflineCompilerTest, givenDeviceSpecificKernelFileWhenCompilerIsInitializedThenOptionsAreReadFromFile) {
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
const char *kernelFileName = "test_files/kernel_for_specific_device.skl";
|
||||
const char *optionsFileName = "test_files/kernel_for_specific_device_options.txt";
|
||||
std::string kernelFileName(clFiles + "kernel_for_specific_device.skl");
|
||||
std::string optionsFileName(clFiles + "kernel_for_specific_device_options.txt");
|
||||
|
||||
ASSERT_TRUE(fileExists(kernelFileName));
|
||||
ASSERT_TRUE(fileExists(optionsFileName));
|
||||
@@ -2513,7 +2515,7 @@ TEST(OfflineCompilerTest, givenHexadecimalRevisionIdWhenCompilerIsInitializedThe
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-revision_id",
|
||||
@@ -2535,7 +2537,7 @@ TEST(OfflineCompilerTest, givenDebugVariableSetWhenInitializingThenOverrideRevis
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-revision_id",
|
||||
@@ -2554,7 +2556,7 @@ TEST(OfflineCompilerTest, givenDecimalRevisionIdWhenCompilerIsInitializedThenPas
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-revision_id",
|
||||
@@ -2573,7 +2575,7 @@ TEST(OfflineCompilerTest, givenNoRevisionIdWhenCompilerIsInitializedThenHwInfoHa
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2601,7 +2603,7 @@ TEST(OfflineCompilerTest, whenDeviceIsSpecifiedThenDefaultConfigFromTheDeviceIsU
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2669,7 +2671,7 @@ TEST(OclocCompile, whenDetectedPotentialInputTypeMismatchThenEmitsWarning) {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
@@ -2711,7 +2713,7 @@ TEST(OclocCompile, givenCommandLineWithoutDeviceWhenCompilingToSpirvThenSucceeds
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-spv_only"};
|
||||
|
||||
int retVal = ocloc.initialize(argv.size(), argv);
|
||||
@@ -2728,7 +2730,7 @@ TEST(OclocCompile, givenDeviceAndInternalOptionsOptionWhenCompilingToSpirvThenIn
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-internal_options",
|
||||
"-cl-ext=+custom_param",
|
||||
"-device",
|
||||
@@ -2751,7 +2753,7 @@ TEST(OclocCompile, givenNoDeviceAndInternalOptionsOptionWhenCompilingToSpirvThen
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-internal_options",
|
||||
"-cl-ext=+custom_param",
|
||||
"-spv_only"};
|
||||
@@ -2782,7 +2784,7 @@ TEST(OclocCompile, givenSpirvInputThenDontGenerateSpirvFile) {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/binary_with_zeroes",
|
||||
clFiles + "binary_with_zeroes",
|
||||
"-out_dir",
|
||||
"offline_compiler_test",
|
||||
"-device",
|
||||
@@ -2805,7 +2807,7 @@ TEST(OclocCompile, givenFormatFlagWithKnownFormatPassedThenEnforceSpecifiedForma
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-spv_only",
|
||||
"--format",
|
||||
"patchtokens"};
|
||||
@@ -2814,7 +2816,7 @@ TEST(OclocCompile, givenFormatFlagWithKnownFormatPassedThenEnforceSpecifiedForma
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-spv_only",
|
||||
"--format",
|
||||
"zebin"};
|
||||
@@ -2835,7 +2837,7 @@ TEST(OclocCompile, givenFormatFlagWithUnknownFormatPassedThenPrintWarning) {
|
||||
std::vector<std::string> argvUnknownFormatEnforced = {
|
||||
"ocloc",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
clFiles + "copybuffer.cl",
|
||||
"-spv_only",
|
||||
"--format",
|
||||
"banana"};
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
#include "shared/source/os_interface/linux/os_inc.h"
|
||||
#include "shared/source/os_interface/linux/os_memory_linux.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
@@ -104,7 +105,7 @@ TEST(OSMemoryLinux, givenOSMemoryLinuxWhenReserveCpuAddressRangeIsCalledAndBaseA
|
||||
TEST(OSMemoryLinux, GivenProcSelfMapsFileExistsWhenGetMemoryMapsIsQueriedThenValidValueIsReturned) {
|
||||
auto mockOSMemoryLinux = MockOSMemoryLinux::create();
|
||||
|
||||
std::string mapsFile = "test_files/linux/proc/self/maps";
|
||||
std::string mapsFile(std::string(Os::sysFsProcPathPrefix) + "self/maps");
|
||||
EXPECT_TRUE(fileExists(mapsFile));
|
||||
|
||||
OSMemory::MemoryMaps memoryMaps;
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/source/os_interface/linux/os_inc.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/test/common/fixtures/memory_management_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/helpers/test_files.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
#include "shared/test/common/mocks/linux/mock_os_context_linux.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
@@ -27,6 +29,13 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
std::string getLinuxDevicesPath(const char *file) {
|
||||
std::string resultString(Os::sysFsPciPathPrefix);
|
||||
resultString += file;
|
||||
|
||||
return resultString;
|
||||
}
|
||||
|
||||
TEST(DrmTest, WhenGettingDeviceIdThenCorrectIdReturned) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
@@ -886,7 +895,7 @@ TEST(DrmQueryTest, GivenNonTileArchitectureWhenFrequencyIsQueriedThenFallbackToL
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 0;
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true;
|
||||
|
||||
std::string gtMaxFreqFile = "test_files/linux/devices/device/drm/card1/gt_max_freq_mhz";
|
||||
std::string gtMaxFreqFile = getLinuxDevicesPath("device/drm/card1/gt_max_freq_mhz");
|
||||
EXPECT_TRUE(fileExists(gtMaxFreqFile));
|
||||
|
||||
drm.setPciPath("device");
|
||||
@@ -909,7 +918,7 @@ TEST(DrmQueryTest, GivenTileArchitectureIsInvalidWhenFrequencyIsQueriedThenFallb
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 2;
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.IsValid = false;
|
||||
|
||||
std::string gtMaxFreqFile = "test_files/linux/devices/device/drm/card1/gt_max_freq_mhz";
|
||||
std::string gtMaxFreqFile = getLinuxDevicesPath("device/drm/card1/gt_max_freq_mhz");
|
||||
EXPECT_TRUE(fileExists(gtMaxFreqFile));
|
||||
|
||||
drm.setPciPath("device");
|
||||
@@ -932,7 +941,7 @@ TEST(DrmQueryTest, GivenRpsMaxFreqFileExistsWhenFrequencyIsQueriedThenValidValue
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 1;
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true;
|
||||
|
||||
std::string rpsMaxFreqFile = "test_files/linux/devices/device/drm/card1/gt/gt0/rps_max_freq_mhz";
|
||||
std::string rpsMaxFreqFile = getLinuxDevicesPath("device/drm/card1/gt/gt0/rps_max_freq_mhz");
|
||||
EXPECT_TRUE(fileExists(rpsMaxFreqFile));
|
||||
|
||||
drm.setPciPath("device");
|
||||
@@ -955,7 +964,7 @@ TEST(DrmQueryTest, GivenRpsMaxFreqFilesExistWhenFrequenciesAreQueriedThenValidVa
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 2;
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true;
|
||||
|
||||
std::string rpsMaxFreqFile = "test_files/linux/devices/device/drm/card1/gt/gt1/rps_max_freq_mhz";
|
||||
std::string rpsMaxFreqFile = getLinuxDevicesPath("device/drm/card1/gt/gt1/rps_max_freq_mhz");
|
||||
EXPECT_TRUE(fileExists(rpsMaxFreqFile));
|
||||
|
||||
drm.setPciPath("device");
|
||||
@@ -978,10 +987,10 @@ TEST(DrmQueryTest, GivenRpsMaxFreqFileDoesntExistWhenFrequencyIsQueriedThenFallb
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 3;
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true;
|
||||
|
||||
std::string rpsMaxFreqFile = "test_files/linux/devices/device/drm/card1/gt/gt2/rps_max_freq_mhz";
|
||||
std::string rpsMaxFreqFile = getLinuxDevicesPath("device/drm/card1/gt/gt2/rps_max_freq_mhz");
|
||||
EXPECT_FALSE(fileExists(rpsMaxFreqFile));
|
||||
|
||||
std::string gtMaxFreqFile = "test_files/linux/devices/device/drm/card1/gt_max_freq_mhz";
|
||||
std::string gtMaxFreqFile = getLinuxDevicesPath("device/drm/card1/gt_max_freq_mhz");
|
||||
EXPECT_TRUE(fileExists(gtMaxFreqFile));
|
||||
|
||||
drm.setPciPath("device");
|
||||
@@ -1007,7 +1016,7 @@ TEST(DrmQueryTest, givenUapiPrelimVersionThenReturnCorrectString) {
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
|
||||
std::string prelimVersionFile = "test_files/linux/devices/device/drm/card1/prelim_uapi_version";
|
||||
std::string prelimVersionFile = getLinuxDevicesPath("device/drm/card1/prelim_uapi_version");
|
||||
EXPECT_TRUE(fileExists(prelimVersionFile));
|
||||
|
||||
drm.setPciPath("device");
|
||||
|
||||
@@ -10,10 +10,13 @@
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
std::string testFiles("test_files/" NEO_ARCH "/");
|
||||
std::string testFilesApiSpecific("test_files/" NEO_ARCH "/");
|
||||
std::string clFiles("test_files/");
|
||||
std::string sharedFiles(NEO_SHARED_TEST_FILES_DIR);
|
||||
std::string sharedBuiltinsDir(NEO_SHARED_BUILTINS_DIR);
|
||||
std::string binaryNameSuffix("");
|
||||
|
||||
void retrieveBinaryKernelFilename(std::string &outputFilename, const std::string &kernelName, const std::string &extension, const std::string &options) {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
extern std::string testFiles;
|
||||
extern std::string testFilesApiSpecific;
|
||||
extern std::string sharedFiles;
|
||||
extern std::string sharedBuiltinsDir;
|
||||
extern std::string clFiles;
|
||||
extern std::string binaryNameSuffix;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,22 +7,27 @@
|
||||
|
||||
#include "shared/source/utilities/directory.h"
|
||||
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <dirent.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
std::string byPathPattern(std::string(NEO_SHARED_TEST_FILES_DIR) + "/linux/by-path");
|
||||
std::string deviceDrmPath(std::string(NEO_SHARED_TEST_FILES_DIR) + "/linux/devices/device/drm");
|
||||
|
||||
std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
std::vector<std::string> files;
|
||||
if (path == "./test_files/linux/by-path") {
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:02.0-card");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:02.0-render");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:03.0-card");
|
||||
files.push_back("./test_files/linux/by-path/pci-0000:00:03.0-render");
|
||||
if (path == byPathPattern) {
|
||||
files.push_back(byPathPattern + "/pci-0000:00:02.0-card");
|
||||
files.push_back(byPathPattern + "/pci-0000:00:02.0-render");
|
||||
files.push_back(byPathPattern + "/pci-0000:00:03.0-card");
|
||||
files.push_back(byPathPattern + "/pci-0000:00:03.0-render");
|
||||
return files;
|
||||
}
|
||||
if (path == "./test_files/linux/devices/device/drm") {
|
||||
files.push_back("./test_files/linux/devices/device/drm/card1");
|
||||
if (path == deviceDrmPath) {
|
||||
files.push_back(deviceDrmPath + "/card1");
|
||||
return files;
|
||||
}
|
||||
if (path == "/sys/class/intel_pmt") {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "common/gtsysinfo.h"
|
||||
#include "igfxfmid.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
namespace Os {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,9 +25,9 @@ const char *metricsLibraryDllName = "";
|
||||
const char *gdiDllName = "";
|
||||
const char *dxcoreDllName = "";
|
||||
#endif
|
||||
const char *sysFsPciPathPrefix = "./test_files/linux/devices/";
|
||||
const char *pciDevicesDirectory = "./test_files/linux/by-path";
|
||||
const char *sysFsProcPathPrefix = "./test_files/linux/proc/";
|
||||
const char *sysFsPciPathPrefix = NEO_SHARED_TEST_FILES_DIR "/linux/devices/";
|
||||
const char *pciDevicesDirectory = NEO_SHARED_TEST_FILES_DIR "/linux/by-path";
|
||||
const char *sysFsProcPathPrefix = NEO_SHARED_TEST_FILES_DIR "/linux/proc/";
|
||||
} // namespace Os
|
||||
|
||||
NEO::OsLibrary *setAdapterInfo(const PLATFORM *platform, const GT_SYSTEM_INFO *gtSystemInfo, uint64_t gpuAddressSpace) {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
@@ -68,7 +69,7 @@ int open(const char *file, int flags) {
|
||||
if (strcmp(file, "/dev/dri/by-path/pci-0000:invalid-render") == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(file, "./test_files/linux/by-path/pci-0000:00:02.0-render") == 0) {
|
||||
if (strcmp(file, NEO_SHARED_TEST_FILES_DIR "/linux/by-path/pci-0000:00:02.0-render") == 0) {
|
||||
return fakeFileDescriptor;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,23 +49,6 @@ function(compile_kernels_gen platform_name_with_type revision_id platform_name s
|
||||
set(compiled_kernels_${platform_name_with_type}_${revision_id} ${compiled_kernels_${platform_name_with_type}_${revision_id}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(neo_shared_copy_test_files target product revision_id)
|
||||
string(TOLOWER ${product} product)
|
||||
set(dest_dir "${TargetDir}/${product}/${revision_id}/test_files")
|
||||
set(source_dir "${NEO_SOURCE_DIR}/shared/test/common/test_files")
|
||||
add_custom_target(${target})
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND echo copying test files from ${source_dir} to ${dest_dir}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${source_dir} ${dest_dir}
|
||||
WORKING_DIRECTORY ${TargetDir}
|
||||
DEPENDS ${source_dir}
|
||||
)
|
||||
add_dependencies(${target} copy_compiler_files)
|
||||
set_target_properties(${target} PROPERTIES FOLDER "${SHARED_TEST_PROJECTS_FOLDER}/${SHARED_TEST_PROJECTS_SUB_FOLDER}/${PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}/${revision_id}")
|
||||
endfunction()
|
||||
|
||||
file(GLOB_RECURSE TEST_KERNELS *.cl)
|
||||
file(GLOB_RECURSE TEST_KERNELS_IMAGES *_images.cl)
|
||||
add_custom_target(prepare_test_kernels_for_shared)
|
||||
@@ -80,8 +63,7 @@ macro(macro_for_each_platform)
|
||||
foreach(PLATFORM_TYPE ${PLATFORM_TYPES})
|
||||
foreach(REVISION_ID ${${PLATFORM_TYPE}_${CORE_TYPE}_REVISIONS})
|
||||
if(${PLATFORM_IT}_IS_${PLATFORM_TYPE})
|
||||
neo_shared_copy_test_files(copy_test_kernel_${PLATFORM_IT_LOWER}_${REVISION_ID} ${PLATFORM_IT} ${REVISION_ID})
|
||||
add_dependencies(prepare_test_kernels_for_shared copy_test_kernel_${PLATFORM_IT_LOWER}_${REVISION_ID})
|
||||
add_dependencies(prepare_test_kernels_for_shared copy_compiler_files)
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "shared/test/unit_test/tests_configuration.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "test_files_setup.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
@@ -320,6 +321,10 @@ int main(int argc, char **argv) {
|
||||
testBinaryFiles.append(testFiles);
|
||||
testFiles = testBinaryFiles;
|
||||
|
||||
std::string nClFiles = NEO_SHARED_TEST_FILES_DIR;
|
||||
nClFiles.append("/");
|
||||
clFiles = nClFiles;
|
||||
|
||||
std::string executionDirectory(hardwarePrefix[productFamily]);
|
||||
executionDirectory += NEO::executionDirectorySuffix; // _aub for aub_tests, empty otherwise
|
||||
executionDirectory += "/";
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
using namespace NEO;
|
||||
|
||||
TEST(CpuInfoAarch64, givenProcCpuinfoFileExistsWhenIsCpuFlagPresentIsCalledThenValidValueIsReturned) {
|
||||
VariableBackup<const char *> pathPrefixBackup(&Os::sysFsProcPathPrefix, "./test_files");
|
||||
std::string cpuinfoFile = "./test_files/cpuinfo";
|
||||
VariableBackup<const char *> pathPrefixBackup(&Os::sysFsProcPathPrefix, ".");
|
||||
std::string cpuinfoFile = "cpuinfo";
|
||||
EXPECT_FALSE(fileExists(cpuinfoFile));
|
||||
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ TEST(SettingsFileReader, givenTestFileWithDefaultValuesWhenTheyAreQueriedThenDef
|
||||
|
||||
// Use test settings file
|
||||
std::unique_ptr<TestSettingsFileReader> reader =
|
||||
std::unique_ptr<TestSettingsFileReader>(new TestSettingsFileReader(TestSettingsFileReader::testPath));
|
||||
std::unique_ptr<TestSettingsFileReader>(new TestSettingsFileReader(TestSettingsFileReader::getTestPath().c_str()));
|
||||
|
||||
ASSERT_NE(nullptr, reader);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
#include "shared/source/utilities/debug_file_reader.h"
|
||||
#include "shared/test/common/helpers/test_files.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
@@ -35,13 +36,14 @@ class TestSettingsFileReader : public SettingsFileReader {
|
||||
return settingStringMap.size();
|
||||
}
|
||||
|
||||
static const char *testPath;
|
||||
static const char *stringTestPath;
|
||||
static const std::string getTestPath() {
|
||||
return clFiles + "igdrcl.config";
|
||||
}
|
||||
static const std::string getStringTestPath() {
|
||||
return clFiles + "igdrcl_string.config";
|
||||
}
|
||||
};
|
||||
|
||||
const char *TestSettingsFileReader::testPath = "./test_files/igdrcl.config";
|
||||
const char *TestSettingsFileReader::stringTestPath = "./test_files/igdrcl_string.config";
|
||||
|
||||
TEST(SettingsFileReader, GivenFilesDoesNotExistWhenCreatingFileReaderThenCreationSucceeds) {
|
||||
bool settingsFileExists = fileExists(SettingsReader::settingsFileName);
|
||||
|
||||
@@ -59,7 +61,7 @@ TEST(SettingsFileReader, GivenFilesDoesNotExistWhenCreatingFileReaderThenCreatio
|
||||
|
||||
TEST(SettingsFileReader, WhenGettingSettingThenCorrectStringValueIsReturned) {
|
||||
// Use test settings file
|
||||
auto reader = std::make_unique<TestSettingsFileReader>(TestSettingsFileReader::stringTestPath);
|
||||
auto reader = std::make_unique<TestSettingsFileReader>(TestSettingsFileReader::getStringTestPath().c_str());
|
||||
ASSERT_NE(nullptr, reader);
|
||||
|
||||
std::string retValue;
|
||||
@@ -82,7 +84,7 @@ TEST(SettingsFileReader, WhenGettingSettingThenCorrectStringValueIsReturned) {
|
||||
}
|
||||
|
||||
TEST(SettingsFileReader, givenDebugFileSettingInWhichStringIsFollowedByIntegerWhenItIsParsedThenProperValuesAreObtained) {
|
||||
auto reader = std::make_unique<TestSettingsFileReader>(TestSettingsFileReader::stringTestPath);
|
||||
auto reader = std::make_unique<TestSettingsFileReader>(TestSettingsFileReader::getStringTestPath().c_str());
|
||||
ASSERT_NE(nullptr, reader.get());
|
||||
|
||||
int32_t retValue = 0;
|
||||
@@ -103,7 +105,7 @@ TEST(SettingsFileReader, givenDebugFileSettingInWhichStringIsFollowedByIntegerWh
|
||||
TEST(SettingsFileReader, GivenSettingNotInFileWhenGettingSettingThenProvidedDefaultIsReturned) {
|
||||
|
||||
// Use test settings file
|
||||
auto reader = std::make_unique<TestSettingsFileReader>(TestSettingsFileReader::testPath);
|
||||
auto reader = std::make_unique<TestSettingsFileReader>(TestSettingsFileReader::getTestPath().c_str());
|
||||
ASSERT_NE(nullptr, reader);
|
||||
|
||||
bool defaultBoolValue = false;
|
||||
@@ -123,7 +125,7 @@ TEST(SettingsFileReader, GivenSettingNotInFileWhenGettingSettingThenProvidedDefa
|
||||
}
|
||||
|
||||
TEST(SettingsFileReader, WhenGettingAppSpecificLocationThenCorrectLocationIsReturned) {
|
||||
std::unique_ptr<TestSettingsFileReader> reader(new TestSettingsFileReader(TestSettingsFileReader::testPath));
|
||||
std::unique_ptr<TestSettingsFileReader> reader(new TestSettingsFileReader(TestSettingsFileReader::getTestPath().c_str()));
|
||||
std::string appSpecific = "cl_cache_dir";
|
||||
EXPECT_EQ(appSpecific, reader->appSpecificLocation(appSpecific));
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
using namespace NEO;
|
||||
|
||||
TEST(CpuInfo, givenProcCpuinfoFileExistsWhenIsCpuFlagPresentIsCalledThenValidValueIsReturned) {
|
||||
VariableBackup<const char *> pathPrefixBackup(&Os::sysFsProcPathPrefix, "./test_files");
|
||||
std::string cpuinfoFile = "./test_files/cpuinfo";
|
||||
VariableBackup<const char *> pathPrefixBackup(&Os::sysFsProcPathPrefix, ".");
|
||||
std::string cpuinfoFile = "cpuinfo";
|
||||
EXPECT_FALSE(fileExists(cpuinfoFile));
|
||||
|
||||
{
|
||||
|
||||
15
test_files_setup.h.in
Normal file
15
test_files_setup.h.in
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TEST_FILES_SETUP_H
|
||||
#define TEST_FILES_SETUP_H
|
||||
|
||||
#cmakedefine NEO_SHARED_BUILTINS_DIR "${NEO_SHARED_BUILTINS_DIR}"
|
||||
#cmakedefine NEO_SHARED_TEST_FILES_DIR "${NEO_SHARED_TEST_FILES_DIR}"
|
||||
#cmakedefine NEO_OPENCL_TEST_FILES_DIR "${NEO_OPENCL_TEST_FILES_DIR}"
|
||||
|
||||
#endif /* TEST_FILES_SETUP_H */
|
||||
Reference in New Issue
Block a user