mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
ocloc - log output
Change-Id: I2a61b392e05033f963e502a90fe608b742c179a9
This commit is contained in:
@@ -62,7 +62,7 @@ TEST_F(MultiCommandTests, MultiCommandSuccessfulBuildTest) {
|
||||
int numOfBuild = 4;
|
||||
createFileWithArgs(singleArgs, numOfBuild);
|
||||
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, uniqueHelper.get()));
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, oclocArgHelperWithoutInput.get()));
|
||||
|
||||
EXPECT_NE(nullptr, pMultiCommand);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -87,7 +87,7 @@ TEST_F(MultiCommandTests, MultiCommandSuccessfulBuildWithOutputFileTest) {
|
||||
int numOfBuild = 4;
|
||||
createFileWithArgs(singleArgs, numOfBuild);
|
||||
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, uniqueHelper.get()));
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, oclocArgHelperWithoutInput.get()));
|
||||
|
||||
EXPECT_NE(nullptr, pMultiCommand);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -121,7 +121,7 @@ TEST_F(MultiCommandTests, GoodMultiBuildTestWithspecifiedOutputDir) {
|
||||
int numOfBuild = 4;
|
||||
createFileWithArgs(singleArgs, numOfBuild);
|
||||
|
||||
pMultiCommand = MultiCommand::create(argv, retVal, uniqueHelper.get());
|
||||
pMultiCommand = MultiCommand::create(argv, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pMultiCommand);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -146,7 +146,7 @@ TEST_F(MultiCommandTests, LackOfTxtFileWithArgsMultiTest) {
|
||||
};
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, uniqueHelper.get()));
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, oclocArgHelperWithoutInput.get()));
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
|
||||
EXPECT_STRNE(output.c_str(), "");
|
||||
@@ -172,10 +172,9 @@ TEST_F(MultiCommandTests, LackOfClFilePointedInTxtFileMultiTest) {
|
||||
int numOfBuild = 4;
|
||||
createFileWithArgs(singleArgs, numOfBuild);
|
||||
testing::internal::CaptureStdout();
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, uniqueHelper.get()));
|
||||
auto pMultiCommand = std::unique_ptr<MultiCommand>(MultiCommand::create(argv, retVal, oclocArgHelperWithoutInput.get()));
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
|
||||
EXPECT_STRNE(output.c_str(), "");
|
||||
EXPECT_EQ(nullptr, pMultiCommand);
|
||||
EXPECT_EQ(INVALID_FILE, retVal);
|
||||
DebugManager.flags.PrintDebugMessages.set(false);
|
||||
@@ -202,7 +201,7 @@ TEST_F(MultiCommandTests, GoodMultiBuildTestWithOutputFileListFlag) {
|
||||
int numOfBuild = 4;
|
||||
createFileWithArgs(singleArgs, numOfBuild);
|
||||
|
||||
pMultiCommand = MultiCommand::create(argv, retVal, uniqueHelper.get());
|
||||
pMultiCommand = MultiCommand::create(argv, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pMultiCommand);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -228,7 +227,7 @@ TEST_F(OfflineCompilerTests, GoodArgTest) {
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pOfflineCompiler);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -257,7 +256,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTest) {
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pOfflineCompiler);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -285,7 +284,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTestWithLlvmText) {
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-llvm_text"};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pOfflineCompiler);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -323,7 +322,7 @@ TEST_F(OfflineCompilerTests, GoodParseBinToCharArray) {
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
// clang-format off
|
||||
uint8_t binary[] = {
|
||||
0x02, 0x23, 0x3, 0x40, 0x56, 0x7, 0x80, 0x90, 0x1, 0x03,
|
||||
@@ -367,7 +366,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTestWithCppFile) {
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-cpp_file"};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pOfflineCompiler);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -391,7 +390,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTestWithOutputDir) {
|
||||
"-out_dir",
|
||||
"offline_compiler_test"};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pOfflineCompiler);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -410,7 +409,7 @@ TEST_F(OfflineCompilerTests, PrintUsage) {
|
||||
"--help"};
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_EQ(nullptr, pOfflineCompiler);
|
||||
EXPECT_STRNE("", output.c_str());
|
||||
@@ -428,7 +427,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_File) {
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_STRNE(output.c_str(), "");
|
||||
EXPECT_EQ(nullptr, pOfflineCompiler);
|
||||
@@ -446,7 +445,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_Flag) {
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_STRNE(output.c_str(), "");
|
||||
EXPECT_EQ(nullptr, pOfflineCompiler);
|
||||
@@ -462,7 +461,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_NumArgs) {
|
||||
};
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argvA.size(), argvA, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argvA.size(), argvA, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_STRNE(output.c_str(), "");
|
||||
|
||||
@@ -477,7 +476,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_NumArgs) {
|
||||
"test_files/ImANaughtyFile.cl",
|
||||
"-device"};
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argvB.size(), argvB, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argvB.size(), argvB, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_STRNE(output.c_str(), "");
|
||||
EXPECT_EQ(nullptr, pOfflineCompiler);
|
||||
@@ -495,7 +494,7 @@ TEST_F(OfflineCompilerTests, GivenNonexistantDeviceWhenCompilingThenExitWithErro
|
||||
"foobar"};
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_STREQ(output.c_str(), "Error: Cannot get HW Info for device foobar.\n");
|
||||
EXPECT_EQ(nullptr, pOfflineCompiler);
|
||||
@@ -510,7 +509,7 @@ TEST_F(OfflineCompilerTests, NaughtyKernelTest) {
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str()};
|
||||
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, uniqueHelper.get());
|
||||
pOfflineCompiler = OfflineCompiler::create(argv.size(), argv, true, retVal, oclocArgHelperWithoutInput.get());
|
||||
|
||||
EXPECT_NE(nullptr, pOfflineCompiler);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
Reference in New Issue
Block a user