Skip to content

Commit ff96a48

Browse files
Bob BeckBoringssl LUCI CQ
Bob Beck
authored and
Boringssl LUCI CQ
committed
Add pki test files for android, adapt PathService fillin.
Change-Id: Ie5cb298398c1944704c74b63f51323800f6dc5b0 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61065 Reviewed-by: David Benjamin <[email protected]> Auto-Submit: Bob Beck <[email protected]> Commit-Queue: David Benjamin <[email protected]>
1 parent 9ad0e9d commit ff96a48

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

pki/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ set_target_properties(
9797
target_compile_definitions(
9898
pki_test
9999
PRIVATE
100-
_BORINGSSL_LIBPKI_
101-
"_BORINGSSL_PKI_SRCDIR_=${CMAKE_CURRENT_SOURCE_DIR}")
100+
_BORINGSSL_LIBPKI_)
102101
target_link_libraries(pki_test test_support_lib boringssl_gtest_main pki ssl crypto)
103102
add_dependencies(all_tests pki_test)
104103

pki/fillins/path_service.cc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ FilePath FilePath::AppendASCII(const std::string &ascii_path_element) const {
2828

2929
// static
3030
void PathService::Get(PathKey key, FilePath *out) {
31-
#if defined(_BORINGSSL_PKI_SRCDIR_)
32-
// We stringify the compile parameter because cmake. sigh.
33-
#define _boringssl_xstr(s) _boringssl_str(s)
34-
#define _boringssl_str(s) #s
35-
const char pki_srcdir[] = _boringssl_xstr(_BORINGSSL_PKI_SRCDIR_);
36-
#else
37-
#error "No _BORINGSSL_PKI_SRCDIR"
38-
#endif // defined(BORINGSSL_PKI_SRCDIR
39-
*out = FilePath(pki_srcdir);
31+
// We expect our test data to live in "pki" underneath a
32+
// test root directory, or in the current directry.
33+
char *root_from_env = getenv("BORINGSSL_TEST_DATA_ROOT");
34+
std::string root = root_from_env ? root_from_env : ".";
35+
*out = FilePath(root + "/pki");
4036
}
4137

4238
} // namespace fillins

util/run_android_tests.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,20 @@ func main() {
310310
"BUILDING.md",
311311
)
312312

313+
err := filepath.Walk("pki/testdata/", func(path string, info os.FileInfo, err error) error {
314+
if err != nil {
315+
return err
316+
}
317+
if info.Mode().IsRegular() {
318+
files = append(files, path)
319+
}
320+
return nil
321+
})
322+
if err != nil {
323+
fmt.Printf("Can't walk pki/testdata: %s\n", err)
324+
os.Exit(1);
325+
}
326+
313327
tests, err := testconfig.ParseTestConfig("util/all_tests.json")
314328
if err != nil {
315329
fmt.Printf("Failed to parse input: %s\n", err)
@@ -374,6 +388,7 @@ func main() {
374388
"crypto/libcrypto.so",
375389
"decrepit/libdecrepit.so",
376390
"ssl/libssl.so",
391+
"pki/libpki.so",
377392
}
378393
} else if !os.IsNotExist(err) {
379394
fmt.Printf("Failed to stat crypto/libcrypto.so: %s\n", err)

0 commit comments

Comments
 (0)