[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:
Rolf Bjarne Kvinge 2017-01-31 09:11:41 +01:00
Родитель 2f8064a6e4
Коммит 62c08fd233
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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) {