From 13488fa94bd6ed31d306b4c2c6cdf3973322ef97 Mon Sep 17 00:00:00 2001 From: "Loren M. Lang" Date: Wed, 17 Jul 2013 22:26:16 -0700 Subject: [PATCH] Smoke test now uses portable file path Added a sanity check to ensure smoke.sh is run from the correct folder and use a relative path to the mona image so it works on any system. --- .gitignore | 1 + smoke/smoke.sh | 6 ++++++ smoke/smoketest.js | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 550bb51..3534ce0 100755 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build node_modules npm-debug.log out*.jpg +out*.png examples/*.avi diff --git a/smoke/smoke.sh b/smoke/smoke.sh index a3ec18c..84fab84 100755 --- a/smoke/smoke.sh +++ b/smoke/smoke.sh @@ -1,4 +1,10 @@ #!/bin/bash + +if [ ! -f smoke/smoketest.js ]; then + echo "Please run smoke test from the top-level folder of the repository." >&2 + exit 1 +fi + node-gyp build && echo '-- Compiled OK -- ' && node smoke/smoketest.js && echo '-- Smoke Done, running tests -- diff --git a/smoke/smoketest.js b/smoke/smoketest.js index 258eb1e..15ab1aa 100755 --- a/smoke/smoketest.js +++ b/smoke/smoketest.js @@ -20,7 +20,7 @@ cv.readImage("/Users/peterbraden/Downloads/orl_faces/s6/10.pgm", function(e, im) */ -cv.readImage("/Users/peterbraden/Desktop/repos/node-opencv/examples/mona.png", function(e, mat){ +cv.readImage("examples/mona.png", function(e, mat){ var th = mat.threshold(200, 200, "Threshold to Zero Inverted"); th.save('out.png')