Skip to content

Commit

Permalink
Replace the whitespace character in the sed regular expression that o…
Browse files Browse the repository at this point in the history
…perates 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.
  • Loading branch information
clydegerber authored and filmil committed Oct 30, 2023
1 parent 77a9ed6 commit f6db408
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
11 changes: 7 additions & 4 deletions build/showprogress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 <<EOF >>"${REPORT_FILE}"
Expand All @@ -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

14 changes: 7 additions & 7 deletions coverage/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | |
Expand Down Expand Up @@ -228,8 +228,8 @@
| | `ucal_openCountryTimeZones` |
| | `ucal_openTimeZoneIDEnumeration` |
| | `ucal_openTimeZones` |
| | `uenum_close` |
| | `UEnumeration` |
| | `uenum_close` |
| | `uenum_next` |
| | `uenum_openCharStringsEnumeration` |
| | `uloc_openKeywords` |
Expand Down Expand Up @@ -331,15 +331,15 @@
| | `umsg_format` |
| | `umsg_open` |
| | `umsg_vformat` |
| `u_formatMessage` | |
| `u_formatMessageWithError` | |
| `umsg_applyPattern` | |
| `umsg_autoQuoteApostrophe` | |
| `umsg_getLocale` | |
| `umsg_parse` | |
| `umsg_setLocale` | |
| `umsg_toPattern` | |
| `umsg_vparse` | |
| `u_formatMessage` | |
| `u_formatMessageWithError` | |
| `u_parseMessage` | |
| `u_parseMessageWithError` | |
| `u_vformatMessage` | |
Expand Down
8 changes: 4 additions & 4 deletions coverage/udat_implemented.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion coverage/uenum_implemented.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ucal_openCountryTimeZones
ucal_openTimeZoneIDEnumeration
ucal_openTimeZones
uenum_close
UEnumeration
uenum_close
uenum_next
uenum_openCharStringsEnumeration
uloc_openKeywords
4 changes: 2 additions & 2 deletions coverage/umsg_all.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
u_formatMessage
u_formatMessageWithError
umsg_applyPattern
umsg_autoQuoteApostrophe
umsg_clone
Expand All @@ -12,6 +10,8 @@ umsg_setLocale
umsg_toPattern
umsg_vformat
umsg_vparse
u_formatMessage
u_formatMessageWithError
u_parseMessage
u_parseMessageWithError
u_vformatMessage
Expand Down

0 comments on commit f6db408

Please sign in to comment.