Using the ENVIRONMENT_MODIFICATION property

Hi,

I’m attempting creation of tests leveraging the newly added ENVIRONMENT_MODIFICATION property. After creating a test, I run the following:

set_tests_properties(
  ${test_name}
    PROPERTIES
      ENVIRONMENT_MODIFICATION PATH=path_list_append:${CMAKE_BINARY_DIR}
)

The value in the environment variable though is not appended, it’s entirely substituted.

A quick test

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {
    puts(getenv("PATH"));

    return 1;
}

shows if I run the executable with CTest, it only outputs the CMAKE_BINARY_DIR path, while running it after removing the set_tests_properties call prints as expected the contents of PATH.

I also tested the string_append OP and the result is the same. Tests were run on Windows 11 x64 w/cmake version 3.22.0-rc2.

This was fixed in rc3: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6682

Thanks for testing the rc releases!