Files
compute-runtime/opencl/test/unit_test/offline_compiler/offline_compiler_tests.h
Fabian Zwolinski 8f1004e48a Clean-up output after each test unit in offline compiler
Aditionally fix:
- GivenSpecifiedOutputDirWithProductConfigValueWhenBuilding...
...MultiCommandThenSuccessIsReturned
- GivenArgsWhenBuildingWithDeviceConfigValueThenBuildSucceeds
tests which used files created by previously run tests.
Now both of these tests are a separate units.

Related-To: NEO-6606
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2022-02-07 13:40:21 +01:00

54 lines
1.5 KiB
C++

/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/offline_compiler/source/multi_command.h"
#include "shared/offline_compiler/source/ocloc_error_code.h"
#include "shared/offline_compiler/source/offline_compiler.h"
#include "opencl/test/unit_test/offline_compiler/mock/mock_argument_helper.h"
#include "gtest/gtest.h"
#include <cstdint>
#include <memory>
namespace NEO {
class OfflineCompilerTests : public ::testing::Test {
public:
OfflineCompiler *pOfflineCompiler = nullptr;
int retVal = OclocErrorCode::SUCCESS;
std::map<std::string, std::string> filesMap;
std::unique_ptr<MockOclocArgHelper> oclocArgHelperWithoutInput = std::make_unique<MockOclocArgHelper>(filesMap);
protected:
void SetUp() override {
oclocArgHelperWithoutInput->setAllCallBase(true);
}
};
class MultiCommandTests : public ::testing::Test {
public:
void createFileWithArgs(const std::vector<std::string> &, int numOfBuild);
void deleteFileWithArgs();
void deleteOutFileList();
MultiCommand *pMultiCommand = nullptr;
std::string nameOfFileWithArgs;
std::string outFileList;
int retVal = OclocErrorCode::SUCCESS;
std::map<std::string, std::string> filesMap;
std::unique_ptr<MockOclocArgHelper> oclocArgHelperWithoutInput = std::make_unique<MockOclocArgHelper>(filesMap);
protected:
void SetUp() override {
oclocArgHelperWithoutInput->setAllCallBase(true);
}
};
} // namespace NEO