Newer
Older
dub_jkp / test / issue1194-warn-wrong-subconfig.sh
@WebFreak001 WebFreak001 on 8 Aug 2022 1 KB improve some output coloring
  1. #!/usr/bin/env bash
  2. set -e
  3.  
  4. OUTPUT=`${DUB} build --root ${CURR_DIR}/issue1194-warn-wrong-subconfig 2>&1 || true`
  5.  
  6. trap 'printf "%s" "Failing received output:\n$OUTPUT" | hexdump -C' ERR
  7.  
  8. # make sure the proper errors occur in the output
  9. echo "$OUTPUT" | fgrep -c 'sub configuration directive "bar" -> [baz] references a package that is not specified as a dependency' > /dev/null
  10. echo $OUTPUT | fgrep -c 'sub configuration directive "staticlib-simple" -> [foo] references a configuration that does not exist' > /dev/null
  11. ! echo $OUTPUT | fgrep -c 'sub configuration directive "sourcelib-simple" -> [library] references a package that is not specified as a dependency' > /dev/null
  12. ! echo $OUTPUT | fgrep -c 'sub configuration directive "sourcelib-simple" -> [library] references a configuration that does not exist' > /dev/null
  13.  
  14. # make sure no bogs warnings are issued for packages with no sub configuration directives
  15. OUTPUT=`${DUB} build --root ${CURR_DIR}/1-exec-simple 2>&1`
  16. ! echo $OUTPUT | grep -c 'sub configuration directive.*references' > /dev/null