diff --git a/.gitignore b/.gitignore index 0a6d220174..05cfd4b0e2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ /docs/styles .dub + +# Unittest binaries +vibe-d +tests/*/tests diff --git a/tests/args/test.sh b/tests/args/test.sh old mode 100644 new mode 100755 index 931410e872..b5c894484c --- a/tests/args/test.sh +++ b/tests/args/test.sh @@ -4,9 +4,9 @@ set -e die() { echo "$@" 1>&2 ; exit 1; } if [ "${OS}" == "win32" -o "${OS}" == "Windows_NT" ]; then - VIBE='cmd /C vibe' + VIBE='cmd /C tests' else - VIBE=vibe + VIBE=./tests fi ( $VIBE | grep -q '^argtest=$' ) || die "Fail (no argument)" diff --git a/tests/mongodb/source/app.d b/tests/mongodb/source/app.d index 1e04766663..585dfbb471 100644 --- a/tests/mongodb/source/app.d +++ b/tests/mongodb/source/app.d @@ -35,11 +35,12 @@ void runTest() auto converted = zip(data1, data2).map!( a => a[0].key1.get!string() ~ a[1].key1.get!string() )(); assert(!converted.empty); assert(converted.front == "value1value2"); + exitEventLoop(true); } int main() { - setLogLevel(LogLevel.Debug); + setLogLevel(LogLevel.debug_); runTask(toDelegate(&runTest)); return runEventLoop(); } diff --git a/tests/restclient/source/app.d b/tests/restclient/source/app.d index 6312b6ff8a..b5bbab699d 100644 --- a/tests/restclient/source/app.d +++ b/tests/restclient/source/app.d @@ -4,12 +4,12 @@ import vibe.vibe; interface ITestAPI { - @method(HttpMethod.POST) @path("other/path") + @method(HTTPMethod.POST) @path("other/path") string info(); string getInfo(); - @path("getCheck/:param/:param2") @method(HttpMethod.GET) + @path("getCheck/:param/:param2") @method(HTTPMethod.GET) string customParameters(string _param, string _param2); - @path("getCheck2/:param/:param2") @method(HttpMethod.GET) + @path("getCheck2/:param/:param2") @method(HTTPMethod.GET) int customParameters2(int _param, bool _param2); } @@ -23,13 +23,13 @@ class TestAPI : ITestAPI void runTest() { - auto router = new UrlRouter; + auto router = new URLRouter; registerRestInterface!ITestAPI(router, new TestAPI, "/root/"); - auto settings = new HttpServerSettings; + auto settings = new HTTPServerSettings; settings.disableDistHost = true; settings.port = 8000; - listenHttp(settings, router); + listenHTTP(settings, router); auto api = new RestInterfaceClient!ITestAPI("http://127.0.0.1:8000/root/"); assert(api.getInfo() == "description"); @@ -37,11 +37,12 @@ void runTest() assert(api.customParameters("one", "two") == "onetwo"); assert(api.customParameters2(10, false) == -10); assert(api.customParameters2(10, true) == 10); + exitEventLoop(true); } int main() { - setLogLevel(LogLevel.Debug); + setLogLevel(LogLevel.debug_); runTask(toDelegate(&runTest)); return runEventLoop(); }