diff --git a/.gitignore b/.gitignore index e815926..d972db2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,24 @@ *.o *.obj +*.pdb *~ -.dub -.directory -dub.selections.json +# Unknown hidden files +.* +!.gitignore +!/.github +!/.editorconfig +!/.codecov.yml +# Unknown script files +/*.sh +/*.bat +/*.cmd +!/build.cmd +!/build.sh + +# dub generation files +dub.selections.json docs.json __dummy.html @@ -20,7 +33,22 @@ # Ignore files or directories created by the test suite. *.exe +*.lib *.log +/test/*/* +/test/*.* +!/test/*.d +!/test/*.d.min_frontend +!/test/*.sh +!/test/*.sh.min_frontend +!/test/*/.no_* +!/test/*/.min_frontend +!/test/*/.fail_build +!/test/*/dub.json +!/test/*/dub.sdl +!/test/*/dub.settings.json +!/test/*/source/ +!/test/*/src/ # Ignore coverage files cov/ diff --git a/test/1-dynLib-simple/source/dynlib/app.d b/test/1-dynLib-simple/source/dynlib/app.d index 6676219..a2d3eb5 100644 --- a/test/1-dynLib-simple/source/dynlib/app.d +++ b/test/1-dynLib-simple/source/dynlib/app.d @@ -1,5 +1,10 @@ module dynlib.app; import std.stdio; +version (unittest) {} else version (Windows) version (DigitalMars) +{ + import core.sys.windows.dll; + mixin SimpleDllMain; +} export void entry() { diff --git a/test/2-dynLib-dep/.no_build_windows b/test/2-dynLib-dep/.no_build_windows new file mode 100644 index 0000000..d55a120 --- /dev/null +++ b/test/2-dynLib-dep/.no_build_windows @@ -0,0 +1 @@ +# workaround for Issue 23177 diff --git a/test/2-dynLib-with-staticLib-dep/source/dynlib/app.d b/test/2-dynLib-with-staticLib-dep/source/dynlib/app.d index 9741cae..0672f7b 100644 --- a/test/2-dynLib-with-staticLib-dep/source/dynlib/app.d +++ b/test/2-dynLib-with-staticLib-dep/source/dynlib/app.d @@ -1,6 +1,11 @@ module dynlib.app; import std.stdio; import staticlib.app; +version (unittest) {} else version (Windows) version (DigitalMars) +{ + import core.sys.windows.dll; + mixin SimpleDllMain; +} void foo() { diff --git a/test/dub_test_root.sh b/test/dub_test_root.sh index c5ce710..7c0f50b 100755 --- a/test/dub_test_root.sh +++ b/test/dub_test_root.sh @@ -7,12 +7,13 @@ TMPDIR=$(mktemp -d "$(basename "$0").XXXXXX") +pushd "$TMPDIR" function cleanup { + popd rm -rf "$TMPDIR" } trap cleanup EXIT -cd "$TMPDIR" echo 'name "foo"' > dub.sdl diff --git a/test/interactive-remove.sh b/test/interactive-remove.sh index 8919fef..dfe1a94 100755 --- a/test/interactive-remove.sh +++ b/test/interactive-remove.sh @@ -8,33 +8,35 @@ # In the meantime, in order to make it pass on developer's machines, # we need to nuke every `dub` version in the user cache... $DUB remove dub -n || true +DUBPKGPATH=${DPATH+"$DPATH/dub/packages/dub"} +DUBPKGPATH=${DUBPKGPATH:-"$HOME/.dub/packages/dub"} -$DUB fetch dub@1.9.0 && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] -$DUB fetch dub@1.10.0 && [ -d $HOME/.dub/packages/dub/1.10.0/dub ] +$DUB fetch dub@1.9.0 && [ -d $DUBPKGPATH/1.9.0/dub ] +$DUB fetch dub@1.10.0 && [ -d $DUBPKGPATH/1.10.0/dub ] echo 1 | $DUB remove dub | tr -d '\n' | grep --ignore-case 'select.*1\.9\.0.*1\.10\.0.*' -if [ -d $HOME/.dub/packages/dub/1.9.0/dub ]; then +if [ -d $DUBPKGPATH/1.9.0/dub ]; then die $LINENO 'Failed to remove dub-1.9.0' fi -$DUB fetch dub@1.9.0 && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] +$DUB fetch dub@1.9.0 && [ -d $DUBPKGPATH/1.9.0/dub ] # EOF aborts remove echo -xn '' | $DUB remove dub -if [ ! -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ ! -d $HOME/.dub/packages/dub/1.10.0/dub ]; then +if [ ! -d $DUBPKGPATH/1.9.0/dub ] || [ ! -d $DUBPKGPATH/1.10.0/dub ]; then die $LINENO 'Aborted dub still removed a package' fi # validates input echo -e 'abc\n4\n-1\n3' | $DUB remove dub -if [ -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ -d $HOME/.dub/packages/dub/1.10.0/dub ]; then +if [ -d $DUBPKGPATH/1.9.0/dub ] || [ -d $DUBPKGPATH/1.10.0/dub ]; then die $LINENO 'Failed to remove all version of dub' fi -$DUB fetch dub@1.9.0 && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] -$DUB fetch dub@1.10.0 && [ -d $HOME/.dub/packages/dub/1.10.0/dub ] +$DUB fetch dub@1.9.0 && [ -d $DUBPKGPATH/1.9.0/dub ] +$DUB fetch dub@1.10.0 && [ -d $DUBPKGPATH/1.10.0/dub ] # is non-interactive with a $DUB remove dub@1.9.0 $DUB remove dub@1.10.0 -if [ -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ -d $HOME/.dub/packages/dub/1.10.0/dub ]; then +if [ -d $DUBPKGPATH/1.9.0/dub ] || [ -d $DUBPKGPATH/1.10.0/dub ]; then die $LINENO 'Failed to non-interactively remove specified versions' fi diff --git a/test/issue1775/dub.json b/test/issue1775/dub.json index 5640e4a..f1273ef 100644 --- a/test/issue1775/dub.json +++ b/test/issue1775/dub.json @@ -1,5 +1,6 @@ { "name": "test", "targetName": "test-application", - "preBuildCommands": [ "[ -f issue1775.marker ]" ] + "preBuildCommands-posix": [ "[ -f issue1775.marker ]" ], + "preBuildCommands-windows": [ "if not exist issue1775.marker exit /b 1" ] } diff --git a/test/issue2086-copyfiles-subpackage-targetpath/.no_test b/test/issue2086-copyfiles-subpackage-targetpath/.no_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue2086-copyfiles-subpackage-targetpath/.no_test diff --git a/test/issue97-targettype-none-onerecipe/.no_test b/test/issue97-targettype-none-onerecipe/.no_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue97-targettype-none-onerecipe/.no_test diff --git a/test/test_registry.d b/test/test_registry.d index cb9790f..6e98466 100755 --- a/test/test_registry.d +++ b/test/test_registry.d @@ -57,6 +57,6 @@ router.get("/fallback/*", folder.serveStaticFiles(new HTTPFileServerSettings("/fallback"))); router.get("/api/*", apiFileHandler("/", folder)); router.get("/fallback/api/*", apiFileHandler("/fallback/", folder)); - listenHTTP(text(":", port), router); + listenHTTP(text("localhost:", port), router); runApplication(); } diff --git a/test/version-spec.sh b/test/version-spec.sh index 053d177..b034df5 100755 --- a/test/version-spec.sh +++ b/test/version-spec.sh @@ -2,6 +2,9 @@ . $(dirname "${BASH_SOURCE[0]}")/common.sh +DUBPKGPATH=${DPATH+"$DPATH/dub/packages/dub"} +DUBPKGPATH=${DUBPKGPATH:-"$HOME/.dub/packages/dub"} + $DUB add-local "$CURR_DIR/version-spec/newfoo" $DUB add-local "$CURR_DIR/version-spec/oldfoo" @@ -43,10 +46,10 @@ $DUB remove-local "$CURR_DIR/version-spec/newfoo" $DUB remove-local "$CURR_DIR/version-spec/oldfoo" -$DUB fetch dub@1.9.0 && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] -$DUB fetch dub=1.10.0 && [ -d $HOME/.dub/packages/dub/1.10.0/dub ] +$DUB fetch dub@1.9.0 && [ -d $DUBPKGPATH/1.9.0/dub ] +$DUB fetch dub=1.10.0 && [ -d $DUBPKGPATH/1.10.0/dub ] $DUB remove dub@1.9.0 $DUB remove dub=1.10.0 -if [ -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ -d $HOME/.dub/packages/dub/1.10.0/dub ]; then +if [ -d $DUBPKGPATH/1.9.0/dub ] || [ -d $DUBPKGPATH/1.10.0/dub ]; then die $LINENO 'Failed to remove specified versions' fi