Skip to content

Commit

Permalink
Set home path, remove path modification that belongs in gz-tools
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
azeey committed Apr 19, 2024
1 parent df87501 commit 48b5031
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/cmd/cmdsdformat.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ class Cmd
if defined? RubyInstaller
# RubyInstaller does not search for dlls in PATH or the directory that tests are running from,
# so we'll add the parent directory of the plugin to the search path.
ENV['RUBY_DLL_PATH'] = ENV['PATH']
RubyInstaller::Runtime.enable_dll_search_paths
# https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#-dll-loading
RubyInstaller::Runtime.add_dll_directory(File.dirname(plugin))
end
Expand Down
10 changes: 10 additions & 0 deletions src/gz_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,16 @@ int main(int argc, char **argv)
gz::utils::setenv("LD_LIBRARY_PATH", testLibraryPath);
#endif

// temporarily set HOME
std::string homeDir;
sdf::testing::TestTmpPath(homeDir);

#ifdef _WIN32
gz::utils::setenv("HOMEPATH", homeDir);
#else
gz::utils::setenv("HOME", homeDir);
#endif

::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

0 comments on commit 48b5031

Please sign in to comment.