]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Do not catch exceptions in rpp_build_demos
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 13 Aug 2014 01:23:57 +0000 (03:23 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 13 Aug 2014 01:23:57 +0000 (03:23 +0200)
This hides possible error message. We move exception handling to
Makefile (and buildbot) and they are responsible displaying the error
message.

rpp/demos/Makefile
rpp/demos/rpp_build_demos.m

index b659d68c87b6e2a57be73bd4ade081d48c7f9b92..c54e02777a45c25b3f503af5d4a2df1c6a7aafe2 100644 (file)
@@ -2,10 +2,10 @@ MODELS=$(wildcard *.slx)
 BUILD_DIRS=$(MODELS:%.slx=%_rpp)
 
 all: lib
-       matlab -nojvm -r "exit(rpp_build_demos())"
+       matlab -nojvm -r "try; rpp_build_demos(); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"
 
 %_rpp: %.slx lib
-       matlab -nojvm -r "exit(rpp_build_demos('$<'))"
+       matlab -nojvm -r "try; rpp_build_demos($<); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"
 
 lib:
        $(MAKE) -C ../lib rpp-lib.lib
index ae1b1927e829e023f6e412c3ecd12c3cb3dbacb3..fcf14d4c1ab92a8e56fa84a06e1384bbff97a4f7 100644 (file)
@@ -1,20 +1,14 @@
-function err = rpp_build_demos(varargin)\r
+function rpp_build_demos(varargin)\r
     d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos');\r
     cd(d)\r
 \r
-    try\r
-        if nargin > 0,\r
-            build_demo(varargin{1});\r
-        else\r
-            for i=dir('*.slx')',\r
-                build_demo(i.name);\r
-            end\r
+    if nargin > 0,\r
+        build_demo(varargin{1});\r
+    else\r
+        for i=dir('*.slx')',\r
+            build_demo(i.name);\r
         end\r
-    catch ME\r
-        err = 1;\r
-        return\r
     end\r
-    err = 0;\r
 \r
 function build_demo(file)\r
     [p, n, e] = fileparts(file);\r