istio.io/istio@v0.0.0-20240520182934-d79c90f27776/tests/fuzz/utils/utils.go (about)

     1  // Copyright Istio Authors
     2  //
     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  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package utils
    16  
    17  import (
    18  	"os"
    19  
    20  	"istio.io/istio/pkg/test"
    21  )
    22  
    23  type NopTester struct{}
    24  
    25  func (n NopTester) Fail() {}
    26  
    27  func (n NopTester) FailNow() {}
    28  
    29  func (n NopTester) Fatal(args ...any) {}
    30  
    31  func (n NopTester) Fatalf(format string, args ...any) {}
    32  
    33  func (n NopTester) Log(args ...any) {}
    34  
    35  func (n NopTester) Logf(format string, args ...any) {}
    36  
    37  func (n NopTester) Skip(args ...any) {}
    38  
    39  func (n NopTester) TempDir() string {
    40  	tempDir, _ := os.MkdirTemp("", "test")
    41  	return tempDir
    42  }
    43  
    44  func (n NopTester) Helper() {}
    45  
    46  func (n NopTester) Cleanup(f func()) {}
    47  
    48  var _ test.Failer = NopTester{}