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 5
5
#include < sstream>
6
6
#include < string>
7
7
#include < cstring>
8
+ #include < filesystem>
8
9
9
10
#include < gtest/gtest.h>
10
11
#include < gmock/gmock.h>
11
12
#include " tools/cpp/runfiles/runfiles.h"
12
13
13
14
using bazel::tools::cpp::runfiles::Runfiles;
14
15
using namespace std ::string_literals;
16
+ namespace fs = std::filesystem;
15
17
16
18
namespace codeql_testing {
17
19
@@ -72,7 +74,15 @@ std::string get_file(const char* name) {
72
74
EXPECT_TRUE (ret) << error;
73
75
return ret;
74
76
}();
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 " " ;
76
86
}
77
87
78
88
void expect_same_file (const char * actual, const char * expected) {
You can’t perform that action at this time.
0 commit comments