Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions test/issue208-generate-cwd-root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e

. $(dirname "${BASH_SOURCE[0]}")/common.sh

if [ -f issue208-generate-cwd-root.sln ] || [ -f .dub/issue208-generate-cwd-root.visualdproj]; then
die $LINENO 'Did not expect VisualD files for this test to exist in the working directory'
fi

function cleanup {
rm -rf "$CURR_DIR/issue208-generate-cwd-root"
}

mkdir "$CURR_DIR/issue208-generate-cwd-root"

trap cleanup EXIT

pushd "$CURR_DIR/issue208-generate-cwd-root"

$DUB init -n

popd

$DUB generate visuald --root="$CURR_DIR/issue208-generate-cwd-root"

if [ -f issue208-generate-cwd-root.sln ] || [ -f .dub/issue208-generate-cwd-root.visualdproj ]; then
rm -f issue208-generate-cwd-root.sln .dub/issue208-generate-cwd-root.visualdproj
die $LINENO 'VisualD files were generated in CWD instead of inside package directory'
fi

if [ ! -f "$CURR_DIR/issue208-generate-cwd-root/issue208-generate-cwd-root.sln" ] then
die $LINENO 'no VisualD files were generated in target package directory'
fi

# TODO: when the tests above work, make sure the paths in the generated
# .visualdproj file are all relative to the package, and not relative to $CURR_DIR