| // Copyright (C) 2016 The Android Open Source Project |
| // |
| // 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 |
| // |
| // http://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. |
| |
| package log_test |
| |
| import "android.googlesource.com/platform/tools/gpu/framework/log" |
| |
| // The purpose of this file is to provide stable stack traces for tests, editing any line above the stack functions |
| // means changing every test that uses them. |
| |
| func stack_func_1(trace *log.StackTrace) { |
| trace.Collect() // stack_test.go:23 android.googlesource.com/platform/tools/gpu/framework/log_test stack_func_1 |
| } |
| |
| func stack_func_2(trace *log.StackTrace) { |
| stack_func_3(trace) // stack_test.go:27 android.googlesource.com/platform/tools/gpu/framework/log_test stack_func_2 |
| } |
| |
| func stack_func_3(trace *log.StackTrace) { |
| trace.Collect() // stack_test.go:31 android.googlesource.com/platform/tools/gpu/framework/log_test stack_func_3 |
| } |
| |
| func StacksForTest() log.StackFilter { |
| stack_func_1(&stacktrace_1) // stack_test.go:35 android.googlesource.com/platform/tools/gpu/framework/log_test StacksForTest |
| stack_func_2(&stacktrace_2) // stack_test.go:36 android.googlesource.com/platform/tools/gpu/framework/log_test StacksForTest |
| stack_func_3(&stacktrace_3) // stack_test.go:37 android.googlesource.com/platform/tools/gpu/framework/log_test StacksForTest |
| return func(entry *log.StackEntry) bool { |
| return entry.File != "stack_test.go" |
| } |
| } |
| |
| var ( |
| stacktrace_1, stacktrace_2, stacktrace_3 log.StackTrace |
| ) |