include ("${RunCMake_SOURCE_DIR}/check_errors.cmake") unset (errors) set(listvar a b c d) list(LENGTH listvar reference) set (output "$") if (NOT output EQUAL reference) list (APPEND errors "returns bad value: ${output}") endif() set(listvar "") list(LENGTH listvar reference) set (output "$") if (NOT output EQUAL reference) list (APPEND errors "returns bad value: ${output}") endif() unset(listvar) list(LENGTH listvar reference) set (output "$") if (NOT output EQUAL reference) list (APPEND errors "returns bad value: ${output}") endif() check_errors("LIST:LENGTH..." ${errors})