Mark test helpers as helpers.
This enables identifying the correct location of test failures.
from godocs:
Helper marks the calling function as a test helper function.
When printing file and line information, that function will be skipped.
Helper may be called simultaneously from multiple goroutines.
Test: go test bp2build tests
Change-Id: I52430e541494c78f5222c11510a4d273fe205a06
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index 0a72937..6e19e13 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -41,6 +41,7 @@
)
func runCcLibraryTestCase(t *testing.T, tc bp2buildTestCase) {
+ t.Helper()
runBp2BuildTestCase(t, registerCcLibraryModuleTypes, tc)
}
@@ -52,6 +53,7 @@
}
func runBp2BuildTestCase(t *testing.T, registerModuleTypes func(ctx android.RegistrationContext), tc bp2buildTestCase) {
+ t.Helper()
dir := "."
filesystem := make(map[string][]byte)
toParse := []string{
diff --git a/bp2build/cc_library_headers_conversion_test.go b/bp2build/cc_library_headers_conversion_test.go
index 2859bab..264ba6b 100644
--- a/bp2build/cc_library_headers_conversion_test.go
+++ b/bp2build/cc_library_headers_conversion_test.go
@@ -84,6 +84,7 @@
}
func runCcLibraryHeadersTestCase(t *testing.T, tc bp2buildTestCase) {
+ t.Helper()
runBp2BuildTestCase(t, registerCcLibraryHeadersModuleTypes, tc)
}
diff --git a/bp2build/cc_library_static_conversion_test.go b/bp2build/cc_library_static_conversion_test.go
index 229b1c2..e6f1fbc 100644
--- a/bp2build/cc_library_static_conversion_test.go
+++ b/bp2build/cc_library_static_conversion_test.go
@@ -76,6 +76,7 @@
}
func runCcLibraryStaticTestCase(t *testing.T, tc bp2buildTestCase) {
+ t.Helper()
runBp2BuildTestCase(t, registerCcLibraryStaticModuleTypes, tc)
}
diff --git a/bp2build/cc_object_conversion_test.go b/bp2build/cc_object_conversion_test.go
index d4eeb7c..f7e94c2 100644
--- a/bp2build/cc_object_conversion_test.go
+++ b/bp2build/cc_object_conversion_test.go
@@ -27,6 +27,7 @@
}
func runCcObjectTestCase(t *testing.T, tc bp2buildTestCase) {
+ t.Helper()
runBp2BuildTestCase(t, registerCcObjectModuleTypes, tc)
}
diff --git a/bp2build/python_binary_conversion_test.go b/bp2build/python_binary_conversion_test.go
index 95bce3c..7bedf71 100644
--- a/bp2build/python_binary_conversion_test.go
+++ b/bp2build/python_binary_conversion_test.go
@@ -8,6 +8,7 @@
)
func runPythonTestCase(t *testing.T, tc bp2buildTestCase) {
+ t.Helper()
runBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
}
diff --git a/bp2build/sh_conversion_test.go b/bp2build/sh_conversion_test.go
index 91bba54..82e0a14 100644
--- a/bp2build/sh_conversion_test.go
+++ b/bp2build/sh_conversion_test.go
@@ -49,6 +49,7 @@
}
func runShBinaryTestCase(t *testing.T, tc bp2buildTestCase) {
+ t.Helper()
runBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
}