make check-call_scilab launches call_scilab tests + update of the error messages 23/5523/4
Sylvestre Ledru [Fri, 25 Nov 2011 11:42:22 +0000 (12:42 +0100)]
Change-Id: I93673aefa2d1d124c6d83353ad4ae1dc58ae8ed2

scilab/Makefile.call_scilab.am
scilab/Makefile.in
scilab/modules/call_scilab/src/c/SendScilabJobs.c

index b3a3b8b..821cd7c 100644 (file)
@@ -12,6 +12,7 @@
 CALL_SCILAB_CFLAGS_COMMON = -I$(top_srcdir)/modules/call_scilab/includes/ -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/modules/api_scilab/includes/
 CALL_SCILAB_LDADD_COMMON = $(top_builddir)/modules/libscilab.la $(top_builddir)/modules/core/libscicore.la $(top_builddir)/modules/call_scilab/libscicall_scilab.la
 
+
 # These binaries are built here and not in the call_scilab module because 
 # we do need libscilab.so to exist before building these files
 # To build them, just launch "make check-am"
@@ -19,6 +20,20 @@ CALL_SCILAB_LDADD_COMMON = $(top_builddir)/modules/libscilab.la $(top_builddir)/
 # "Compile and run with Call Scilab"
 check_PROGRAMS = call_scilab_c_simple call_scilab_c call_scilab_c_getlastjob call_scilab_c_DisableInteractiveMode call_scilab_readwriteboolean call_scilab_readwritecomplexmatrix call_scilab_readwritematrix call_scilab_readwritestring
 
+# Construct the LD_LIBRARY_PATH from the variable detected previously
+# Run the unitary test of call_scilab
+check-call_scilab: $(check_PROGRAMS)
+       @for a in $(JAVA_JNI_LIBS); do \
+               LD_PATH=`echo $$a|grep '^-L'|sed -e 's|-L\(.*\)|\1|g'`;\
+               LOCAL_LD="$$LOCAL_LD:$$LD_PATH"; \
+       done; \
+       for f in $(check_PROGRAMS); do \
+               if test "$$f" != "call_scilab_c"; then \
+                       echo "Run: LD_LIBRARY_PATH=$$LOCAL_LD SCI=$(top_srcdir) ./$$f"; \
+                       LD_LIBRARY_PATH=$$LOCAL_LD SCI=$(abs_top_builddir) ./$$f; \
+               fi \
+       done
+
 call_scilab_c_SOURCES = $(top_srcdir)/modules/call_scilab/examples/call_scilab/c/common/myprog.c
 call_scilab_c_CFLAGS = $(CALL_SCILAB_CFLAGS_COMMON)
 call_scilab_c_LDFLAGS = $(CALL_SCILAB_LDADD_COMMON)
index b31524a..8c47a90 100644 (file)
@@ -1922,6 +1922,20 @@ check-java:
 
 .NOTPARALLEL: macros doc
 
+# Construct the LD_LIBRARY_PATH from the variable detected previously
+# Run the unitary test of call_scilab
+check-call_scilab: $(check_PROGRAMS)
+       @for a in $(JAVA_JNI_LIBS); do \
+               LD_PATH=`echo $$a|grep '^-L'|sed -e 's|-L\(.*\)|\1|g'`;\
+               LOCAL_LD="$$LOCAL_LD:$$LD_PATH"; \
+       done; \
+       for f in $(check_PROGRAMS); do \
+               if test "$$f" != "call_scilab_c"; then \
+                       echo "Run: LD_LIBRARY_PATH=$$LOCAL_LD SCI=$(top_srcdir) ./$$f"; \
+                       LD_LIBRARY_PATH=$$LOCAL_LD SCI=$(abs_top_builddir) ./$$f; \
+               fi \
+       done
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 89cd687..c208195 100644 (file)
@@ -66,7 +66,7 @@ int SendScilabJob(char *job)
         {
             printError(&sciErr, 0);
             /* Problem */
-            fprintf(stderr, "Error: SendScilabJob (1) 'TMP_EXEC_STRING'.\n");
+            fprintf(stderr, "Error: SendScilabJob (1) call_scilab failed to create the temporary variable 'TMP_EXEC_STRING'.\n");
             retCode = -1;
 
             if (command) {FREE(command); command = NULL;}
@@ -81,7 +81,7 @@ int SendScilabJob(char *job)
         if(sciErr.iErr)
         {
             printError(&sciErr, 0);
-            fprintf(stderr,"Error: SendScilabJob (2) 'Err_Job'.\n");   
+            fprintf(stderr, "Error: SendScilabJob (2) call_scilab failed to detect the temporary variable 'Err_Job' size.\n");
             retCode = -2;
 
             if (command) {FREE(command); command = NULL;}
@@ -92,7 +92,7 @@ int SendScilabJob(char *job)
 
         if ( (m != 1) && (n != 1) )
         {
-            fprintf(stderr,"Error: SendScilabJob (3) 'Err_Job'.\n");   
+            fprintf(stderr, "Error: SendScilabJob (3) call_scilab detected a badly formated 'Err_Job' variable. Size [1,1] expected.\n");
             retCode = -3;
 
             if (command) {FREE(command); command = NULL;}
@@ -105,7 +105,7 @@ int SendScilabJob(char *job)
         if(sciErr.iErr)
         {
             printError(&sciErr, 0);
-            fprintf(stderr,"Error: SendScilabJob (4) 'Err_Job'.\n");   
+            fprintf(stderr, "Error: SendScilabJob (4) call_scilab failed to read the temporary variable 'Err_Job'.\n");
             retCode = -4;
 
             if (command) {FREE(command); command = NULL;}
@@ -125,7 +125,7 @@ int SendScilabJob(char *job)
     }
     else
     {
-        fprintf(stderr,"Error: SendScilabJob (4) 'command' MALLOC.\n");
+        fprintf(stderr,"Error: SendScilabJob (5) call_scilab failed to create the 'command' variable (MALLOC).\n");
         retCode = -4;
     }