Files
gasm-sdk/lint/integration_test.go
petrbalvin ebd8ab8a3c
Test / vet (push) Successful in 44s
Test / test (push) Successful in 2m8s
Test / build (push) Successful in 40s
test: gate go-libraries integration tests behind -tags=integration
Assisted-by: GLM 5.2
2026-08-07 21:28:24 +02:00

45 lines
1.2 KiB
Go

// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
// SPDX-License-Identifier: BSD-3-Clause
//go:build integration
// Package lint integration tests against the production go-libraries kernels.
// Excluded from the default test run so coverage is identical locally and in CI.
// Run explicitly with: go test -tags=integration ./lint/
package lint
import (
"os"
"path/filepath"
"testing"
"sourcedock.dev/petrbalvin/gasm-devkit/arch"
"sourcedock.dev/petrbalvin/gasm-devkit/parser"
)
// TestRealGoLibrariesHasNoErrors asserts that the production go-flac kernels
// lint free of errors.
func TestRealGoLibrariesHasNoErrors(t *testing.T) {
matches, _ := filepath.Glob("../../go-libraries/go-*/*.s")
if len(matches) == 0 {
t.Skip("go-libraries repository not present")
}
for _, path := range matches {
src, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
f, errs := parser.Parse(path, string(src))
if len(errs) > 0 {
t.Fatalf("parse %s: %v", path, errs)
}
a := arch.FromFilename(path)
diags := File(f, Config{Arch: a})
for _, d := range diags {
if d.Severity == Error {
t.Errorf("%s: %s %s: %s", filepath.Base(path), d.Pos, d.Code, d.Message)
}
}
}
}