File: test.sh

package info (click to toggle)
haskell-futhark 0.25.32-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,236 kB
  • sloc: haskell: 100,484; ansic: 12,100; python: 3,440; yacc: 785; sh: 561; javascript: 558; lisp: 399; makefile: 277
file content (19 lines) | stat: -rwxr-xr-x 455 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
test_dir="TEMP"
diff_error=0

rm -rf "$test_dir" && mkdir "$test_dir"
for file in *.fut; do
    fmtFile=$test_dir/$(basename -s .fut $file).fmt.fut
    if futhark fmt --check expected/$file; then
        futhark fmt < $file > $fmtFile
        if ! cmp --silent expected/$file $fmtFile; then
            echo "$file didn't format as expected"
            diff_error=1
        else
            rm $fmtFile
        fi
    fi
done

exit $diff_error