diff options
Diffstat (limited to 'test/buildtool/execution_api')
-rw-r--r-- | test/buildtool/execution_api/local/TARGETS | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | test/buildtool/execution_api/local/local_execution.test.cpp | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/buildtool/execution_api/local/TARGETS b/test/buildtool/execution_api/local/TARGETS index a4b2821a..65ced26c 100644 --- a/test/buildtool/execution_api/local/TARGETS +++ b/test/buildtool/execution_api/local/TARGETS @@ -7,6 +7,7 @@ , ["", "catch-main"] , ["@", "src", "src/buildtool/common", "artifact_factory"] , ["@", "src", "src/buildtool/common", "config"] + , ["@", "src", "src/buildtool/execution_api/local", "config"] , ["@", "src", "src/buildtool/execution_api/local", "local"] , ["utils", "local_hermeticity"] ] diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index 36615d89..41b416a4 100755..100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -19,6 +19,7 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/common/repository_config.hpp" +#include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" #include "test/utils/hermeticity/local.hpp" @@ -33,6 +34,21 @@ namespace { "test/buildtool/execution_api/local"; } +inline void SetLauncher() { + std::vector<std::string> launcher{"env"}; + auto* env_path = std::getenv("PATH"); + if (env_path != nullptr) { + launcher.emplace_back(std::string{"PATH="} + std::string{env_path}); + } + else { + launcher.emplace_back("PATH=/bin:/usr/bin"); + } + if (not LocalExecutionConfig::SetLauncher(launcher)) { + Logger::Log(LogLevel::Error, "Failure setting the local launcher."); + std::exit(EXIT_FAILURE); + } +} + } // namespace TEST_CASE_METHOD(HermeticLocalTestFixture, @@ -47,6 +63,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, api.CreateAction(*api.UploadTree({}), cmdline, {}, {}, {}, {}); REQUIRE(action); + SetLauncher(); + SECTION("Cache execution result in action cache") { // run execution action->SetCacheFlag(IExecutionAction::CacheFlag::CacheOutput); |