diff --git a/test/0-init-multi/.gitignore b/test/0-init-multi/.gitignore new file mode 100644 index 0000000..433d266 --- /dev/null +++ b/test/0-init-multi/.gitignore @@ -0,0 +1,5 @@ +.dub +docs.json +__dummy.html +*.o +*.obj diff --git a/test/0-init-multi/0-init-multi b/test/0-init-multi/0-init-multi new file mode 120000 index 0000000..1418606 --- /dev/null +++ b/test/0-init-multi/0-init-multi @@ -0,0 +1 @@ +/home/colin/Projects/D/dub/test/0-init-multi/.dub/build/application-unittest-linux.posix-x86_64-dmd_2066-BD50D2FB8B6166C4598C63A62DB03A99/0-init-multi \ No newline at end of file diff --git a/test/0-init-multi/0-init-multi.sh b/test/0-init-multi/0-init-multi.sh new file mode 100755 index 0000000..54b151e --- /dev/null +++ b/test/0-init-multi/0-init-multi.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +packname="0-init-multi-pack" +deps="openssl logger" +type="vibe.d" + +$DUB init $packname $deps --type=$type + +function cleanup { + rm -rf $packname +} + +if [ ! -e $packname/dub.json ]; then # it failed, exit 1 + exit 1 +else # check if resulting dub.json has all dependancies in tow + deps="$deps vibe-d"; + IFS=" " read -a arr <<< "$deps" + for ele in "${arr[@]}" + do + if [ `grep -c "$ele" $packname/dub.json` -ne 1 ]; then #something went wrong + echo "$ele not in $packname/dub.json" + cleanup + exit 1 + fi + done + cleanup + exit 0 + +fi diff --git a/test/0-init-multi/dub.json b/test/0-init-multi/dub.json new file mode 100644 index 0000000..752ff18 --- /dev/null +++ b/test/0-init-multi/dub.json @@ -0,0 +1,8 @@ +{ + "name": "0-init-multi", + "description": "A minimal D application.", + "copyright": "Copyright © 2014, colin", + "authors": ["colin"], + "dependencies": { + } +} diff --git a/test/0-init-multi/source/app.d b/test/0-init-multi/source/app.d new file mode 100644 index 0000000..acd9893 --- /dev/null +++ b/test/0-init-multi/source/app.d @@ -0,0 +1,10 @@ +import std.stdio; + +import std.process : execute; +int main(string[] args) +{ + writefln("Executing init test - multi"); + auto script = args[0] ~ ".sh"; + auto dubInit = execute(script); + return dubInit.status; +} diff --git a/test/0-init-simple/.gitignore b/test/0-init-simple/.gitignore new file mode 100644 index 0000000..433d266 --- /dev/null +++ b/test/0-init-simple/.gitignore @@ -0,0 +1,5 @@ +.dub +docs.json +__dummy.html +*.o +*.obj diff --git a/test/0-init-simple/0-init-simple b/test/0-init-simple/0-init-simple new file mode 120000 index 0000000..6e2bebd --- /dev/null +++ b/test/0-init-simple/0-init-simple @@ -0,0 +1 @@ +/home/colin/Projects/D/dub/test/0-init-simple/.dub/build/application-unittest-linux.posix-x86_64-dmd_2066-CF86461E255001DB581816AECA014A55/0-init-simple \ No newline at end of file diff --git a/test/0-init-simple/0-init-simple.sh b/test/0-init-simple/0-init-simple.sh new file mode 100755 index 0000000..b5f9227 --- /dev/null +++ b/test/0-init-simple/0-init-simple.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +packname="0-init-simple-pack" + +$DUB init $packname + +function cleanup { + rm -rf $packname +} + +if [ ! -e $packname/dub.json ]; then # it failed + cleanup + exit 1 +fi +cleanup +exit 0 diff --git a/test/0-init-simple/dub.json b/test/0-init-simple/dub.json new file mode 100644 index 0000000..276804f --- /dev/null +++ b/test/0-init-simple/dub.json @@ -0,0 +1,8 @@ +{ + "name": "0-init-simple", + "description": "A minimal D application.", + "copyright": "Copyright © 2014, colin", + "authors": ["colin"], + "dependencies": { + } +} diff --git a/test/0-init-simple/source/app.d b/test/0-init-simple/source/app.d new file mode 100644 index 0000000..2bd9e78 --- /dev/null +++ b/test/0-init-simple/source/app.d @@ -0,0 +1,10 @@ +import std.stdio; + +import std.process : execute; +int main(string[] args) +{ + writefln("Executing init test - simple"); + auto script = args[0] ~ ".sh"; + auto dubInit = execute(script); + return dubInit.status; +}