From f6db40818e467887829a676bd512dacbe70b06cb Mon Sep 17 00:00:00 2001 From: Clyde Gerber Date: Mon, 30 Oct 2023 11:24:36 -0400 Subject: [PATCH] Replace the whitespace character in the sed regular expression that operates on ctags output with a space and replace 'echo' with 'printf' to write out the coverage report. Sort output files with a stable, case-insensitive sort. --- build/showprogress.sh | 11 +++++++---- coverage/report.md | 14 +++++++------- coverage/udat_implemented.txt | 8 ++++---- coverage/uenum_implemented.txt | 2 +- coverage/umsg_all.txt | 4 ++-- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/build/showprogress.sh b/build/showprogress.sh index 2d557843..59c33509 100755 --- a/build/showprogress.sh +++ b/build/showprogress.sh @@ -32,7 +32,7 @@ ICU_INCLUDE_PATH="$(icu-config --cppflags-searchpath | sed -e 's/-I//' | sed -e for header_basename in ${C_API_HEADER_NAMES[@]}; do header_fullname="${ICU_INCLUDE_PATH}/unicode/${header_basename}.h" echo $header_basename: $header_fullname - ctags -x --c-kinds=fp $header_fullname | sed -e 's/\s.*$//' \ + ctags -x --c-kinds=fp $header_fullname | sed -e 's/ .*$//' \ | grep -v U_DEFINE | sort | uniq \ > "${TOP_DIR}/coverage/${header_basename}_all.txt" @@ -56,7 +56,7 @@ EOF for header_basename in ${C_API_HEADER_NAMES[@]}; do total_functions="$(cat "${TOP_DIR}"/coverage/${header_basename}_all.txt | wc -l)" implemented_functions="$(cat "${TOP_DIR}"/coverage/${header_basename}_implemented.txt | wc -l)" - echo "| \`${header_basename}.h\` | ${implemented_functions} / ${total_functions} | " >> "${REPORT_FILE}" + printf "| \`%s.h\` | %s / %s | \n" ${header_basename} ${implemented_functions} ${total_functions} >> "${REPORT_FILE}" done cat <>"${REPORT_FILE}" @@ -71,15 +71,18 @@ for header_basename in ${C_API_HEADER_NAMES[@]}; do | Unimplemented | Implemented | | ------------- | ----------- | EOF - for fun in $(cat "${TOP_DIR}/coverage/${header_basename}_implemented.txt"); do + for fun in $(cat "${TOP_DIR}/coverage/${header_basename}_implemented.txt" | sort -fs); do echo "| | \`${fun}\` |" >>"${REPORT_FILE}" done unimplemented="$(comm -23 \ "${TOP_DIR}/coverage/${header_basename}_all.txt" \ - "${TOP_DIR}/coverage/${header_basename}_implemented.txt" | sort | uniq)" + "${TOP_DIR}/coverage/${header_basename}_implemented.txt" | sort -fs | uniq)" for fun in ${unimplemented}; do echo "| \`${fun}\` | |" >>"${REPORT_FILE}" done + + sort -fs -o "${TOP_DIR}/coverage/${header_basename}_all.txt" "${TOP_DIR}/coverage/${header_basename}_all.txt" + sort -fs -o "${TOP_DIR}/coverage/${header_basename}_implemented.txt" "${TOP_DIR}/coverage/${header_basename}_implemented.txt" done diff --git a/coverage/report.md b/coverage/report.md index 32023144..fcbf7db1 100644 --- a/coverage/report.md +++ b/coverage/report.md @@ -162,15 +162,15 @@ | Unimplemented | Implemented | | ------------- | ----------- | -| | `udat_close` | | | `UDateFormat` | | | `UDateTimePatternGenerator` | -| | `udat_format` | -| | `udat_open` | -| | `udat_parse` | | | `udatpg_clone` | | | `udatpg_getBestPattern` | | | `udatpg_open` | +| | `udat_close` | +| | `udat_format` | +| | `udat_open` | +| | `udat_parse` | | | `udat_setCalendar` | | `udat_adoptNumberFormat` | | | `udat_adoptNumberFormatForFields` | | @@ -228,8 +228,8 @@ | | `ucal_openCountryTimeZones` | | | `ucal_openTimeZoneIDEnumeration` | | | `ucal_openTimeZones` | -| | `uenum_close` | | | `UEnumeration` | +| | `uenum_close` | | | `uenum_next` | | | `uenum_openCharStringsEnumeration` | | | `uloc_openKeywords` | @@ -331,8 +331,6 @@ | | `umsg_format` | | | `umsg_open` | | | `umsg_vformat` | -| `u_formatMessage` | | -| `u_formatMessageWithError` | | | `umsg_applyPattern` | | | `umsg_autoQuoteApostrophe` | | | `umsg_getLocale` | | @@ -340,6 +338,8 @@ | `umsg_setLocale` | | | `umsg_toPattern` | | | `umsg_vparse` | | +| `u_formatMessage` | | +| `u_formatMessageWithError` | | | `u_parseMessage` | | | `u_parseMessageWithError` | | | `u_vformatMessage` | | diff --git a/coverage/udat_implemented.txt b/coverage/udat_implemented.txt index 7b3bc415..75c2b815 100644 --- a/coverage/udat_implemented.txt +++ b/coverage/udat_implemented.txt @@ -1,10 +1,10 @@ -udat_close UDateFormat UDateTimePatternGenerator -udat_format -udat_open -udat_parse udatpg_clone udatpg_getBestPattern udatpg_open +udat_close +udat_format +udat_open +udat_parse udat_setCalendar diff --git a/coverage/uenum_implemented.txt b/coverage/uenum_implemented.txt index 790474bf..13874fd8 100644 --- a/coverage/uenum_implemented.txt +++ b/coverage/uenum_implemented.txt @@ -1,8 +1,8 @@ ucal_openCountryTimeZones ucal_openTimeZoneIDEnumeration ucal_openTimeZones -uenum_close UEnumeration +uenum_close uenum_next uenum_openCharStringsEnumeration uloc_openKeywords diff --git a/coverage/umsg_all.txt b/coverage/umsg_all.txt index e854250d..f71b8760 100644 --- a/coverage/umsg_all.txt +++ b/coverage/umsg_all.txt @@ -1,5 +1,3 @@ -u_formatMessage -u_formatMessageWithError umsg_applyPattern umsg_autoQuoteApostrophe umsg_clone @@ -12,6 +10,8 @@ umsg_setLocale umsg_toPattern umsg_vformat umsg_vparse +u_formatMessage +u_formatMessageWithError u_parseMessage u_parseMessageWithError u_vformatMessage