Skip to content

Commit cd7f7a8

Browse files
jonpryoratsushieno
authored andcommitted
[generator-Tests] Ignore .fixed files (#59)
Commit 3b038a8 broke `make run-tests` because starting with 3b038a8 `generator` would emit an `api.xml.fixed` file into the output directory, which wasn't present in the source directory. This resulted in a unit test execution failures when running `generator-Tests.dll`: generatortests.Adapters.GeneratedOK : Expected out/Adapters/Adapters.xml.fixed but it was not generated. at generatortests.BaseGeneratorTest.CompareOutputs (System.String sourceDir, System.String destinationDir) [0x0004f] in .../Java.Interop/tools/generator/Tests/BaseGeneratorTest.cs:57 at generatortests.BaseGeneratorTest.Run (CodeGenerationTarget target, System.String outputPath, System.String apiDescriptionFile, System.String expectedPath, System.String[] additionalSupportPaths) [0x0004a] in .../Java.Interop/tools/generator/Tests/BaseGeneratorTest.cs:112 at generatortests.BaseGeneratorTest.RunAllTargets (System.String outputRelativePath, System.String apiDescriptionFile, System.String expectedRelativePath, System.String[] additionalSupportPaths) [0x0001c] in .../Java.Interop/tools/generator/Tests/BaseGeneratorTest.cs:95 at generatortests.Adapters.GeneratedOK () [0x0001f] in .../Java.Interop/tools/generator/Tests/Adapters.cs:12 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.4.0-c7sr0/bockbuild-mono-4.4.0-branch-c7sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:295 Fix this error by ignoring the `api.xml.fixed` files.
1 parent 46e58ef commit cd7f7a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/generator/Tests/BaseGeneratorTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ protected void CompareOutputs (string sourceDir, string destinationDir)
5050
{
5151
var files = Directory.GetFiles (sourceDir);
5252
foreach (var file in files) {
53-
if (Path.GetExtension (file) == ".xml")
53+
var extension = Path.GetExtension (file);
54+
if (extension == ".xml" || extension == ".fixed")
5455
continue;
5556
var filename = Path.GetFileName (file);
5657
var dest = Path.Combine (destinationDir, filename);

0 commit comments

Comments
 (0)