diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-02-28 13:24:26 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-03-01 10:46:54 +0100 |
commit | 1ef03a1c7043d617885d319b0803d69907c3c9cc (patch) | |
tree | acfcd33dab8e2355863356af88d14ac6e3578b2d /test/buildtool/build_engine/target_map/target_map.test.cpp | |
parent | fffee539ec37e9e68189e71994aa2c901d30c9fb (diff) | |
download | justbuild-1ef03a1c7043d617885d319b0803d69907c3c9cc.tar.gz |
Pass actions and trees in analysis result as shared pointer
... to avoid unnecessary copying and moving of larger objects.
Diffstat (limited to 'test/buildtool/build_engine/target_map/target_map.test.cpp')
-rw-r--r-- | test/buildtool/build_engine/target_map/target_map.test.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp index a711eef3..3bfdfccd 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -315,9 +315,9 @@ TEST_CASE("simple targets") { // in the vector is guaranteed. The test rule generates the action by // iterating over the "srcs" field, so we get the actions in the order // of that field, not in alphabetical order. - CHECK(result->Actions()[0].ToJson()["input"]["in"]["data"]["path"] == + CHECK(result->Actions()[0]->ToJson()["input"]["in"]["data"]["path"] == "simple_targets/foo.txt"); - CHECK(result->Actions()[1].ToJson()["input"]["in"]["data"]["path"] == + CHECK(result->Actions()[1]->ToJson()["input"]["in"]["data"]["path"] == "simple_targets/bar.txt"); } } @@ -594,9 +594,9 @@ TEST_CASE("target reference") { CHECK(result->Actions().size() == 1); CHECK(result->Actions()[0] - .ToJson()["input"]["raw_data/hello.txt"]["type"] == "LOCAL"); + ->ToJson()["input"]["raw_data/hello.txt"]["type"] == "LOCAL"); CHECK(result->Actions()[0] - .ToJson()["input"]["raw_data/hello.txt"]["data"]["path"] == + ->ToJson()["input"]["raw_data/hello.txt"]["data"]["path"] == "file_reference/hello.txt"); } @@ -665,16 +665,17 @@ TEST_CASE("trees") { CHECK(!error); CHECK(error_msg == "NONE"); CHECK(result->Actions().size() == 1); - CHECK(result->Actions()[0].ToJson()["input"]["tree"]["type"] == "TREE"); - CHECK(result->Actions()[0].ToJson()["input"]["foo.txt"]["type"] == + CHECK(result->Actions()[0]->ToJson()["input"]["tree"]["type"] == + "TREE"); + CHECK(result->Actions()[0]->ToJson()["input"]["foo.txt"]["type"] == "LOCAL"); - CHECK( - result->Actions()[0].ToJson()["input"]["foo.txt"]["data"]["path"] == - "tree/foo.txt"); + CHECK(result->Actions()[0]->ToJson()["input"]["foo.txt"]["data"]["pat" + "h"] == + "tree/foo.txt"); CHECK(result->Trees().size() == 1); - CHECK(result->Trees()[0].ToJson()["foo.txt"]["type"] == "LOCAL"); - CHECK(result->Trees()[0].ToJson()["bar.txt"]["type"] == "LOCAL"); - CHECK(result->Trees()[0].ToJson()["baz.txt"]["type"] == "LOCAL"); + CHECK(result->Trees()[0]->ToJson()["foo.txt"]["type"] == "LOCAL"); + CHECK(result->Trees()[0]->ToJson()["bar.txt"]["type"] == "LOCAL"); + CHECK(result->Trees()[0]->ToJson()["baz.txt"]["type"] == "LOCAL"); } SECTION("stage into tree") { |