Skip to content

Commit 7d974fa

Browse files
committed
check_library_manager_compliance: Improve error/warning messages
1 parent 67ef57c commit 7d974fa

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

arduino-ci-script.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,28 +2280,28 @@ function check_library_manager_compliance() {
22802280

22812281
# Check whether folder exists
22822282
if [[ ! -d "$normalizedLibraryPath" ]]; then
2283-
echo "ERROR: Specified folder: $libraryPath doesn't exist."
2283+
echo "ERROR: ${libraryPath}: Folder doesn't exist."
22842284
return $ARDUINO_CI_SCRIPT_CHECK_LIBRARY_MANAGER_COMPLIANCE_FOLDER_DOESNT_EXIST_EXIT_STATUS
22852285
fi
22862286

22872287
# Check for .exe files
22882288
local -r exePath=$(find "$normalizedLibraryPath" -type f -name '*.exe')
22892289
if [[ "$exePath" != "" ]]; then
2290-
echo "ERROR: .exe file found at $exePath"
2290+
echo "ERROR: ${exePath}: .exe file found."
22912291
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_LIBRARY_MANAGER_COMPLIANCE_EXE_FOUND_EXIT_STATUS)
22922292
fi
22932293

22942294
# Check for .development file
22952295
local -r dotDevelopmentPath=$(find "$normalizedLibraryPath" -maxdepth 1 -type f -name '.development')
22962296
if [[ "$dotDevelopmentPath" != "" ]]; then
2297-
echo "ERROR: .development file found at $dotDevelopmentPath"
2297+
echo "ERROR: ${dotDevelopmentPath}: .development file found."
22982298
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_LIBRARY_MANAGER_COMPLIANCE_DOT_DEVELOPMENT_FOUND_EXIT_STATUS)
22992299
fi
23002300

23012301
# Check for symlink
23022302
local -r symlinkPath=$(find "$normalizedLibraryPath" -type l)
23032303
if [[ "$symlinkPath" != "" ]]; then
2304-
echo "ERROR: Symlink found at $symlinkPath"
2304+
echo "ERROR: ${symlinkPath}: Symlink found."
23052305
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_LIBRARY_MANAGER_COMPLIANCE_SYMLINK_FOUND_EXIT_STATUS)
23062306
fi
23072307

@@ -2317,7 +2317,7 @@ function check_library_manager_compliance() {
23172317
check_folder_name "$libraryManagerFolderName"
23182318
local -r checkFolderNameExitStatus=$?
23192319
if [[ $checkFolderNameExitStatus -ne $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS ]]; then
2320-
echo "ERROR: ${normalizedLibraryPath}'s name value $nameValue does not meet the requirements of the Arduino Library Manager indexer. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format"
2320+
echo "ERROR: ${normalizedLibraryPath}/library.properties: name value: $nameValue does not meet the requirements of the Arduino Library Manager indexer. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format"
23212321
exitStatus=$(set_exit_status "$exitStatus" $((ARDUINO_CI_SCRIPT_CHECK_LIBRARY_MANAGER_COMPLIANCE_CHECK_FOLDER_NAME_OFFSET + checkFolderNameExitStatus)))
23222322
fi
23232323
fi

tests/check_library_manager_compliance.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ source ../arduino-ci-script.sh
1616
echo "Exit status: $status | Expected: $expectedExitStatus"
1717
[ "$status" -eq $expectedExitStatus ]
1818
[ "${#lines[@]}" -eq 1 ]
19-
outputRegex="^ERROR: Specified folder: \./check_library_manager_compliance/DoesntExist doesn't exist\.$"
19+
outputRegex="^ERROR: \./check_library_manager_compliance/DoesntExist: Folder doesn't exist\.$"
2020
[[ "${lines[0]}" =~ $outputRegex ]]
2121
}
2222

@@ -26,7 +26,7 @@ source ../arduino-ci-script.sh
2626
echo "Exit status: $status | Expected: $expectedExitStatus"
2727
[ "$status" -eq $expectedExitStatus ]
2828
[ "${#lines[@]}" -eq 1 ]
29-
outputRegex='^ERROR: \.exe file found at \./check_library_manager_compliance/ContainsExe/asdf\.exe$'
29+
outputRegex='^ERROR: \./check_library_manager_compliance/ContainsExe/asdf\.exe: \.exe file found\.$'
3030
[[ "${lines[0]}" =~ $outputRegex ]]
3131
}
3232

