diff --git a/test/4-describe-data-dmd.sh b/test/4-describe-data-dmd.sh index 5b994c6..9d9bece 100755 --- a/test/4-describe-data-dmd.sh +++ b/test/4-describe-data-dmd.sh @@ -2,6 +2,11 @@ set -e -o pipefail +if ! dmd --help >/dev/null; then + echo Skipping DMD-centric test on configuration that lacks DMD. + exit +fi + cd "$CURR_DIR"/describe-project temp_file=`mktemp` diff --git a/test/4-describe-data-zero-delim.sh b/test/4-describe-data-zero-delim.sh index 0055f86..eaf8e88 100755 --- a/test/4-describe-data-zero-delim.sh +++ b/test/4-describe-data-zero-delim.sh @@ -14,38 +14,8 @@ trap cleanup EXIT -# Test dmd-style --data=versions -if ! $DUB describe --compiler=dmd --data=versions \ - > "$temp_file_normal"; then - die 'Printing dmd-style --data=versions failed!' -fi - -if ! $DUB describe --compiler=dmd --data-0 --data=versions \ - | xargs -0 printf "%s " > "$temp_file_zero_delim"; then - die 'Printing null-delimited dmd-style --data=versions failed!' -fi - -if ! diff -Z "$temp_file_normal" "$temp_file_zero_delim"; then - die 'The null-delimited dmd-style --data=versions did not match the expected output!' -fi - -# Test dmd-style --data=source-files -if ! $DUB describe --compiler=dmd --data=source-files \ - > "$temp_file_normal"; then - die 'Printing dmd-style --data=source-files failed!' -fi - -if ! $DUB describe --compiler=dmd --data-0 --data=source-files \ - | xargs -0 printf "'%s' " > "$temp_file_zero_delim"; then - die 'Printing null-delimited dmd-style --data=source-files failed!' -fi - -if ! diff -Z "$temp_file_normal" "$temp_file_zero_delim"; then - die 'The null-delimited dmd-style --data=source-files did not match the expected output!' -fi - # Test list-style project data -if ! $DUB describe --compiler=dmd --data-list \ +if ! $DUB describe --compiler=$COMPILER --data-list \ --data=target-type \ --data=target-path \ --data=target-name \ @@ -74,7 +44,7 @@ die 'Printing list-style project data failed!' fi -if ! $DUB describe --compiler=dmd --data-0 --data-list \ +if ! $DUB describe --compiler=$COMPILER --data-0 --data-list \ --data=target-type \ --data=target-path \ --data=target-name \ @@ -108,12 +78,12 @@ fi # Test --import-paths -if ! $DUB describe --compiler=dmd --import-paths \ +if ! $DUB describe --compiler=$COMPILER --import-paths \ > "$temp_file_normal"; then die 'Printing --import-paths failed!' fi -if ! $DUB describe --compiler=dmd --data-0 --import-paths \ +if ! $DUB describe --compiler=$COMPILER --data-0 --import-paths \ | xargs -0 printf "%s\n" > "$temp_file_zero_delim"; then die 'Printing null-delimited --import-paths failed!' fi @@ -121,3 +91,39 @@ if ! diff -Z -B "$temp_file_normal" "$temp_file_zero_delim"; then die 'The null-delimited --import-paths data did not match the expected output!' fi + +# DMD-only beyond this point +if ! dmd --help >/dev/null; then + echo Skipping DMD-centric tests on configuration that lacks DMD. + exit +fi + +# Test dmd-style --data=versions +if ! $DUB describe --compiler=dmd --data=versions \ + > "$temp_file_normal"; then + die 'Printing dmd-style --data=versions failed!' +fi + +if ! $DUB describe --compiler=dmd --data-0 --data=versions \ + | xargs -0 printf "%s " > "$temp_file_zero_delim"; then + die 'Printing null-delimited dmd-style --data=versions failed!' +fi + +if ! diff -Z "$temp_file_normal" "$temp_file_zero_delim"; then + die 'The null-delimited dmd-style --data=versions did not match the expected output!' +fi + +# Test dmd-style --data=source-files +if ! $DUB describe --compiler=dmd --data=source-files \ + > "$temp_file_normal"; then + die 'Printing dmd-style --data=source-files failed!' +fi + +if ! $DUB describe --compiler=dmd --data-0 --data=source-files \ + | xargs -0 printf "'%s' " > "$temp_file_zero_delim"; then + die 'Printing null-delimited dmd-style --data=source-files failed!' +fi + +if ! diff -Z "$temp_file_normal" "$temp_file_zero_delim"; then + die 'The null-delimited dmd-style --data=source-files did not match the expected output!' +fi