summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_engine/executor
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-02-13 16:28:09 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-02-13 17:57:12 +0100
commitc70f5c6df194f952d8c3d7e1d626d2fb3ccddaa9 (patch)
treee954bc4dc3ed936dc5ef904e5e2ab701f0327398 /test/buildtool/execution_engine/executor
parent3de6a28f79ddb6e81c360b48eaea3ba10a53ab1f (diff)
downloadjustbuild-c70f5c6df194f952d8c3d7e1d626d2fb3ccddaa9.tar.gz
executor-api test: also set env for echo
... in order to not rely on the default launcher to pull it in.
Diffstat (limited to 'test/buildtool/execution_engine/executor')
-rw-r--r--test/buildtool/execution_engine/executor/executor_api.test.hpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp
index 5f951e8d..b851c5b8 100644
--- a/test/buildtool/execution_engine/executor/executor_api.test.hpp
+++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp
@@ -328,6 +328,14 @@ static inline void TestUploadAndDownloadTrees(RepositoryConfig* repo_config,
int /*expected_cached*/ = 0) {
SetupConfig(repo_config);
auto tmpdir = GetTestDir();
+ auto* env_path = std::getenv("PATH");
+ std::map<std::string, std::string> env{};
+ if (env_path != nullptr) {
+ env.emplace("PATH", env_path);
+ }
+ else {
+ env.emplace("PATH", "/bin:/usr/bin");
+ }
auto foo = std::string{"foo"};
auto bar = std::string{"bar"};
@@ -420,8 +428,10 @@ static inline void TestUploadAndDownloadTrees(RepositoryConfig* repo_config,
auto tree_desc = Tree{{{"a", foo_desc}, {"b/a", bar_desc}}};
auto action_inputs =
ActionDescription::inputs_t{{".", tree_desc.Output()}};
- ActionDescription action_desc{
- {"a", "b/a"}, {}, Action{"action_id", {"echo"}, {}}, action_inputs};
+ ActionDescription action_desc{{"a", "b/a"},
+ {},
+ Action{"action_id", {"echo"}, env},
+ action_inputs};
REQUIRE(AddAndProcessTree(&g, &runner, tree_desc));
REQUIRE(g.Add({action_desc}));