[mtouch tests] Allow creating temporary apps/extensions multiple times without re-creating temporary directories.
Allow creating temporary apps/extensions multiple times without re-creating temporary directories. This makes it possible for tests to call CreateTemporaryApp|Extension multiple times with different code, and have only the actual managed assembly change between each time (which is useful for tests that verifies that cached builds are used properly).
This commit is contained in:
Родитель
2f8064a6e4
Коммит
62c08fd233
|
@ -477,8 +477,14 @@ namespace Xamarin
|
|||
|
||||
public void CreateTemporararyServiceExtension (string code = null, string extraCode = null, string extraArg = null, string appName = "testServiceExtension")
|
||||
{
|
||||
var testDir = CreateTemporaryDirectory ();
|
||||
var app = Path.Combine (testDir, $"{appName}.appex");
|
||||
string testDir;
|
||||
if (RootAssembly == null) {
|
||||
testDir = CreateTemporaryDirectory ();
|
||||
} else {
|
||||
// We're rebuilding an existing executable, so just reuse that
|
||||
testDir = Path.GetDirectoryName (RootAssembly);
|
||||
}
|
||||
var app = AppPath ?? Path.Combine (testDir, $"{appName}.appex");
|
||||
Directory.CreateDirectory (app);
|
||||
|
||||
if (code == null) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче