summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-10-24 22:30:42 +0100
committerGitHub <noreply@github.com>2017-10-24 22:30:42 +0100
commitfe729dab583d69853c20d373a0eb217a971f14a0 (patch)
tree0c316d99de3674cf8c1c86f729e49ac54d7902ab /test
parent07dad64acb2ac67c3ccf5582995e3377d1479aa7 (diff)
parented93cd14942e3b9fe3b56e9a2f54112a302ce4ef (diff)
downloadale-fe729dab583d69853c20d373a0eb217a971f14a0.zip
Merge pull request #1030 from grddev/run-tests-osx
Update test scripts to work on OS X
Diffstat (limited to 'test')
-rwxr-xr-xtest/script/check-supported-tools-tables20
-rwxr-xr-xtest/script/check-toc11
2 files changed, 16 insertions, 15 deletions
diff --git a/test/script/check-supported-tools-tables b/test/script/check-supported-tools-tables
index 1d0fec53..32cebb2d 100755
--- a/test/script/check-supported-tools-tables
+++ b/test/script/check-supported-tools-tables
@@ -30,30 +30,30 @@ readme_section_size="$( \
# shellcheck disable=SC2003
readme_end_line="$(expr "$readme_start_line" + "$readme_section_size")"
-doc_file="$(mktemp)"
-readme_file="$(mktemp)"
+doc_file="$(mktemp -t doc.XXXXXXXX)"
+readme_file="$(mktemp -t readme.XXXXXXXX)"
sed -n "$ale_help_start_line,$ale_help_end_line"p doc/ale.txt \
| grep '\* .*: ' \
| sed 's/^*//' \
- | sed 's/[`!^]\|([^)]*)//g' \
+ | sed 's/[`!^]//g;s/([^)]*)//g' \
| sed 's/ *\([,:]\)/\1/g' \
| sed 's/ */ /g' \
- | sed 's/^ *\| *$//g' \
+ | sed 's/^ *//;s/ *$//' \
| sed 's/^/ /' \
> "$doc_file"
sed -n "$readme_start_line,$readme_end_line"p README.md \
| grep '| .* |' \
- | sed '/^| Language\|^| ---/d' \
+ | sed '/^| Language/d;/^| ---/d' \
| sed 's/^|//' \
- | sed 's/ \?|/:/' \
- | sed 's/[`!^|]\|([^)]*)//g' \
- | sed 's/\[\|\]//g' \
- | sed 's/see[^,]*\(,\|$\)/\1/g' \
+ | sed 's/ \{0,1\}|/:/' \
+ | sed 's/[`!^|]//g;s/([^)]*)//g' \
+ | sed 's/\[//g;s/\]//g' \
+ | sed 's/see[^,]*//g' \
| sed 's/ *\([,:]\)/\1/g' \
| sed 's/ */ /g' \
- | sed 's/^ *\| *$//g' \
+ | sed 's/^ *//;s/ *$//' \
| sed 's/^/ /' \
| sed 's/ *-n flag//g' \
> "$readme_file"
diff --git a/test/script/check-toc b/test/script/check-toc
index c4512b08..426d5a1d 100755
--- a/test/script/check-toc
+++ b/test/script/check-toc
@@ -23,18 +23,19 @@ tagged_toc_file="$(mktemp -t ale.txt.XXXXXXXX)"
sorted_toc_file="$(mktemp -t sorted-ale.txt.XXXXXXXX)"
sed -n "$toc_start_line,$toc_end_line"p doc/ale.txt \
- | sed 's/^ \( *[^.]\+\)\.\+|\(.\+\)|/\1, \2/' \
+ | sed 's/^ \( *[^.][^.]*\)\.\.*|\(..*\)|/\1, \2/' \
> "$toc_file"
# Get all of the doc files in a natural sorted order.
-doc_files="$(/bin/ls -1v doc | grep ^ale- | sed 's/^/doc\//' | paste -sd ' ')"
+doc_files="$(/bin/ls -1v doc | grep ^ale- | sed 's/^/doc\//' | paste -sd ' ' -)"
# shellcheck disable=SC2086
grep -h 'ale-.*-options\|^[a-z].*\*ale-.*\*$' $doc_files \
| sed 's/^/ /' \
| sed 's/ALE Shell Integration/ALE sh Integration/' \
- | sed 's/ ALE \(.*\) Integration/\L\1/' \
- | sed 's/ *\*\(.\+\)\*$/, \1/' \
+ | sed 's/ ALE \(.*\) Integration/\1/' \
+ | sed 's/ *\*\(..*\)\*$/, \1/' \
+ | tr '[:upper:]' '[:lower:]' \
| sed 's/objective-c/objc/' \
| sed 's/c++/cpp/' \
> "$heading_file"
@@ -62,7 +63,7 @@ while read -r; do
done < "$toc_file"
# Sort the sections and sub-sections and remove the tags.
-sort -h "$tagged_toc_file" | sed 's/[0-9]\+ //' > "$sorted_toc_file"
+sort -sn "$tagged_toc_file" | sed 's/[0-9][0-9]* //' > "$sorted_toc_file"
echo 'Check for bad ToC sorting:'
echo