Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
b7f3ec4
run_unittest
the-horo Jul 23, 2025
576da19
common
the-horo Jul 23, 2025
ba2ff96
.gitignore
the-horo Jul 23, 2025
0311978
Add test README.md
the-horo Jul 14, 2025
8cb16ab
0-init-fail-json
the-horo Jul 23, 2025
a25064d
0-init-fail
the-horo Jul 23, 2025
3e2ef6d
0-init-interactive
the-horo Jul 23, 2025
c169d69
0-init-multi-json
the-horo Jul 23, 2025
1732fe7
0-init-multi
the-horo Jul 23, 2025
e45478a
0-init-simple
the-horo Jul 13, 2025
63bf5eb
0-init-simple-json
the-horo Jul 13, 2025
4a4e939
1-dynLib-simple
the-horo Jul 13, 2025
c52e7b0
1-exec-simple
the-horo Jul 13, 2025
27dc82e
1-exec-simple-package-json
the-horo Jul 13, 2025
bb65fc3
extra/1-sourceLib-simple
the-horo Jul 13, 2025
cad3c65
1-staticLib-simple
the-horo Jul 13, 2025
dcb2633
2-dynLib-dep
the-horo Jul 13, 2025
9575f01
2-dynLib-with-staticLib-dep
the-horo Jul 13, 2025
4492b71
2-sourceLib-dep
the-horo Jul 13, 2025
6e369bf
2-staticLib-dep
the-horo Jul 13, 2025
db333c1
3-copyFiles
the-horo Jul 14, 2025
477cd60
extra/4-describe
the-horo Jul 14, 2025
2c87f9b
4-describe-data-1-list
the-horo Jul 23, 2025
96eec4f
4-describe-data-2-dmd
the-horo Jul 15, 2025
2d4741e
4-describe-data-3-zero-delim
the-horo Jul 15, 2025
4137c09
4-describe-import-paths
the-horo Jul 15, 2025
af16a54
4-describe-json
the-horo Jul 15, 2025
a95566c
4-describe-string-import-paths
the-horo Jul 15, 2025
574fd65
drop 4-describe-data-check-escape since it's no longer used
the-horo Jul 15, 2025
8512c01
5-convert
the-horo Jul 15, 2025
571e8eb
5-convert-stdout
the-horo Jul 15, 2025
ca758e5
cache-generated-test-config
the-horo Jul 15, 2025
f734b36
colored-output
the-horo Jul 15, 2025
50ec4f2
cov-ctfe
the-horo Jul 16, 2025
361d05e
custom-source-main-but487
the-horo Jul 16, 2025
dfd6e32
custom-unittest
the-horo Jul 16, 2025
5cd8ba2
issue2012-dc-env
the-horo Jul 16, 2025
6faf0ae
ddox
the-horo Jul 16, 2025
0bdb2b3
depen-build-settings
the-horo Jul 17, 2025
85f5f19
dest-directory
the-horo Jul 17, 2025
c87efd3
dpath-variable
the-horo Jul 17, 2025
918dea8
dub-as-a-library-cwd
the-horo Jul 17, 2025
fc38ce4
dub-custom-root
the-horo Jul 17, 2025
eee872e
dub_test_root
the-horo Jul 17, 2025
2711bdf
dustmite-no-redirect
the-horo Jul 17, 2025
0cef8e8
d-versions
the-horo Jul 17, 2025
6d9af7b
environment-variables
the-horo Jul 17, 2025
93e2408
feat663-search
the-horo Jul 17, 2025
e3c180c
extra/test_registry
the-horo Jul 23, 2025
c2891f1
extra/issue1336-registry
the-horo Jul 23, 2025
fa32f9a
fetchzip
the-horo Jul 23, 2025
34ec142
filesystem-version-with-buildinfo
the-horo Jul 18, 2025
8768427
frameworks
the-horo Jul 18, 2025
583d3ed
frameworks - set targeType to executable in order to invoke the linker
the-horo Jul 18, 2025
afb915e
git-dependency
the-horo Jul 18, 2025
111b084
help
the-horo Jul 18, 2025
cfefaf8
ignore-hidden-1
the-horo Jul 18, 2025
2f7adbc
ignore-hidden-2
the-horo Jul 18, 2025
4453ddf
ignore-useless-arch-switch
the-horo Jul 18, 2025
435caa6
injected-from-dependency
the-horo Jul 18, 2025
1842af0
interactive-remove
the-horo Jul 19, 2025
6f25f44
issue1003-check-empty-ld-flags
the-horo Jul 19, 2025
622d2c3
issue1004-override-config
the-horo Jul 19, 2025
625af2a
issue1005-configuration-resolution
the-horo Jul 19, 2025
04d6c75
issue1024-selective-upgrade
the-horo Jul 19, 2025
c91d9f8
issue1037-better-dependency-messages
the-horo Jul 27, 2025
23758a0
issue103-single-file-package
the-horo Jul 19, 2025
4d05d93
issue1040-run-with-ver
the-horo Jul 19, 2025
78ee315
issue1053-extra-files-visuald
the-horo Jul 19, 2025
b2e8d62
issue1070-init-mistakes-dirs-as-files
the-horo Jul 19, 2025
ded0dba
issue1091-bogus-rebuild
the-horo Jul 19, 2025
1e79f95
issue1117-extra-dependency-files
the-horo Jul 19, 2025
39925c5
issue1136-temp-copy-files
the-horo Jul 19, 2025
1818f44
issue1158-stdin-for-single-file
the-horo Jul 19, 2025
b3e6457
extra/issue1416
the-horo Jul 19, 2025
b5017f5
issue1180-local-cache-broken
the-horo Jul 19, 2025
03ed829
issue1194-warn-wrong-subconfig
the-horo Jul 19, 2025
04b128d
issue1262-version-inheritance
the-horo Jul 19, 2025
7c973c5
issue1262-version-inheritance-diamond
the-horo Jul 19, 2025
54de124
issue1277
the-horo Jul 19, 2025
0af3966
issue130-unicode-СНАЯАСТЕЯЅ
the-horo Jul 19, 2025
6df6651
issue1350-transitive-none-deps
the-horo Jul 19, 2025
ae14697
issue1372-ignore-files-in-hidden-dirs
the-horo Jul 19, 2025
910154f
issue1396-pre-post-run-commands
the-horo Jul 19, 2025
48094ff
issue1401-file-system-pkg-supplier
the-horo Jul 19, 2025
87539b1
issue1408-inherit-linker-files
the-horo Jul 19, 2025
dc1f51e
issue1416-maven-repo-pkg-supplier
the-horo Jul 19, 2025
4d30c5a
issue1427-betterC
the-horo Jul 19, 2025
55f3263
issue1447-build-settings-vars
the-horo Jul 19, 2025
3a38f9f
issue1474-generate-source
the-horo Jul 19, 2025
eefaa8e
issue1477-subpackage-visuald-paths
the-horo Jul 19, 2025
8d154ab
issue1504-envvar-in-path
the-horo Jul 20, 2025
0c9be98
issue1505-single-file-package-dynamic-library
the-horo Jul 20, 2025
ca7f69a
issue1524-maven-upgrade-dependency-tree
the-horo Jul 20, 2025
72fc2d5
issue1531-toolchain-requirements
the-horo Jul 20, 2025
b79352a
issue1551-var-escaping
the-horo Jul 20, 2025
d7c7e5f
issue1556-fetch-and-build-pkgs
the-horo Jul 20, 2025
22fd99a
issue1567-fetch-sub-package
the-horo Jul 20, 2025
8c435ff
issue1574-addcommand
the-horo Jul 20, 2025
1db75b6
issue1636-betterC-dub-test
the-horo Jul 20, 2025
4a600aa
issue1645-dflags-build
the-horo Jul 20, 2025
a3a7f25
issue1651-custom-dub-init-type
the-horo Jul 20, 2025
e7362c7
issue1691-build-subpkg
the-horo Jul 20, 2025
0980f4a
issue1739-project-settings-file
the-horo Jul 20, 2025
c437991
issue1773-lint
the-horo Jul 20, 2025
d6e418d
issue1775
the-horo Jul 20, 2025
a2113c8
issue1788-incomplete-string-import-override
the-horo Jul 20, 2025
b7827ec
issue1856-build-unittest
the-horo Jul 20, 2025
653b28e
issue1867-lowmem
the-horo Jul 21, 2025
0853bdb
issue2046-ignored-optional-with-path
the-horo Jul 21, 2025
4b0bf19
issue2051_running_unittests_from_dub_single_file_packages_fails
the-horo Jul 21, 2025
a48eda0
issue2085-target-none-visuald
the-horo Jul 21, 2025
b3d0c96
issue2086-copyfiles-subpackage-targetpath
the-horo Jul 21, 2025
be18fcc
issue2190-unset-TEMP
the-horo Jul 21, 2025
47b5b0a
issue2192-environment-variables
the-horo Jul 21, 2025
326d8c0
issue2234-copy-read-only-files
the-horo Jul 21, 2025
a530043
issue2258-dynLib-exe-dep
the-horo Jul 21, 2025
42babaa
issue2262-exact-cached-version-match
the-horo Jul 22, 2025
f39966f
issue2348-postbuildcommands
the-horo Jul 22, 2025
4a5229f
issue2377-dynLib-dep-extra-files
the-horo Jul 22, 2025
e24b935
issue2377-dynLib-dep-extra-files: don't check for *exp files on windows
the-horo Jul 27, 2025
0851fe6
issue2448
the-horo Jul 22, 2025
2a624a9
issue2452
the-horo Jul 22, 2025
8bd5a7a
issue2574-mistyping-commands
the-horo Jul 22, 2025
c35ee5e
issue2587-subpackage-dependency-resolution
the-horo Jul 22, 2025
5614ba1
issue2650-deprecated-modules
the-horo Jul 22, 2025
cf96484
issue2684-recipe-file
the-horo Jul 22, 2025
a4cf258
issue2698-cimportpaths-broken-with-dmd-ldc
the-horo Jul 22, 2025
e9c2b97
issue2840-build-collision
the-horo Jul 22, 2025
8d823b0
issue346-redundant-flags
the-horo Jul 22, 2025
b971c50
issue361-optional-deps
the-horo Jul 23, 2025
a6b86b8
issue502-root-import
the-horo Jul 23, 2025
5ac89c0
issue564-invalid-upgrade-dependency
the-horo Jul 23, 2025
9b2c6b0
issue586-subpack-dep
the-horo Jul 26, 2025
e938542
issue613-dynlib-pic
the-horo Jul 26, 2025
4a04d21
issue616-describe-vs-generate-commands
the-horo Jul 26, 2025
154693f
issue672-upgrade-optional
the-horo Jul 27, 2025
009707e
issue674-concurrent-dub
the-horo Jul 26, 2025
7ae9175
issue686-multiple-march
the-horo Jul 26, 2025
02b478b
issue754-path-selection-fail
the-horo Jul 26, 2025
2d33039
issue777-bogus-path-dependency
the-horo Jul 26, 2025
708c458
issue782-gtkd-pkg-config
the-horo Jul 26, 2025
1b80958
issue813-fixed-dependency
the-horo Jul 26, 2025
fa0b47f
issue813-pure-sub-dependency
the-horo Jul 26, 2025
ed6fdef
issue820-extra-fields-after-convert
the-horo Jul 27, 2025
34d8b1c
issue838-custom-cache-paths
the-horo Jul 26, 2025
cff46f9
issue877-auto-fetch-package-on-run
the-horo Jul 26, 2025
21bdbdd
issue884-init-defer-file-creation
the-horo Jul 26, 2025
ed2739d
issue895-local-configuration
the-horo Jul 27, 2025
677f9a6
issue923-subpackage-deps
the-horo Jul 27, 2025
7b07e44
issue934-path-dep
the-horo Jul 26, 2025
5ed7b14
issue959-path-based-subpack-dep
the-horo Jul 26, 2025
3aca29f
issue97-targettype-none
the-horo Jul 26, 2025
0d0e106
issue97-targettype-none-nodeps
the-horo Jul 26, 2025
c52d4c2
issue97-targettype-none-onerecipe
the-horo Jul 26, 2025
0af4446
issue990-download-optional-selected
the-horo Jul 26, 2025
c4014a6
mutex-main-1
the-horo Jul 26, 2025
35647b4
mutex-main-2
the-horo Jul 26, 2025
f9d9eee
mutex-main-3
the-horo Jul 26, 2025
7963053
path-subpackage-ref
the-horo Jul 26, 2025
c520b36
pr1549-dub-exe-var
the-horo Jul 26, 2025
1898a21
pr2642-cache-db
the-horo Jul 26, 2025
7f904fe
pr2644-describe-artifact-path
the-horo Jul 26, 2025
a838c2b
pr2647-build-deep
the-horo Jul 26, 2025
4dcba07
removed-dub-obj
the-horo Jul 26, 2025
c0d029e
sdl-package-simple
the-horo Jul 26, 2025
5a65476
single-file-sdl-default-name
the-horo Jul 26, 2025
8933c00
subpackage-common-with-sourcefile-globbing
the-horo Jul 26, 2025
1d80c2d
subpackage-ref
the-horo Jul 26, 2025
0fd1355
test-upgrade-subpackages
the-horo Jul 26, 2025
1da2f19
test-version-opt
the-horo Jul 26, 2025
4a6b9a3
timeout
the-horo Jul 26, 2025
8cea7b9
unittest-cov-ctfe
the-horo Jul 26, 2025
5be9655
use-c-sources
the-horo Jul 26, 2025
81a9ccf
version-filters
the-horo Jul 26, 2025
cf3b530
version-filters-diamond
the-horo Jul 26, 2025
797f5ec
version-filters-none
the-horo Jul 26, 2025
0c18d25
version-filters-source-dep
the-horo Jul 26, 2025
2edc99f
version-spec
the-horo Jul 26, 2025
aca5241
win32_default
the-horo Jul 26, 2025
f423ea6
Drop test/version-filters.sh
the-horo Jul 26, 2025
41bb118
test/run-unittest.*: Forward to run_unittest
the-horo Jul 27, 2025
8a2263f
CI: bump setup-dlang and add gdc test job
the-horo Jul 27, 2025
d999723
docker: install lld for ldc
the-horo Jul 30, 2025
82f8f7a
test: Drop old common
the-horo Aug 22, 2025
4a51966
mv new_tests -> test
the-horo Aug 22, 2025
50b329a
test/timeout: Increase timeout a little
the-horo Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 21 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
- { dc: ldc-master, do_test: true }
# Test on ARM64
- { os: macOS-14, dc: ldc-latest, do_test: true }
# ice when building tests: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119817
- { os: ubuntu-24.04, dc: gdc-13, do_test: false }
- { os: ubuntu-24.04, dc: gdc-14, do_test: true }
exclude:
# Error with those versions:
# ld: multiple errors: symbol count from symbol table and dynamic symbol table differ in [.../dub.o]; address=0x0 points to section(2) with no content in '[...]/osx/lib/libphobos2.a[3177](config_a68_4c3.o)'
Expand All @@ -96,14 +99,29 @@ jobs:
- name: '[Linux] Install dependencies'
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev netcat
sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev netcat-openbsd

