Newer
Older
dub_jkp / test / 4-describe-import-paths.sh
@Martin Nowak Martin Nowak on 29 Sep 2015 836 bytes use DC instead of COMPILER
  1. #!/bin/bash
  2.  
  3. set -e -o pipefail
  4.  
  5. cd "$CURR_DIR"/describe-project
  6.  
  7. temp_file=$(mktemp $(basename $0).XXXXXX)
  8.  
  9. function cleanup {
  10. rm $temp_file
  11. }
  12.  
  13. trap cleanup EXIT
  14.  
  15. if ! $DUB describe --compiler=$DC --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.