diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2018-10-06 01:22:43 -0400 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2018-10-07 15:16:00 -0400 |
commit | 56432a44c64e6ab3b663fe783fd1b2138cee689d (patch) | |
tree | fa212e0adf4a4a28666f0a42879c08651e7202a0 /other/analysis/check_logger_levels | |
parent | f5afc526550d935585f4023142853eeb95115734 (diff) |
Make sure logger levels stay in sync across files
Diffstat (limited to 'other/analysis/check_logger_levels')
-rwxr-xr-x | other/analysis/check_logger_levels | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/other/analysis/check_logger_levels b/other/analysis/check_logger_levels new file mode 100755 index 00000000..5cced4a1 --- /dev/null +++ b/other/analysis/check_logger_levels | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Make sure that logger levels in toxcore/logger.h, CMakeLists.txt and | ||
4 | # configure.ac stay in sync. | ||
5 | |||
6 | set -ex | ||
7 | |||
8 | TMP_DIR="$(mktemp -d)" | ||
9 | |||
10 | # ^\s+LOGGER_LEVEL_(\w+),?$ | ||
11 | sed -n 's/^\s\+LOGGER_LEVEL_\(\w\+\),\?$/\1/p' toxcore/logger.h > "${TMP_DIR}/logger.h" | ||
12 | # ^.*\$\{MIN_LOGGER_LEVEL\}" STREQUAL "(\w+)".*$ | ||
13 | sed -n 's/^.*\${MIN_LOGGER_LEVEL}\" STREQUAL \"\(\w\+\)\".*$/\1/p' CMakeLists.txt > "${TMP_DIR}/CMakeLists.txt" | ||
14 | # ^.*LOGGER_LEVEL_(\w+).*$ | ||
15 | sed -n 's/^.*LOGGER_LEVEL_\(\w\+\).*$/\1/p' configure.ac > "${TMP_DIR}/configure.ac" | ||
16 | |||
17 | diff -u "${TMP_DIR}/CMakeLists.txt" "${TMP_DIR}/logger.h" | ||
18 | diff -u "${TMP_DIR}/configure.ac" "${TMP_DIR}/logger.h" | ||