# Compiler to test with
- name: Prepare compiler
uses: dlang-community/setup-dlang@v1
uses: dlang-community/setup-dlang@v2
with:
compiler: ${{ matrix.dc }}

- name: Set environment variables
shell: bash
run: |
for name in DC DMD; do
var=${!name}
var=$(basename "${var}")
var=${var%.exe} # strip the extension
export "${name}=${var}"
tee -a ${GITHUB_ENV} <<<"${name}=${var}"
done

if [[ ${{ matrix.dc }} == gdc-13 ]]; then
tee -a ${GITHUB_ENV} <<<"DFLAGS=-Wno-error"
fi

# Checkout the repository
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -115,7 +133,6 @@ jobs:
run: |
dub build --compiler=${{ env.DC }}
if [[ ${{ matrix.do_test }} == 'true' ]]; then
dub run --compiler=${{ env.DC }} --single test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
./scripts/ci/ci.sh
fi

Expand All @@ -127,19 +144,7 @@ jobs:
dub build --compiler=${{ env.DC }}
if [[ ${{ matrix.do_test }} == 'true' ]]; then
dub test --compiler=${{ env.DC }}
dub run --compiler=${{ env.DC }} --single test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
dub --single test/run-unittest.d

# FIXME: DMD fails a few tests on Windows; remove them for now
if [[ '${{ matrix.dc }}' = dmd* ]]; then
# DLL support is lacking
rm -rf test/{1-dynLib-simple,2-dynLib-dep,2-dynLib-with-staticLib-dep}
# Unicode in paths too
rm -rf test/issue130-unicode-СНА*
# ImportC probably requires set-up MSVC environment variables
rm -rf test/use-c-sources
fi
test/run-unittest.sh
dub run --root test/run_unittest -- -v
fi
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG DCBIN

