Add a script to check all sample org-mode documents with the compare program.
This commit is contained in:
27
scripts/compare_parse_all.bash
Executable file
27
scripts/compare_parse_all.bash
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Check that the official org-mode parser and this implementation of an org-mode parser agree on how the sample org-mode documents should be parsed.
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "$DIR"
|
||||
|
||||
: ${org_dir:="$DIR/../org_mode_samples"}
|
||||
: ${compare_bin:="$DIR/../target/debug/org_compare"}
|
||||
|
||||
test_files=$(find $org_dir -type f -name '*.org')
|
||||
|
||||
cargo build --bin org_compare
|
||||
|
||||
|
||||
while read test_file; do
|
||||
set +e
|
||||
diff_results=$("$compare_bin" "$test_file")
|
||||
diff_status=$?
|
||||
set -e
|
||||
if [ $diff_status -eq 0 ]; then
|
||||
echo "GOOD $test_file"
|
||||
else
|
||||
echo "BAD $test_file"
|
||||
fi
|
||||
done<<<"$test_files"
|
||||
Reference in New Issue
Block a user