From 6bdf186d1ed08778c296fab3b82f9613488e283a Mon Sep 17 00:00:00 2001 From: Henning Makholm Date: Fri, 6 Dec 2019 01:18:21 +0100 Subject: [PATCH] C tests: generalize arguments tests With the coming `codeql test` support, the `predefined_macros` file will not necessarily be located under a `tools` directory. Change the test to hide more of its actual path, so it will work in both cases. --- cpp/ql/test/library-tests/arguments/arguments.expected | 2 +- cpp/ql/test/library-tests/arguments/arguments.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/ql/test/library-tests/arguments/arguments.expected b/cpp/ql/test/library-tests/arguments/arguments.expected index 46eca426d0c..d5c0d884ee4 100644 --- a/cpp/ql/test/library-tests/arguments/arguments.expected +++ b/cpp/ql/test/library-tests/arguments/arguments.expected @@ -12,7 +12,7 @@ | arguments.c | 12 | linux_x86_64 | | arguments.c | 13 | --gcc | | arguments.c | 14 | --predefined_macros | -| arguments.c | 15 | /tools/qltest/predefined_macros | +| arguments.c | 15 | /qltest/predefined_macros | | arguments.c | 16 | -w | | arguments.c | 17 | -Werror | | arguments.c | 18 | arguments.c | diff --git a/cpp/ql/test/library-tests/arguments/arguments.ql b/cpp/ql/test/library-tests/arguments/arguments.ql index ad9e04c2668..9a4941b4550 100644 --- a/cpp/ql/test/library-tests/arguments/arguments.ql +++ b/cpp/ql/test/library-tests/arguments/arguments.ql @@ -7,5 +7,5 @@ where s = c .getArgument(i) .replaceAll("\\", "/") - .regexpReplaceAll(".*(tools/qltest/predefined_macros)", "/$1") + .regexpReplaceAll(".*(/qltest/predefined_macros)", "$1") select c.getAFileCompiled().toString(), i, s