# Build dub (and install tests dependencies in the process)
WORKDIR /root/build/
RUN apk add --no-cache bash build-base curl curl-dev dtools dub git grep rsync $DCPKG
RUN apk add --no-cache bash build-base curl curl-dev dtools dub git grep rsync lld $DCPKG
ADD . /root/build/
RUN dub test --compiler=$DCBIN && dub build --compiler=$DCBIN

Expand All @@ -20,4 +20,4 @@ ENV DC=$DCBIN

# Finally, just run the test-suite
WORKDIR /root/build/test/
ENTRYPOINT [ "/root/build/test/run-unittest.sh" ]
ENTRYPOINT [ "/root/build/bin/dub", "--root", "run_unittest", "--" ]
35 changes: 25 additions & 10 deletions scripts/ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,36 @@

set -v -e -o pipefail

vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
dub fetch vibe-d@$vibe_ver # get optional dependency
dub test --compiler=${DC} -c library-nonet
testLibraryNonet=1
if [[ ${DC} =~ gdc|gdmd ]]; then
# ICE with gdc-14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also link so that the next guy can tell at a glance if it has been fixed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only fails in CI, so maybe fixed with more recent gdc-14

testLibraryNonet=
fi

if [[ ${testLibraryNonet} ]]; then
vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
dub fetch vibe-d@$vibe_ver # get optional dependency
dub test --compiler=${DC} -c library-nonet --build=unittest
fi

