File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
misc/bazel/internal/zipmerge Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 55#include < sstream>
66#include < string>
77#include < cstring>
8+ #include < filesystem>
89
910#include < gtest/gtest.h>
1011#include < gmock/gmock.h>
1112#include " tools/cpp/runfiles/runfiles.h"
1213
1314using bazel::tools::cpp::runfiles::Runfiles;
1415using namespace std ::string_literals;
16+ namespace fs = std::filesystem;
1517
1618namespace codeql_testing {
1719
@@ -72,7 +74,15 @@ std::string get_file(const char* name) {
7274 EXPECT_TRUE (ret) << error;
7375 return ret;
7476 }();
75- return runfiles->Rlocation (" _main/misc/bazel/internal/zipmerge/test-files/" s + name);
77+ // this works from both `codeql` and the internal repository
78+ for (auto prefix : {" _main" , " codeql~" }) {
79+ auto ret = runfiles->Rlocation (prefix + " /misc/bazel/internal/zipmerge/test-files/" s + name);
80+ if (fs::exists (ret)) {
81+ return ret;
82+ }
83+ }
84+ EXPECT_TRUE (false ) << " test file " << name << " not found" ;
85+ return " " ;
7686}
7787
7888void expect_same_file (const char * actual, const char * expected) {
You can’t perform that action at this time.
0 commit comments