mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Improve error reporting in ocloc
Related-To: NEO-6425 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0606e8ddf3
commit
f0a9533c83
@ -413,6 +413,33 @@ TEST(OclocApiTests, givenInvalidOclocOptionsFileWhenCmdlineIsPrintedThenTheyAreP
|
||||
EXPECT_FALSE(output.find("Building with ocloc options:") != std::string::npos);
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, givenInvalidOclocOptionsFileWhenCmdlineIsPrintedThenTheyAreNotPrinted) {
|
||||
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",
|
||||
"-qq",
|
||||
"-file",
|
||||
clFileName.c_str(),
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
unsigned int argc = sizeof(argv) / sizeof(const char *);
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
int retVal = oclocInvoke(argc, argv,
|
||||
0, nullptr, nullptr, nullptr,
|
||||
0, nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr, nullptr, nullptr);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_NE(retVal, NEO::OclocErrorCode::SUCCESS);
|
||||
|
||||
EXPECT_FALSE(output.find("Failed with ocloc options from file:\n"
|
||||
"-invalid_ocloc_option") != std::string::npos);
|
||||
EXPECT_FALSE(output.find("Building with ocloc options:") != std::string::npos);
|
||||
}
|
||||
|
||||
TEST(OclocApiTests, GivenIncludeHeadersWhenCompilingThenPassesToFclHeadersPackedAsElf) {
|
||||
auto prevFclDebugVars = NEO::getFclDebugVars();
|
||||
auto debugVars = prevFclDebugVars;
|
||||
|
Reference in New Issue
Block a user