mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Improve coverage of ocloc_api
This change contains ULTs, which test the code which was not covered. Related-To: NEO-6834 Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
5ea45c52e0
commit
4bebb477d4
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -16,6 +16,12 @@
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
void (*abortOclocExecution)(int) = abortOclocExecutionDefaultHandler;
|
||||
|
||||
void abortOclocExecutionDefaultHandler(int errorCode) {
|
||||
exit(errorCode);
|
||||
}
|
||||
|
||||
void addSlash(std::string &path) {
|
||||
if (!path.empty()) {
|
||||
auto lastChar = *path.rbegin();
|
||||
@ -37,7 +43,9 @@ std::vector<char> readBinaryFile(const std::string &fileName) {
|
||||
return binary;
|
||||
} else {
|
||||
printf("Error! Couldn't open %s\n", fileName.c_str());
|
||||
exit(1);
|
||||
abortOclocExecution(1);
|
||||
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,10 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
extern void (*abortOclocExecution)(int);
|
||||
|
||||
void abortOclocExecutionDefaultHandler(int errorCode);
|
||||
|
||||
void addSlash(std::string &path);
|
||||
|
||||
std::vector<char> readBinaryFile(const std::string &fileName);
|
||||
|
Reference in New Issue
Block a user