# string list as argument to SET\_TESTS\_PROPERTIES()?

**URL:** <https://discourse.cmake.org/t/string-list-as-argument-to-set-tests-properties/9806>\
**Category:** Code\
**Created:** [January 10, 2024, 1:24am UTC](https://discourse.cmake.org/t/string-list-as-argument-to-set-tests-properties/9806 "2024-01-10T01:24:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wimster](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/ecb155/32.png) [@wimster](https://discourse.cmake.org/u/wimster)\
**Post date:** [January 10, 2024, 1:24am UTC](https://discourse.cmake.org/t/string-list-as-argument-to-set-tests-properties/9806/1 "2024-01-10T01:24:48Z")

</div>

I have some cmake code that generates test names. It has a base-test name followed by some identifier. An example would be this: which is in a loop and the id’s and args are different.

ADD\_TEST (NAME “${APT\_TEST\_NAME}-${TEST\_ID}” COMMAND “${MY\_COMMAND}” ${ARG\_LIST})

This works just fine in that I can execute that test in CTEST.

What I want to do is to serialize all those base tests even when running with a large ctest\_parallel\_level.

I’ve tried created a string list of all the related ${APT\_TEST\_NAME}-${TEST\_ID} like this:

STRING(APPEND TEST\_LIST “${APT\_TEST\_NAME}-${TEST\_ID}”)

– but I can’t seem to cajole SET\_TESTS\_PROPERTIES() to understand a test list. I’ve monkeyed with quote/no-quotes, etc.

Example:

SET\_TESTS\_PROPERTIES(“${TEST\_LIST}” PROPERTIES RUN\_SERIAL TRUE)

CMAKE tells me each time that the conjoined test names is a test that cannot be found.

Is there a better way to tackle this? Or am I on the right track but have missed a subtle nuance?

---

<div class="post-metadata">

**Author:** ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)\
**Post date:** [January 10, 2024, 11:46am UTC](https://discourse.cmake.org/t/string-list-as-argument-to-set-tests-properties/9806/2 "2024-01-10T11:46:21Z")

</div>

If you want a list to be treated as a list, expand it without quotes. This should work:

```auto
set_tests_properties(${TEST_LIST} PROPERTIES RUN_SERIAL TRUE)

```

---

<div class="post-metadata">

**Author:** ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)\
**Post date:** [January 10, 2024, 12:19pm UTC](https://discourse.cmake.org/t/string-list-as-argument-to-set-tests-properties/9806/3 "2024-01-10T12:19:49Z")

</div>

Try with list(APPEND …) instead of string(APPEND …)

---

<div class="post-metadata">

**Author:** ![wimster](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/ecb155/32.png) [@wimster](https://discourse.cmake.org/u/wimster)\
**Post date:** [January 10, 2024, 4:18pm UTC](https://discourse.cmake.org/t/string-list-as-argument-to-set-tests-properties/9806/4 "2024-01-10T16:18:33Z")

</div>

Geez. I’m an idiot. I _meant_ to use LIST … sometimes all the CMAKE primitives look the same!
