tests/thirdparty: use Suite type for configuration (#285)

This commit is contained in:
Michael McLoughlin
2022-05-08 16:55:51 -07:00
committed by GitHub
parent 5e6971cc7a
commit 62c71109a4
13 changed files with 927 additions and 911 deletions

View File

@@ -30,10 +30,10 @@ func main() {
}
var (
typ = flag.String("type", "", "documentation type")
tmpl = flag.String("tmpl", "", "explicit template file (overrides -type)")
output = flag.String("output", "", "path to output file (default stdout)")
prjsfilename = flag.String("prjs", "", "projects configuration")
typ = flag.String("type", "", "documentation type")
tmpl = flag.String("tmpl", "", "explicit template file (overrides -type)")
output = flag.String("output", "", "path to output file (default stdout)")
suitefilename = flag.String("suite", "", "third-party test suite configuration")
)
func mainerr() (err error) {
@@ -60,18 +60,18 @@ func mainerr() (err error) {
}
// Load third-party projects.
if *prjsfilename == "" {
return errors.New("missing projects configuration")
if *suitefilename == "" {
return errors.New("missing test suite configuration")
}
prjs, err := thirdparty.LoadProjectsFile(*prjsfilename)
suite, err := thirdparty.LoadSuiteFile(*suitefilename)
if err != nil {
return err
}
// Execute.
data := map[string]interface{}{
"Projects": prjs,
"Suite": suite,
}
var buf bytes.Buffer

View File

@@ -1,5 +1,5 @@
# Adopters
{{ range .Projects.Ranked }}
{{ range .Suite.Projects.Ranked }}
{{ avatar .Repository.Owner 28 }} [{{ .Repository.Owner }} / **{{ .Repository.Name }}**]({{ .Repository.URL }})
{{ .Metadata.Description }}

View File

@@ -105,7 +105,7 @@ Implementations of full algorithms:
Popular projects using `avo`:
{{ range .Projects.Top 10 -}}
{{ range .Suite.Projects.Top 10 -}}
{{ if lt .Metadata.Stars 100 }}{{break}}{{ end -}}
{{ avatar .Repository.Owner 24 }} [{{ .Repository.Owner }} / **{{ .Repository.Name }}**]({{ .Repository.URL }})
:star: {{ stars .Metadata.Stars }}