Skip to content

Ignore baseline diffs that use unsupported options #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion internal/testrunner/compiler_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (c *compilerTest) verifyDiagnostics(t *testing.T, suiteName string, isSubmo
tsbaseline.DoErrorBaseline(t, c.configuredName, files, c.result.Diagnostics, c.result.Options.Pretty.IsTrue(), baseline.Options{
Subfolder: suiteName,
IsSubmodule: isSubmodule,
IsSubmoduleAccepted: len(c.result.Program.UnsupportedExtensions()) != 0, // TODO(jakebailey): read submoduleAccepted.txt
IsSubmoduleAccepted: c.containsUnsupportedOptions(),
})
})
}
Expand Down Expand Up @@ -434,3 +434,21 @@ func (c *compilerTest) verifyUnionOrdering(t *testing.T) {
}
})
}

func (c *compilerTest) containsUnsupportedOptions() bool {
if len(c.result.Program.UnsupportedExtensions()) != 0 {
return true
}
switch c.options.GetEmitModuleKind() {
case core.ModuleKindAMD, core.ModuleKindUMD, core.ModuleKindSystem:
return true
}
if c.options.BaseUrl != "" {
return true
}
if c.options.RootDirs != nil {
return true
}

return false
}
2 changes: 2 additions & 0 deletions testdata/submoduleAccepted.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Diff files to instead write to submoduleAccepted as "accepted" changes.
conformance/node10Alternateresult_noTypes.errors.txt.diff
conformance/node10AlternateResult_noResolution.errors.txt.diff