diff --git a/main.go b/main.go index 2c6ad4abb..8f164cefb 100644 --- a/main.go +++ b/main.go @@ -98,6 +98,7 @@ func main() { cpuidSource{}, rdtSource{}, pstateSource{}, + fakeSource{}, } sources := []FeatureSource{} diff --git a/sources.go b/sources.go index 7ccd330a9..7fe3d40cc 100644 --- a/sources.go +++ b/sources.go @@ -102,3 +102,19 @@ func (s pstateSource) Discover() ([]string, error) { return features, nil } + +//////////////////////////////////////////////////////////////////////////////// +// Fake Source (used only for testing) + +// Implements main.FeatureSource. +type fakeSource struct{} + +func (s fakeSource) Name() string { return "fake" } +func (s fakeSource) Discover() ([]string, error) { + features := []string{} + + // Adding three fake features. + features = append(features, "fakefeature1", "fakefeature2", "fakefeature3") + + return features, nil +}