From 30eb0d6a613ad268f6805ccbcdcabf158e7f526f Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 17 May 2026 13:07:12 +0900 Subject: internal/rosa: key metadata by string For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra --- internal/rosa/rosa_test.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'internal/rosa/rosa_test.go') diff --git a/internal/rosa/rosa_test.go b/internal/rosa/rosa_test.go index 0eef8334..f9dcb1a2 100644 --- a/internal/rosa/rosa_test.go +++ b/internal/rosa/rosa_test.go @@ -28,7 +28,7 @@ var ( ) func TestMain(m *testing.M) { - rosa.DropCaches("", rosa.OptLLVMNoLTO) + rosa.Native().DropCaches("", rosa.OptLLVMNoLTO) container.TryArgv0(nil) code := m.Run() @@ -77,10 +77,9 @@ func TestCureAll(t *testing.T) { cache := getCache(t) t.Parallel() - for i := range rosa.PresetEnd { - p := rosa.PArtifact(i) - meta := rosa.GetMetadata(p) - a := rosa.Std.Load(p) + for _, p := range rosa.Native().Collect() { + a, _ := rosa.Native().Load(rosa.Std, p) + meta := rosa.Native().MustGet(p) t.Run(meta.Name, func(t *testing.T) { t.Parallel() @@ -94,14 +93,13 @@ func TestCureAll(t *testing.T) { } func BenchmarkStage3(b *testing.B) { - arch, flags := rosa.Arch(), rosa.Flags() - b.Cleanup(func() { rosa.DropCaches(arch, flags) }) + s := rosa.Native().Clone() for b.Loop() { - rosa.Std.Load(rosa.LLVM) + s.Load(rosa.Std, rosa.LLVM) b.StopTimer() - rosa.DropCaches("", 0) + s.DropCaches("", 0) b.StartTimer() } } -- cgit v1.3.1