Index: trunk/psLib/test/math/tap_psMatrix08.c
===================================================================
--- trunk/psLib/test/math/tap_psMatrix08.c	(revision 24087)
+++ trunk/psLib/test/math/tap_psMatrix08.c	(revision 42822)
@@ -20,4 +20,26 @@
 psS32 main( psS32 argc, char* argv[] )
 {
+    fprintf (stderr, "path: %s\n", argv[0]);
+
+    char imApath[1024];
+    char imBpath[1024];
+    char topPath[1024];
+    char *libpath = strstr (argv[0], ".libs/");
+    if (!libpath) {
+	fprintf (stderr, "ERROR: cannot find input data\n");
+	exit (2);
+    }
+
+    // if (strncmp(argv[0], ".libs/", 6))
+    int nTopPath = libpath - argv[0]; // 
+    if (nTopPath) {
+	ps_strncpy_nowarn (topPath, argv[0], nTopPath); topPath[nTopPath] = 0;
+	ps_snprintf_nowarn (imApath, 1024, "%s/%s", topPath, "data/Agj.fits");
+	ps_snprintf_nowarn (imBpath, 1024, "%s/%s", topPath, "data/Bgj.fits");
+    } else {
+	ps_snprintf_nowarn (imApath, 1024, "%s", "data/Agj.fits");
+	ps_snprintf_nowarn (imBpath, 1024, "%s", "data/Bgj.fits");
+    }
+
     plan_tests(23);
     // psTraceSetLevel("psLib.math.psMatrixGJSolve", 4);
@@ -32,5 +54,5 @@
 	// XXX this is an ill-conditioned matrix.  LU Decomposition does not inform us that it is ill-conditioned.  
 	// the result solves the equation, but what are the errors on the values?
-	fits = psFitsOpen ("data/Agj.fits", "r");
+	fits = psFitsOpen (imApath, "r");
         ok(fits, "opened test image Agj.fits");
 
@@ -43,5 +65,5 @@
 	psFitsClose (fits);
 
-	fits = psFitsOpen ("data/Bgj.fits", "r");
+	fits = psFitsOpen (imBpath, "r");
         ok(fits, "opened test image Bgj.fits");
 
@@ -98,5 +120,5 @@
 
 	// we have a specific ill-conditioned matrix in Agj.fits. psMatrixGJSolve detects this and reports a failure.
-	fits = psFitsOpen ("data/Agj.fits", "r");
+	fits = psFitsOpen (imApath, "r");
         ok(fits, "opened test image Agj.fits");
 
@@ -106,5 +128,5 @@
 	psFitsClose (fits);
 
-	fits = psFitsOpen ("data/Bgj.fits", "r");
+	fits = psFitsOpen (imBpath, "r");
         ok(fits, "opened test image Bgj.fits");
 
@@ -147,5 +169,5 @@
 
 	// we have a specific ill-conditioned matrix in Agj.fits. psMatrixGJSolve detects this and reports a failure.
-	fits = psFitsOpen ("data/Agj.fits", "r");
+	fits = psFitsOpen (imApath, "r");
         ok(fits, "opened test image Agj.fits");
 
@@ -158,5 +180,5 @@
 	psFitsClose (fits);
 
-	fits = psFitsOpen ("data/Bgj.fits", "r");
+	fits = psFitsOpen (imBpath, "r");
         ok(fits, "opened test image Bgj.fits");
 
