summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/pseudo_tidy.c
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-11-29 18:39:10 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-12-06 15:39:29 (GMT)
commit232467eb1c0dab9156cd8c4af56aad3959cbee4b (patch)
tree2772b01850c143598e642282966401cb976dd421 /Tests/RunCMake/pseudo_tidy.c
parent7ea665b74da322e96dd3e7f90075143c2957728c (diff)
downloadCMake-232467eb1c0dab9156cd8c4af56aad3959cbee4b.zip
CMake-232467eb1c0dab9156cd8c4af56aad3959cbee4b.tar.gz
CMake-232467eb1c0dab9156cd8c4af56aad3959cbee4b.tar.bz2
clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property
Fixes: #21362
Diffstat (limited to 'Tests/RunCMake/pseudo_tidy.c')
-rw-r--r--Tests/RunCMake/pseudo_tidy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/pseudo_tidy.c b/Tests/RunCMake/pseudo_tidy.c
index a43133b..f227c06 100644
--- a/Tests/RunCMake/pseudo_tidy.c
+++ b/Tests/RunCMake/pseudo_tidy.c
@@ -1,8 +1,13 @@
+#ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
+ FILE* f;
int i;
for (i = 1; i < argc; ++i) {
if (strcmp(argv[i], "-p") == 0) {
@@ -20,6 +25,14 @@ int main(int argc, char* argv[])
fprintf(stderr, "stderr from bad command line arg '-bad'\n");
return 1;
}
+ if (strncmp(argv[i], "--export-fixes=", 15) == 0) {
+ f = fopen(argv[i] + 15, "w");
+ if (!f) {
+ fprintf(stderr, "Error opening %s for writing\n", argv[i] + 15);
+ return 1;
+ }
+ fclose(f);
+ }
if (argv[i][0] != '-') {
fprintf(stdout, "%s:0:0: warning: message [checker]\n", argv[i]);
break;