From 95eb0f783a26f91600b01e473d7177793a5b3d81 Mon Sep 17 00:00:00 2001 From: Mezo Date: Thu, 24 Mar 2016 08:55:48 +0100 Subject: [PATCH] Lodash dependency fixed --- package.json | 8 ++++---- tests/testHelpers.js | 42 ++++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index ccac20f..5545650 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nooocl", - "version": "0.11.0", + "version": "0.11.1", "author": "Gábor Mező aka unbornchikken", "description": "NOOOCL: Node.js Object Oriented OpenCL Bindings", "homepage": "https://github.com/unbornchikken/nooocl", @@ -24,12 +24,12 @@ "native" ], "scripts": { - "test": "mocha --expose-gc ./tests" + "test": "mocha --expose-gc ./tests -t 60000" }, "dependencies": { - "bluebird": "*", + "bluebird": "2", "ffi": "2", - "lodash": "*", + "lodash": "3", "ref": "1", "ref-array": "1", "ref-struct": "1", diff --git a/tests/testHelpers.js b/tests/testHelpers.js index 4022087..7bd6096 100644 --- a/tests/testHelpers.js +++ b/tests/testHelpers.js @@ -12,26 +12,28 @@ var gpuWarn = false; var testHelpers = { doTest: function (testMethod, version) { - var pm = testMethod; - testMethod = function (env) { - // console.log("Testing on: " + env.device.name + " - " + env.device.platform.name); - return pm(env); - }; - version = version || CLHost.supportedVersions.cl11; - var host = new CLHost(version); - var cpuEnv = testHelpers.createEnvironment(host, "cpu"); - var cpuTestResult = cpuEnv ? testMethod(cpuEnv) : Bluebird.resolve(); - var gpuEnv = testHelpers.createEnvironment(host, "gpu"); - if (gpuEnv) { - return cpuTestResult.then(function () { - return testMethod(gpuEnv); - }); - } - if (!gpuWarn) { - console.warn("GPU is not available!"); - gpuWarn = true; - } - return cpuTestResult; + return Bluebird.try(function () { + var pm = testMethod; + testMethod = function (env) { + // console.log("Testing on: " + env.device.name + " - " + env.device.platform.name); + return pm(env); + }; + version = version || CLHost.supportedVersions.cl11; + var host = new CLHost(version); + var cpuEnv = testHelpers.createEnvironment(host, "cpu"); + var cpuTestResult = cpuEnv ? testMethod(cpuEnv) : Bluebird.resolve(); + var gpuEnv = testHelpers.createEnvironment(host, "gpu"); + if (gpuEnv) { + return cpuTestResult.then(function () { + return testMethod(gpuEnv); + }); + } + if (!gpuWarn) { + console.warn("GPU is not available!"); + gpuWarn = true; + } + return cpuTestResult; + }); }, createEnvironment: function (host, hardware) { assert(_.isObject(host));