Newer
Older
dub_jkp / test / 4-describe-import-paths.sh
@Nick Sabalausky Nick Sabalausky on 26 Jun 2015 819 bytes Add 'dub describe --data='.
  1. #!/bin/bash
  2.  
  3. set -e -o pipefail
  4.  
  5. cd "$CURR_DIR"/describe-project
  6.  
  7. temp_file=`mktemp`
  8.  
  9. function cleanup {
  10. rm $temp_file
  11. }
  12.  
  13. trap cleanup EXIT
  14.  
  15. if ! $DUB describe --compiler=$COMPILER --import-paths > "$temp_file"; then
  16. die 'Printing import paths failed!'
  17. fi
  18.  
  19. # Create the expected output path file to compare against.
  20. echo "$CURR_DIR/describe-project/src/" > "$CURR_DIR/expected-import-path-output"
  21. echo "$CURR_DIR/describe-dependency-1/source/" >> "$CURR_DIR/expected-import-path-output"
  22. echo "$CURR_DIR/describe-dependency-2/some-path/" >> "$CURR_DIR/expected-import-path-output"
  23. echo "$CURR_DIR/describe-dependency-3/dep3-source/" >> "$CURR_DIR/expected-import-path-output"
  24.  
  25. if ! diff "$CURR_DIR"/expected-import-path-output "$temp_file"; then
  26. die 'The import paths did not match the expected output!'
  27. fi
  28.