export DMD="$(command -v $DMD)"

./build.d -preview=in -w -g -debug
"${DMD}" -run build.d -preview=in -w -g -debug

if [[ ${testLibraryNoNet} ]]; then
dub test --compiler=${DC} -b unittest-cov
fi

if [ "$COVERAGE" = true ]; then
# library-nonet fails to build with coverage (Issue 13742)
dub test --compiler=${DC} -b unittest-cov
./build.d -cov
"${DMD}" -run build.d -cov
else
dub test --compiler=${DC} -b unittest-cov
./build.d
"${DMD}" -run build.d
fi
DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/run-unittest.d
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh

# force the creation of the coverage dir
bin/dub --version

# let the runner add the needed flags, in the case of gdmd
unset DFLAGS
DC=${DMD} dub run --root test/run_unittest -- -v
73 changes: 10 additions & 63 deletions test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,15 @@
*.lib
*.so
*.dll

1-exec-simple/exec-simple
1-staticLib-simple/__test__library__
2-dynLib-dep/dynlib-dep
2-sourceLib-dep/sourcelib-dep
2-staticLib-dep/staticlib-dep
custom-unittest/custom-unittest
path-subpackage-ref/test
subpackage-ref/test
subpackage-common-with-sourcefile-globbing/mypackage*
version-spec/**/CMakeLists.txt
version-spec/**/foo.cmake
version-spec/**/foo

