File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1414
1515#include < iostream>
1616#include < string>
17-
17+ #include < unistd.h>
18+ #include < limits.h>
1819#include " test/util/fs_util.h"
1920#include " test/util/test_util.h"
2021#include " tools/cpp/runfiles/runfiles.h"
@@ -23,6 +24,17 @@ namespace gvisor {
2324namespace testing {
2425
2526std::string RunfilePath (std::string path) {
27+ // Fix for DragonOS syscall test
28+ static const std::string prefix = " test/syscalls/linux/" ;
29+ if (path.substr (0 , prefix.length ()) == prefix) {
30+ // Get current working directory
31+ char cwd[PATH_MAX];
32+ if (getcwd (cwd, sizeof (cwd)) != nullptr ) {
33+ return std::string (cwd) + " /" + path.substr (prefix.length ());
34+ }
35+ return path.substr (prefix.length ());
36+ }
37+
2638 static const bazel::tools::cpp::runfiles::Runfiles* const runfiles = [] {
2739 std::string error;
2840 auto * runfiles =
You can’t perform that action at this time.
0 commit comments