1// Copyright (c) 2015 Ableton AG, Berlin. All rights reserved. 2// 3// Use of this source code is governed by a BSD-style 4// license that can be found in the LICENSE file. 5 6package travis 7 8import ( 9 "fmt" 10 "path/filepath" 11 "runtime" 12 "testing" 13) 14 15// assert fails the test if the condition is false. 16func assert(tb testing.TB, condition bool, msg string, v ...interface{}) { 17 if !condition { 18 _, file, line, _ := runtime.Caller(1) 19 fmt.Printf("\033[31m%s:%d: "+msg+"\033[39m\n\n", append([]interface{}{filepath.Base(file), line}, v...)...) 20 tb.FailNow() 21 } 22} 23