-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
When working on #143330, the "right" thing to do is delete intermediates:
static fml::UniqueFD CreateIntermediatesDirectory() {
auto test_name = flutter::testing::GetCurrentTestName();
std::replace(test_name.begin(), test_name.end(), '/', '_');
std::replace(test_name.begin(), test_name.end(), '.', '_');
return fml::OpenDirectory(flutter::testing::OpenFixturesDirectory(),
test_name.c_str(),
true, // create if necessary
fml::FilePermission::kReadWrite);
}
CompilerTest::CompilerTest()
: intermediates_directory_(CreateIntermediatesDirectory()) {
FML_CHECK(intermediates_directory_.is_valid());
}
- CompilerTest::~CompilerTest() = default;
+ CompilerTest::~CompilerTest() {
+ fml::DeleteDirectory(flutter::testing::OpenFixturesDirectory(),
+ test_name.c_str());
+ }However, fml::DeleteDirectory does not exist. I looked into the fml::<File I/O> related methods, and they are very minimal, and from what I heard, are not consistent across platforms (i.e. the WriteAtomically method is not actually atomic on Windows).
One suggestion from @jonahwilliams was, in the future, we move the File I/O and effectively "main()" of impellerc to Dart, and just use dart:io.
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team