diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2017-10-17 02:09:30 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-10-17 10:24:48 +0300 |
commit | 606f40e708fa8d05c2ec9369b9bde489d1f5718a (patch) | |
tree | d4d6d1979fd2e4f324c5ec594103ef76d513cce2 /mcs | |
parent | 66f11a1699f2fe1353fda06da5fc8621356a24c4 (diff) |
[corlib] Fix SRE.SaveTest error during teardown on Windows
When I added temp dir handling to SaveTest in https://github.com/mono/mono/pull/5727
I copied the Setup/TearDown from TypeBuilderTest.
However that class doesn't actually save+load the assemblies so
it doesn't run into the issue on Windows where assemblies can't
be deleted because they're still loaded in the AppDomain.
To fix this follow CustomAttributeBuilderTest and ModuleBuilderTest,
i.e. just catch all Exception's in teardown...
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs index 6992aeb8bed..b42ad25a899 100644 --- a/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs +++ b/mcs/class/corlib/Test/System.Reflection.Emit/SaveTest.cs @@ -83,10 +83,10 @@ public class SaveTest protected void TearDown () { try { + // This throws an exception under MS.NET, since the directory contains loaded + // assemblies. Directory.Delete (tempDir, true); - } catch (DirectoryNotFoundException) { - } catch (IOException) { - // Can happen on Windows if assemblies from this dir are still used + } catch (Exception) { } } |