diff options
author | Nadrieril Feneanar | 2020-03-17 18:10:40 +0000 |
---|---|---|
committer | GitHub | 2020-03-17 18:10:40 +0000 |
commit | 6d82e0040316b4feefd3d95129829f91b595b5f2 (patch) | |
tree | 30dc5ece69d74027ed84ba7aeeb1ca575dea15ee /update-tests.sh | |
parent | 65e8aa46344b9dc32c3ad776856791d18cc616c3 (diff) | |
parent | cd30948242576e9262796d4ecd998b62619b0e8a (diff) |
Merge pull request #143 from Nadrieril/record-puns
Implement record puns
Diffstat (limited to '')
-rwxr-xr-x | update-tests.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/update-tests.sh b/update-tests.sh index 7be40c4..ce5a67c 100755 --- a/update-tests.sh +++ b/update-tests.sh @@ -75,16 +75,18 @@ function generate_output_file() { file="$2" INPUT_FILE="$(${folder}_input_file "$file")" OUTPUT_FILE="$(${folder}_output_file "$file")" + if [ ! -f "$OUTPUT_FILE" ]; then echo "$OUTPUT_FILE" ${folder}_process "$INPUT_FILE" > "$tmpfile" if [ $? -eq 0 ]; then mv "$tmpfile" "$OUTPUT_FILE" - if [ "$folder" = "parser" ]; then - cat "$OUTPUT_FILE" | cbor2diag.rb > "${file}B.diag" - fi fi fi + + if [ -f "$OUTPUT_FILE" -a "$folder" = "parser" -a ! -f "${file}B.diag" ]; then + cat "$OUTPUT_FILE" | cbor2diag.rb > "${file}B.diag" + fi } if [ "$1" = "missing" ]; then @@ -94,7 +96,7 @@ if [ "$1" = "missing" ]; then # This is not robust to spaces in filenames, but hopefully there should be none fd 'A\.dhallb?$' "$root/$folder/success" \ | sed 's/A.dhallb\?$//' \ - | while read file; do + | while read -r file; do generate_output_file "$folder" "$file" done done @@ -105,10 +107,11 @@ elif [ "$1" = "add" ]; then # normalization/unit/TextShowEmpty Text/show "" # This will add a test to the local tests folder for each such line, and generate # the output using the `dhall` command in the PATH. - while read file contents; do + while read -r file contents; do folder="$(echo "$file" | cut -d/ -f1)" is_success="$(echo "$file" | cut -d/ -f2)" file="./dhall/tests/$file" + # file="./dhall-lang/tests/$file" mkdir -p "$(dirname "$file")" if [ "$is_success" = "success" ]; then |