From 4c964485e492a69609bce07085570e38ed9b9070 Mon Sep 17 00:00:00 2001
From: R <rlaz@cs.rit.edu>
Date: Mon, 7 Feb 2022 22:36:21 -0500
Subject: [PATCH] Test script path corrections.

---
 bin/lg2mml                                    |  7 ++++++
 .../test-2-add-inside-relationship-mapping    | 25 +++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/bin/lg2mml b/bin/lg2mml
index 9cc56fe..e3d1fbe 100755
--- a/bin/lg2mml
+++ b/bin/lg2mml
@@ -22,6 +22,13 @@ then
 	exit 0
 fi
 
+# RZ: Debug
+#echo ""
+#echo "[ lg2mml ]"
+#echo "  LgEvalDir   $LgEvalDir"
+#echo "  PATH        $PATH"
+#echo "  PYTHONPATH  $PYTHONPATH"
+
 BNAME=`basename $1 .lg`
 
 python $LgEvalDir/src/lg2txt.py $1 $LgEvalDir/translate/mathMLMap.csv $LgEvalDir/translate/infty_to_crohme.csv > $BNAME.mml
diff --git a/bin/tests/test-2-add-inside-relationship-mapping b/bin/tests/test-2-add-inside-relationship-mapping
index f907a66..e605bbd 100755
--- a/bin/tests/test-2-add-inside-relationship-mapping
+++ b/bin/tests/test-2-add-inside-relationship-mapping
@@ -1,10 +1,31 @@
 #!/bin/bash
 
+echo "Running test for issue 2 (inside relationship mapping)..."
+
 pip install beautifulsoup4==4.9.2
+
+# RZ -- need to set LgEvalDir and PYTHONPATH for
+# this to work.
+#
+# NOTE: These definitions are lost after the 
+# script ends (they are associated only with the
+# invoked process that the shell program runs in)
+#
+# NOTE 2: You *must* use export to define a variable
+# that you want to be visible in child processes
+# (e.g., where lg2mml is called below)
+export LgEvalDir=`cd ../..; pwd`
+export PYTHONPATH=`cd ../../../; pwd`/
+export PATH=$LgEvalDir/bin:$PATH
+
+echo "  LgEvalDir    $LgEvalDir"
+echo "  PYTHONPATH   $PYTHONPATH"
+echo "  PATH         $PATH"
+
 TEST_FILES=`ls ../../tests/sqrt_lg/*.lg` 
 for file in $TEST_FILES
 do
-  ../lg2mml ../../tests/sqrt_lg/$file
+  lg2mml ../../tests/sqrt_lg/$file
   filename=`basename $file .lg`
-  echo "MathML generated: "$filename".mml"
+  echo MathML generated: "$filename".mml
 done
-- 
GitLab