Separated compiler into its own package

This commit is contained in:
Eduard Urbach 2024-07-18 10:08:38 +02:00
parent 38043ca12a
commit 61dc691c65
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 199 additions and 167 deletions

View file

@ -3,6 +3,9 @@ package tests_test
import (
"path/filepath"
"testing"
"git.akyoto.dev/cli/q/src/build"
"git.akyoto.dev/go/assert"
)
var examples = []struct {
@ -22,3 +25,16 @@ func TestExamples(t *testing.T) {
})
}
}
func BenchmarkExamples(b *testing.B) {
for _, test := range examples {
b.Run(test.Name, func(b *testing.B) {
compiler := build.New(filepath.Join("..", "examples", test.Name))
for i := 0; i < b.N; i++ {
_, err := compiler.Run()
assert.Nil(b, err)
}
})
}
}