@@ -36,7 +36,7 @@ source ../arduino-ci-script.sh
3636
echo "Exit status: $status | Expected: $expectedExitStatus"
3737
[ "$status" -eq $expectedExitStatus ]
3838
[ "${#lines[@]}" -eq 1 ]
39-
outputRegex='^ERROR: \.development file found at \./check_library_manager_compliance/ContainsDotDevelopment/\.development$'
39+
outputRegex='^ERROR: \./check_library_manager_compliance/ContainsDotDevelopment/\.development: \.development file found\.$'
4040
[[ "${lines[0]}" =~ $outputRegex ]]
4141
}
4242

@@ -46,7 +46,7 @@ source ../arduino-ci-script.sh
4646
echo "Exit status: $status | Expected: $expectedExitStatus"
4747
[ "$status" -eq $expectedExitStatus ]
4848
[ "${#lines[@]}" -eq 1 ]
49-
outputRegex='^ERROR: Symlink found at \./check_library_manager_compliance/ContainsSymlink/IsSymlink$'
49+
outputRegex='^ERROR: \./check_library_manager_compliance/ContainsSymlink/IsSymlink: Symlink found\.$'
5050
[[ "${lines[0]}" =~ $outputRegex ]]
5151
}
5252

@@ -59,7 +59,7 @@ source ../arduino-ci-script.sh
5959
[ "${#lines[@]}" -eq 2 ]
6060
outputRegex='^ERROR: Invalid folder name: -Foobar\. Folder name beginning with a - or \. is not allowed\.$'
6161
[[ "${lines[0]}" =~ $outputRegex ]]
62-
outputRegex="^ERROR: \./check_library_manager_compliance/InvalidCharactersAtStartOfName's name value -Foobar does not meet the requirements of the Arduino Library Manager indexer\. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format$"
62+
outputRegex="^ERROR: \./check_library_manager_compliance/InvalidCharactersAtStartOfName/library.properties: name value: -Foobar does not meet the requirements of the Arduino Library Manager indexer\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#libraryproperties-file-format$"
6363
[[ "${lines[1]}" =~ $outputRegex ]]
6464
}
6565

@@ -71,7 +71,7 @@ source ../arduino-ci-script.sh
7171
[ "${#lines[@]}" -eq 2 ]
7272
outputRegex='^ERROR: Invalid folder name: Foo\(bar\)\. Only letters, numbers, dots, dashes, and underscores are allowed\.$'
7373
[[ "${lines[0]}" =~ $outputRegex ]]
74-
outputRegex="^ERROR: \./check_library_manager_compliance/InvalidCharactersInName's name value Foo\(bar\) does not meet the requirements of the Arduino Library Manager indexer\. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format$"
74+
outputRegex="^ERROR: \./check_library_manager_compliance/InvalidCharactersInName/library.properties: name value: Foo\(bar\) does not meet the requirements of the Arduino Library Manager indexer\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#libraryproperties-file-format$"
7575
[[ "${lines[1]}" =~ $outputRegex ]]
7676
}
7777

@@ -83,6 +83,6 @@ source ../arduino-ci-script.sh
8383
[ "${#lines[@]}" -eq 2 ]
8484
outputRegex='^ERROR: Folder name asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf exceeds the maximum of 63 characters\.$'
8585
[[ "${lines[0]}" =~ $outputRegex ]]
86-
outputRegex="^ERROR: \./check_library_manager_compliance/NameTooLong's name value asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf does not meet the requirements of the Arduino Library Manager indexer\. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format$"
86+
outputRegex="^ERROR: \./check_library_manager_compliance/NameTooLong/library\.properties: name value: asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf does not meet the requirements of the Arduino Library Manager indexer\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#libraryproperties-file-format$"
8787
[[ "${lines[1]}" =~ $outputRegex ]]
8888
}

0 commit comments

Comments
 (0)