/test_registry
/issue_2051_running_unittests_from_dub_single_file_packages_fails
/run-unittest

test.log
custom-source-main-bug487/custom-source-main-bug487
3-copyFiles/bin/
ignore-hidden-1/ignore-hidden-1
ignore-hidden-2/ignore-hidden-2
expected-import-path-output
expected-string-import-path-output
expected-describe-data-1-list-output
expected-describe-data-2-dmd-output
expected-issue616-output
describe-project/dummy.dat
describe-project/dummy-dep1.dat
*/main/main
*/*test-library
*/*test-application
*/exec-simple
issue1474/ext/fortytwo.d
issue2452/ext/fortytwo.d

cov-ctfe/test
issue1003-check-empty-ld-flags/issue1003-empty-ld-flags
issue1053-extra-files-visuald/LICENSE.txt
issue1053-extra-files-visuald/README.txt
issue1053-extra-files-visuald/extra_files.sln
issue1117-extra-dependency-files/test
issue1396-pre-post-run-commands/test
issue1396-pre-post-run-commands/test.txt
issue1477-subpackage-visuald-paths/library_subpackage_a.sln
issue1477-subpackage-visuald-paths/sub/subpackage_a/subpackage_a.sln
issue1504-envvar-in-path/test
issue1773-lint/report.json
issue2085-target-none-visuald/root.sln
issue2086-copyfiles-subpackage-targetpath/sub/sub
issue2086-copyfiles-subpackage-targetpath/sub/to_be_deployed.txt
issue2262-exact-cached-version-match/testproj
issue361-optional-deps/cmp.tmp
issue838-custom-cache-paths/test
issue97-targettype-none/a/issue97-targettype-none_a
issue97-targettype-none/b/issue97-targettype-none_b
issue990-download-optional-selected/b
output-1504.txt
version-filters-diamond/version-filters-diamond
version-filters-none/version-filters-none
version-filters-source-dep/version-filters-source-dep
version-filters/version-filters
version-spec/newfoo/foo-test-application
version-spec/oldfoo/foo-test-application
*/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine for this PR as the state of things wasn't great but we should really find a better solution. This */* is going to be very surprising for users and quite error prone.

