Write file to tmp directory (#141668)
This makes the test more portable. In google, the test was failing because a test cannot write to its own directory in a sandbox.
This commit is contained in:
@@ -74,8 +74,11 @@ TEST(OffloadingBundleTest, checkExtractCodeObject) {
|
||||
int64_t Offset = 8192;
|
||||
int64_t Size = 4048;
|
||||
|
||||
Error Err = extractCodeObject(**ObjOrErr, Offset, Size,
|
||||
StringRef("checkExtractCodeObject.co"));
|
||||
llvm::unittest::TempDir Tmp("tmpdir", /*Unique=*/true);
|
||||
SmallString<128> FileName(Tmp.path().begin(), Tmp.path().end());
|
||||
sys::path::append(FileName, "checkExtractCodeObject.co");
|
||||
|
||||
Error Err = extractCodeObject(**ObjOrErr, Offset, Size, StringRef(FileName));
|
||||
EXPECT_FALSE(errorToBool(std::move(Err)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user