fake_test_deps.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. Copyright 2018 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package coverage
  14. import (
  15. "io"
  16. )
  17. // This is an implementation of testing.testDeps. It doesn't need to do anything, because
  18. // no tests are actually run. It does need a concrete implementation of at least ImportPath,
  19. // which is called unconditionally when running tests.
  20. type fakeTestDeps struct{}
  21. func (fakeTestDeps) ImportPath() string {
  22. return ""
  23. }
  24. func (fakeTestDeps) MatchString(pat, str string) (bool, error) {
  25. return false, nil
  26. }
  27. func (fakeTestDeps) StartCPUProfile(io.Writer) error {
  28. return nil
  29. }
  30. func (fakeTestDeps) StopCPUProfile() {}
  31. func (fakeTestDeps) StartTestLog(io.Writer) {}
  32. func (fakeTestDeps) StopTestLog() error {
  33. return nil
  34. }
  35. func (fakeTestDeps) WriteHeapProfile(io.Writer) error {
  36. return nil
  37. }
  38. func (fakeTestDeps) WriteProfileTo(string, io.Writer, int) error {
  39. return nil
  40. }