!*/dub.json
!*/dub.sdl
!*/package.json
!*/run.d
!*/run.sh
!*/source
!*/.gitignore
!*/test.config
!extra/*
36 changes: 0 additions & 36 deletions test/0-init-fail-json.script.d

This file was deleted.

2 changes: 2 additions & 0 deletions test/0-init-fail-json/dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name "0-init-fail-json"
dependency "common" path="../common"
21 changes: 21 additions & 0 deletions test/0-init-fail-json/source/app.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import std.file : exists, remove;
import std.path : buildPath;
import std.process : environment, spawnProcess, wait;

import common;

void main()
{
enum packname = "0-init-fail-pack";
immutable deps = ["logger", "PACKAGE_DONT_EXIST"]; // would be very unlucky if it does exist...

if (!spawnProcess([dub, "init", "-n", packname] ~ deps ~ [ "-f", "json"]).wait)
die("Init with unknown non-existing dependency expected to fail");

const filepath = buildPath(packname, "dub.json");
if (filepath.exists)
{
remove(packname);
die(filepath, " was not created");
}
}
18 changes: 0 additions & 18 deletions test/0-init-fail.sh

This file was deleted.

2 changes: 2 additions & 0 deletions test/0-init-fail/dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name "0-init-fail"
dependency "common" path="../common"
21 changes: 21 additions & 0 deletions test/0-init-fail/source/app.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import std.file : exists, remove;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really combine the init-fail and init-fail-json tests, but this can be done in another PR.

import std.path : buildPath;
import std.process : environment, spawnProcess, wait;

import common;

void main()
{
enum packname = "0-init-fail-pack";
immutable deps = ["logger", "PACKAGE_DONT_EXIST"]; // would be very unlucky if it does exist...

if (!spawnProcess([dub, "init", "-n", packname] ~ deps).wait)
die("Init with unknown non-existing dependency expected to fail");

const filepath = buildPath(packname, "dub.sdl");
if (filepath.exists)
{
remove(packname);
die(filepath ~ " was not created");
}
}
47 changes: 0 additions & 47 deletions test/0-init-interactive.sh

This file was deleted.

2 changes: 2 additions & 0 deletions test/0-init-interactive/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!/exp
!/exp/*
2 changes: 2 additions & 0 deletions test/0-init-interactive/dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name "0-init-interactive"
dependency "common" path="../common"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name "0-init-interactive"
name "new-package"
description "desc"
authors "author"
copyright "copy"
Expand Down
File renamed without changes.
File renamed without changes.
Loading