test: gate go-libraries integration tests behind -tags=integration
Test / vet (push) Successful in 44s
Test / test (push) Successful in 2m8s
Test / build (push) Successful in 40s

Assisted-by: GLM 5.2
This commit is contained in:
2026-08-07 21:28:24 +02:00
parent 176d856f67
commit ebd8ab8a3c
10 changed files with 398 additions and 205 deletions
+39
View File
@@ -0,0 +1,39 @@
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
// SPDX-License-Identifier: BSD-3-Clause
//go:build integration
// Package parser 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 ./parser/
package parser
import (
"os"
"path/filepath"
"testing"
)
// TestParseRealGoLibraries parses every .s file in the sibling go-libraries
// repository when it is checked out, asserting a clean, error-free parse.
func TestParseRealGoLibraries(t *testing.T) {
matches, _ := filepath.Glob("../../go-libraries/go-*/*.s")
if len(matches) == 0 {
t.Skip("go-libraries repository not present next to gasm-devkit")
}
for _, path := range matches {
src, err := os.ReadFile(path)
if err != nil {
t.Fatalf("read %s: %v", path, err)
}
file, errs := Parse(path, string(src))
if len(errs) > 0 {
t.Errorf("parse %s: %v", path, errs)
continue
}
if len(texts(file)) == 0 {
t.Errorf("parse %s: no TEXT functions found", path)
}
t.Logf("%s: %d decls, %d functions", filepath.Base(path), len(file.Decls), len(texts(file)))
}
}