Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproduction test case for #208 #2596

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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