From 85e6de8b4a287078b372207c373a32dab2b256f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Mon, 23 Nov 2015 12:41:06 +0100
Subject: [PATCH] Added Makefile for unit tests.

In the base directory:

~$ make check-octave

will trigger the testsuite with Octave, and

~$ make check-octave

triggers the same testsuite with Matlab.
---
 Makefile            | 11 +++++++++++
 tests/runalltests.m |  4 ++++
 2 files changed, 15 insertions(+)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7c1a49e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+OCTAVE=octave-cli
+MATLAB=`which matlab`
+
+all: check-octave check-matlab
+
+check-octave:
+	@cd tests ;\
+	$(OCTAVE) --no-init-file --silent --no-history runalltests.m
+
+check-matlab:
+	@$(MATLAB)  -nosplash -nodisplay -r "cd tests; runalltests; quit"
diff --git a/tests/runalltests.m b/tests/runalltests.m
index d597f17..cd561e0 100644
--- a/tests/runalltests.m
+++ b/tests/runalltests.m
@@ -27,6 +27,10 @@ catch
     initialize_dates_toolbox;
 end
 
+if isoctave
+    more off
+end
+
 tmp = dates_src_root;
 tmp = tmp(1:end-1); % Remove trailing slash.
 run_unitary_tests_in_directory(tmp);
-- 
GitLab