diff options
author | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-10-16 07:55:22 +0200 |
---|---|---|
committer | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-10-18 22:31:42 +0200 |
commit | 5a3da229c53462d2d3990a52ab5d5056da4b0640 (patch) | |
tree | c4100c18f416be32808e17d0b07f740ab572d6aa /driver | |
parent | 9dd7a5e8ccd1e7ac65cc134c1c3773ff26355a21 (diff) | |
download | jazzer-api-5a3da229c53462d2d3990a52ab5d5056da4b0640.tar.gz |
Look up runfiles in driver tests
Diffstat (limited to 'driver')
-rw-r--r-- | driver/BUILD.bazel | 6 | ||||
-rw-r--r-- | driver/fuzzed_data_provider_test.cpp | 4 | ||||
-rw-r--r-- | driver/jvm_tooling_test.cpp | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/driver/BUILD.bazel b/driver/BUILD.bazel index 60e8eb06..82082b23 100644 --- a/driver/BUILD.bazel +++ b/driver/BUILD.bazel @@ -206,7 +206,7 @@ cc_test( "sanitizer_symbols_for_tests.cpp", ], args = [ - "--cp=$(location //driver/testdata:fuzz_target_mocks_deploy.jar)", + "--cp=jazzer/$(rootpath //driver/testdata:fuzz_target_mocks_deploy.jar)", ], data = [ "//agent:jazzer_agent_deploy.jar", @@ -224,6 +224,7 @@ cc_test( deps = [ ":jvm_tooling_lib", ":test_main", + "@bazel_tools//tools/cpp/runfiles", "@googletest//:gtest", "@jazzer_com_github_gflags_gflags//:gflags", ], @@ -237,7 +238,7 @@ cc_test( "sanitizer_symbols_for_tests.cpp", ], args = [ - "--cp=$(location //driver/testdata:fuzz_target_mocks_deploy.jar)", + "--cp=jazzer/$(rootpath //driver/testdata:fuzz_target_mocks_deploy.jar)", ], data = [ "//agent:jazzer_agent_deploy.jar", @@ -247,6 +248,7 @@ cc_test( deps = [ ":jvm_tooling_lib", ":test_main", + "@bazel_tools//tools/cpp/runfiles", "@googletest//:gtest", "@jazzer_com_github_gflags_gflags//:gflags", ], diff --git a/driver/fuzzed_data_provider_test.cpp b/driver/fuzzed_data_provider_test.cpp index fc820ff4..210bf118 100644 --- a/driver/fuzzed_data_provider_test.cpp +++ b/driver/fuzzed_data_provider_test.cpp @@ -25,6 +25,7 @@ #include "gflags/gflags.h" #include "gtest/gtest.h" #include "jvm_tooling.h" +#include "tools/cpp/runfiles/runfiles.h" DECLARE_string(cp); DECLARE_string(jvm_args); @@ -116,6 +117,9 @@ class FuzzedDataProviderTest : public ::testing::Test { // destroyed after all tests in this test suite have finished. static void SetUpTestCase() { FLAGS_instrumentation_excludes = "**"; + using ::bazel::tools::cpp::runfiles::Runfiles; + Runfiles* runfiles = Runfiles::CreateForTest(); + FLAGS_cp = runfiles->Rlocation(FLAGS_cp); jvm_ = std::make_unique<JVM>("test_executable"); } diff --git a/driver/jvm_tooling_test.cpp b/driver/jvm_tooling_test.cpp index 7069acd9..9d13f91f 100644 --- a/driver/jvm_tooling_test.cpp +++ b/driver/jvm_tooling_test.cpp @@ -18,6 +18,7 @@ #include "fuzz_target_runner.h" #include "gflags/gflags.h" #include "gtest/gtest.h" +#include "tools/cpp/runfiles/runfiles.h" DECLARE_string(cp); DECLARE_string(jvm_args); @@ -43,6 +44,9 @@ class JvmToolingTest : public ::testing::Test { static void SetUpTestCase() { FLAGS_jvm_args = "-Denv1=val1;-Denv2=val2"; FLAGS_instrumentation_excludes = "**"; + using ::bazel::tools::cpp::runfiles::Runfiles; + Runfiles *runfiles = Runfiles::CreateForTest(); + FLAGS_cp = runfiles->Rlocation(FLAGS_cp); jvm_ = std::make_unique<JVM>("test_executable"); } |