Created
February 1, 2024 20:19
-
-
Save scivision/c1525770f8ec22bd9ebc7d3ed6cf8a4b to your computer and use it in GitHub Desktop.
CTest by design combines stdout and stderr. It would be nice if they were separate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.19) | |
project(piper LANGUAGES C) | |
enable_testing() | |
add_executable(piper main.c) | |
add_test(NAME piper COMMAND piper) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
fprintf(stdout, "stdout pipe\n"); | |
fprintf(stderr, "stderr pipe\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake -B build && cmake --build build | |
# stdout and stderr combined | |
ctest --test-dir build -V 2>/dev/null | |
# no output | |
ctest --test-dir build -V 1>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment