-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from SharpGenTools/msbuild-cleanup
Add included files to the MSBuild Up-to-Date checks.
- Loading branch information
Showing
11 changed files
with
130 additions
and
25 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,47 @@ | ||
using SharpGen.Config; | ||
using SharpGen.Parser; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Text; | ||
using Xunit; | ||
|
||
namespace SharpGen.UnitTests.Parsing | ||
{ | ||
public class MacroManagerTests : ParsingTestBase | ||
{ | ||
public MacroManagerTests(Xunit.Abstractions.ITestOutputHelper outputHelper) | ||
: base(outputHelper) | ||
{ | ||
} | ||
|
||
[Fact] | ||
public void MacroManagerCollectsIncludedHeaders() | ||
{ | ||
CreateCppFile("included", ""); | ||
|
||
var includeRule = GetTestFileIncludeRule(); | ||
|
||
var config = new ConfigFile | ||
{ | ||
Id = nameof(MacroManagerCollectsIncludedHeaders), | ||
Assembly = nameof(MacroManagerCollectsIncludedHeaders), | ||
Namespace = nameof(MacroManagerCollectsIncludedHeaders), | ||
IncludeDirs = { includeRule }, | ||
Includes = | ||
{ | ||
CreateCppFile("includer", "#include \"included.h\"") | ||
} | ||
}; | ||
|
||
var castXml = GetCastXml(ConfigFile.Load(config, Array.Empty<string>(), Logger)); | ||
|
||
var macroManager = new MacroManager(castXml); | ||
|
||
macroManager.Parse(Path.Combine(includeRule.Path, "includer.h"), new CppModel.CppModule()); | ||
|
||
Assert.Contains(includeRule.Path + "/included.h", | ||
macroManager.IncludedFiles); | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
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
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