From b4d344e3808cf121219aa3cf9392497c8b79d49c Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu <razvan.deaconescu@upb.ro> Date: Tue, 16 Jan 2024 11:32:05 +0200 Subject: [PATCH] Update test configuration to pass code style checks Update `checkpatch.pl` configuration and the `_test/run_test.sh` shell script to pass code style checks. Signed-off-by: Razvan Deaconescu <razvan.deaconescu@upb.ro> --- .checkpatch.conf | 3 +++ tests/_test/run_test.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.checkpatch.conf b/.checkpatch.conf index 061911c..9d30c68 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -32,3 +32,6 @@ # Ignore SPLIT_STRING, quoted strings can be split on multiple lines. --ignore SPLIT_STRING + +# Ignore STRCPY, as `strscpy()` is only present in the Linux source. +--ignore STRCPY diff --git a/tests/_test/run_test.sh b/tests/_test/run_test.sh index e884859..40ac2ac 100755 --- a/tests/_test/run_test.sh +++ b/tests/_test/run_test.sh @@ -23,7 +23,7 @@ DEBUG_=0 DEBUG() { - if test "x$DEBUG_" = "x1"; then + if test "$DEBUG_" = "1"; then "$@" 1>&2 fi } @@ -80,7 +80,7 @@ test_do_fail() { points=$1 printf "failed [ 0/%02d]\n" $max_points - if test "x$EXIT_IF_FAIL" = "x1"; then + if test "$EXIT_IF_FAIL" = "1"; then exit 1 fi } -- GitLab