| 67 | } |
| 68 | |
| 69 | static Result writePackageReceiptFixture(StringView packageRoot, StringView packageName, |
| 70 | Span<const Tools::PackageReceiptExport> exports) |
| 71 | { |
| 72 | FileSystem fs; |
| 73 | SC_TRY(fs.init(".")); |
| 74 | if (fs.existsAndIsDirectory(packageRoot)) |
| 75 | { |
| 76 | SC_TRY(fs.removeDirectoriesRecursive(packageRoot)); |
| 77 | } |
| 78 | SC_TRY(fs.makeDirectoryRecursive(packageRoot)); |
| 79 | |
| 80 | for (const Tools::PackageReceiptExport& packageExport : exports) |
| 81 | { |
| 82 | if (packageExport.relativePath == "."_a8) |
| 83 | { |
| 84 | continue; |
| 85 | } |
| 86 | |
| 87 | String exportedPath = StringEncoding::Utf8; |
| 88 | SC_TRY(Path::join(exportedPath, {packageRoot, packageExport.relativePath})); |
| 89 | SC_TRY(fs.makeDirectoryRecursive(Path::dirname(exportedPath.view(), Path::AsNative))); |
| 90 | SC_TRY(fs.writeString(exportedPath.view(), "fake")); |
| 91 | } |
| 92 | |
| 93 | Tools::Package package; |
| 94 | package.installDirectoryLink = packageRoot; |
| 95 | |
| 96 | Tools::PackageReceiptInfo info; |
| 97 | info.packageName = packageName; |
| 98 | info.packageVersion = "1"; |
| 99 | info.recipeVersion = "1"; |
| 100 | info.hostPlatform = "test"; |
| 101 | info.packageVariant = "host"; |
| 102 | info.source = "test"; |
| 103 | info.sourceHash = ""; |
| 104 | info.validation = "passed"; |
| 105 | const StringView phases[] = {"writeReceipt"}; |
| 106 | info.phases = phases; |
| 107 | return Tools::writePackageReceipt(package, info, exports); |
| 108 | } |
| 109 | |
| 110 | #if !SC_PLATFORM_WINDOWS |
| 111 | static Result writeFakeQEMURunner(FileSystem& fs, StringView path, StringView name) |
no test coverage detected