test

package
v0.0.0-...-355f60d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2019 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ProfileName      = "cov-profile.txt"
	KeyProfileName   = "key-cov-profile.txt"
	StdoutName       = "stdout.txt"
	CovTargetRootRel = "testTarget"
	CovTargetRelPath = CovTargetRootRel + "/presubmit"
)

Variables

View Source
var (
	InputArtifactsDir = AbsPath("testdata/artifacts")
	CovTargetDir      = AbsPath(CovTargetRelPath) + "/"
)

Functions

func AbsPath

func AbsPath(pathRelToProj string) string

func AssertEqual

func AssertEqual(t *testing.T, expected, actual interface{})

func DeleteDir

func DeleteDir(dir string)

func Fail

func Fail(t *testing.T, input, expected, actual interface{})

func FileOrDirExists

func FileOrDirExists(path string) bool

func LinkInputArts

func LinkInputArts(artsDir string, artNames ...string)

func MkdirAll

func MkdirAll(path string)

func NewArtsDir

func NewArtsDir(dirPrefix string) string

func ProjDir

func ProjDir() string

func StrFailure

func StrFailure(input, expected, actual string) string

StrFailure is used to display discrepancy between expected and actual result in test

Types

type Set

type Set interface {
	Add(interface{})
	Has(interface{}) bool
}

type StringSet

type StringSet struct {
	// contains filtered or unexported fields
}

func MakeStringSet

func MakeStringSet(members ...string) (set *StringSet)

func NewStringSet

func NewStringSet() *StringSet

func (*StringSet) Add

func (set *StringSet) Add(s string)

func (*StringSet) AllMembers

func (set *StringSet) AllMembers() (res []string)

func (*StringSet) Has

func (set *StringSet) Has(s string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL