feat: testdir resolution

This commit is contained in:
2026-03-16 21:45:16 +00:00
parent 77dfa2df30
commit 8968af90cc
4 changed files with 336 additions and 17 deletions
+4 -6
View File
@@ -9,8 +9,7 @@ import (
)
type Config struct {
TestDir string
HasTestDir bool
TestDir string
}
type tomlConfig struct {
@@ -21,11 +20,11 @@ type tomlMiroConfig struct {
TestDir string `toml:"test_dir"`
}
// ReadConfig reads miro.toml and reports whether [miro].test_dir was explicitly set.
// ReadConfig reads miro.toml.
func ReadConfig(path string) (Config, error) {
var raw tomlConfig
meta, err := toml.DecodeFile(path, &raw)
_, err := toml.DecodeFile(path, &raw)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return Config{}, err
@@ -34,7 +33,6 @@ func ReadConfig(path string) (Config, error) {
}
return Config{
TestDir: raw.Miro.TestDir,
HasTestDir: meta.IsDefined("miro", "test_dir"),
TestDir: raw.Miro.TestDir,
}, nil
}