-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add capability for persisting the state of IkvmFileIdentityUtil and I…
…kvmAssemblyInfoUtil between runs of the tasks that use them. This should cut down on run time, preventing examination of files between runs that have already been examined. Does require that we retrieve write times each pass. But, even though these aren't great, they're still better than otherwise.
- Loading branch information
Showing
8 changed files
with
347 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.IO; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Xml.Linq; | ||
|
||
using FluentAssertions; | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace IKVM.MSBuild.Tasks.Tests | ||
{ | ||
|
||
[TestClass] | ||
public class IkvmFileIdentityUtilTests | ||
{ | ||
|
||
[TestMethod] | ||
public async Task CanSaveState() | ||
{ | ||
var u = new IkvmFileIdentityUtil(new IkvmAssemblyInfoUtil()); | ||
|
||
var f = Path.GetTempFileName(); | ||
File.WriteAllText(f, "TEST"); | ||
var i = await u.GetIdentityForFileAsync(f, CancellationToken.None); | ||
|
||
var x = new XElement("Test"); | ||
await u.SaveStateXmlAsync(x); | ||
|
||
x.Should().HaveElement("File").Which.Should().HaveAttribute("Path", f).And.HaveAttribute("Identity", i); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.