-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathccl.go
More file actions
39 lines (34 loc) · 1.34 KB
/
ccl.go
File metadata and controls
39 lines (34 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Package ccl_test_data provides shared CCL test infrastructure
// for loading, filtering, and generating test suites across implementations.
package ccl_test_data
import (
"github.com/catconflang/ccl-test-data/config"
"github.com/catconflang/ccl-test-data/loader"
"github.com/catconflang/ccl-test-data/types"
)
// Version of the package
const Version = "v0.1.0"
// NewLoader creates a test loader with sensible defaults
func NewLoader(testDataPath string, cfg config.ImplementationConfig) *loader.TestLoader {
return loader.NewTestLoader(testDataPath, cfg)
}
// LoadCompatibleTests is a convenience function for the most common use case
func LoadCompatibleTests(testDataPath string, cfg config.ImplementationConfig) ([]types.TestCase, error) {
testLoader := NewLoader(testDataPath, cfg)
return testLoader.LoadAllTests(loader.LoadOptions{
Format: loader.FormatFlat,
FilterMode: loader.FilterCompatible,
})
}
// GetTestStats provides quick statistics for a test set
func GetTestStats(testDataPath string, cfg config.ImplementationConfig) (types.TestStatistics, error) {
testLoader := NewLoader(testDataPath, cfg)
tests, err := testLoader.LoadAllTests(loader.LoadOptions{
Format: loader.FormatFlat,
FilterMode: loader.FilterAll,
})
if err != nil {
return types.TestStatistics{}, err
}
return testLoader.GetTestStatistics(tests), nil
}