From 72849174cdaeaca2d2bef0a7d6ceaeed2b768893 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sat, 3 Feb 2024 11:52:43 +0000 Subject: [PATCH] Fix errors in testing scripts --- .clang-tidy | 2 ++ meson.build | 3 ++- scripts/lua-test.sh | 13 ++++++++++--- scripts/test-all.sh | 6 +++--- 4 files changed, 17 insertions(+), 7 deletions(-) mode change 100644 => 100755 scripts/lua-test.sh diff --git a/.clang-tidy b/.clang-tidy index 2c73f5c8..a9603896 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -60,3 +60,5 @@ Checks: > -readability-simplify-boolean-expr, -readability-suspicious-call-argument, -readability-uppercase-literal-suffix + +WarningsAsErrors: "*" diff --git a/meson.build b/meson.build index 9a137944..24f8c74d 100644 --- a/meson.build +++ b/meson.build @@ -689,8 +689,9 @@ if running_from_git path_array = modified_file_path.split('/') modified_file_name = path_array[path_array.length() - 1] modified_file_full_path = join_paths(meson.project_source_root(), modified_file) + config_file = join_paths(meson.project_source_root(), '.clang-tidy') - test('Code Correctness_ ' + modified_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', modified_file_full_path], timeout : 100) + test('Code Correctness_ ' + modified_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file, modified_file_full_path], timeout : 100) endif endforeach diff --git a/scripts/lua-test.sh b/scripts/lua-test.sh old mode 100644 new mode 100755 index 939a024a..29bc31b8 --- a/scripts/lua-test.sh +++ b/scripts/lua-test.sh @@ -26,10 +26,17 @@ ## ## Create a basic image and run all lua built-in functions on it. ## The image file and the Lua test file are created within this script. +set -x +if [ -z "$XDG_CONFIG_HOME" ] +then + config_home="$HOME/.config" +else + config_home="$XDG_CONFIG_HOME" +fi lua_test_image=$(mktemp --suffix=".jpeg" "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX") -mkdir -p "$HOME/.config/geeqie/lua/" -lua_test_file=$(mktemp --suffix=".lua" --tmpdir="$HOME/.config/geeqie/lua/" lua-test-XXXXXX) +mkdir -p "$config_home/geeqie/lua/" +lua_test_file=$(mktemp --suffix=".lua" --tmpdir="$config_home/geeqie/lua/" lua-test-XXXXXX) # Test image generated by: # convert -size 32x32 xc:white empty.jpg @@ -54,7 +61,7 @@ printf "%s" "$lua_test" > "$lua_test_file" xvfb-run --auto-servernum "$1" & # Wait for remote to initialize -while [ ! -e "$HOME/.config/geeqie/.command" ] ; +while [ ! -e "$config_home/geeqie/.command" ] ; do sleep 1 done diff --git a/scripts/test-all.sh b/scripts/test-all.sh index 666aecaa..9424e354 100755 --- a/scripts/test-all.sh +++ b/scripts/test-all.sh @@ -82,6 +82,6 @@ meson test -C build cp ./build/meson-logs/testlog.txt "$tmpdir/testlog-options-enabled.txt" -rm -r "XDG_CONFIG_HOME" -rm -r "XDG_CACHE_HOME" -rm -r "XDG_DATA_HOME" +rm -r "$XDG_CONFIG_HOME" +rm -r "$XDG_CACHE_HOME" +rm -r "$XDG_DATA_HOME" -- 2.20.1