From 3aee7a36bdfde384202f390fc84dbea5e978f80b Mon Sep 17 00:00:00 2001
From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr>
Date: Thu, 7 Dec 2017 21:02:34 +0100
Subject: [PATCH] The -pdf mode was never returning (ditto for -ps and co), and
 the latex mode was buggy.

Also, the pdf content was written in the gnuplot.log file.

Add tests
---
 .gitlab-ci.yml        | 21 +++++++++++++++++++++
 Makefile.dev          | 16 ++++++++++++++++
 README.md             | 42 ++++++++++++++++++++++++++++++++++++++++++
 README.org            | 34 ++++++++++++++++++++++++++++++++++
 _oasis                |  6 +++---
 doc/version.tex       |  6 +++---
 src/META              |  4 ++--
 src/gnuplotRif.ml     |  4 ++--
 src/gnuplotRifMain.ml |  6 ++++--
 src/lutilsVersion.ml  |  4 ++--
 test/gnuplot-rif      |  1 +
 11 files changed, 130 insertions(+), 14 deletions(-)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 README.md
 create mode 100644 README.org
 create mode 120000 test/gnuplot-rif

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..c7d1f4c
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,21 @@
+image: ocaml/opam:ubuntu
+
+variables:
+  GIT_STRATEGY: clone
+
+
+stage:
+  - build
+  - test
+
+build:
+  stage: build
+  script:
+    - make
+
+test:
+  stage: test
+  script:
+    - cd test
+    - make test-batch
+    
diff --git a/Makefile.dev b/Makefile.dev
index b8f20d1..a214880 100644
--- a/Makefile.dev
+++ b/Makefile.dev
@@ -33,10 +33,26 @@ ci:
    echo "*** I won't commit!\n*** until you 'make update_version'!" \
       || (git commit  -F log && touch committed)
 
+push:
+	make opam-test && git push
+
+merge: merge_work_into_master
+merge_work_into_master:
+	echo "git checkout master && \
+         git merge work && make opam && \
+         git push "
+
 amend:
 	test -f committed && git commit -a -F log --amend 
 
 
+###############################
+# test
+
+.PHONY: test
+test:
+	cd test ; make test
+
 ###############################
 # forge
 
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..edf0ad3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,42 @@
+
+# Table of Contents
+
+1.  [Installing `lutils` via opam](#orgdb9b2ce)
+2.  [Installing the git source](#org5d904a1)
+3.  [Tests](#orge9c6280)
+
+Tools and libs shared by other Verimag/synchronous tools (lustre, lutin, rdbg).
+
+-   The lutils ocaml library contains various modules shared between
+    tools. Those modules deal with:
+    -   generate and parse RIF files
+    -   generate dro files (to call luciole)
+-   `gnuplot-rif` is a stand alone executable that vizualises RIF files
+    using gnuplot.
+
+
+<a id="orgdb9b2ce"></a>
+
+# Installing `lutils` via opam
+
+    $ opam repo add verimag-sync-repo "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository"
+    $ opam update
+    $ opam install lutils
+
+
+<a id="org5d904a1"></a>
+
+# Installing the git source
+
+    git clone https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/lutils.git
+    cd lutils
+    make configure
+    make
+
+
+<a id="orge9c6280"></a>
+
+# Tests
+
+    make test
+
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..62ea4cf
--- /dev/null
+++ b/README.org
@@ -0,0 +1,34 @@
+
+Tools and libs shared by other Verimag/synchronous tools (lustre, lutin, rdbg).
+
++ The lutils ocaml library contains various modules shared between
+  tools. Those modules deal with:
+  - generate and parse RIF files
+  - generate dro files (to call luciole) 
++ =gnuplot-rif= is a stand alone executable that vizualises RIF files
+  using gnuplot.
+
+* Installing =lutils= via opam
+
+#+BEGIN_SRC sh
+$ opam repo add verimag-sync-repo "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository"
+$ opam update
+$ opam install lutils
+#+END_SRC
+
+* Installing the git source
+
+#+BEGIN_SRC sh
+git clone https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/lutils.git
+cd lutils
+make configure
+make
+#+END_SRC
+
+* Tests 
+
+#+BEGIN_SRC sh
+make test
+#+END_SRC
+
+ 
diff --git a/_oasis b/_oasis
index 33117fb..5e98bd1 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
 OASISFormat: 0.4
 Name:        lutils
-Version:     1.17
+Version:     1.18
 Authors:     Erwan Jahier
 Maintainers: erwan.jahier@imag.fr
 License:     GPL-3
@@ -39,6 +39,6 @@ Library lutils
 
 SourceRepository "master"
   Type: git
-  Location: https://forge.imag.fr/anonscm/git/lutils/lutils.git 
+  Location: https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils.git 
   Branch: master
-  Browser:  https://forge.imag.fr/projects/lutils/ 
+  Browser:  https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/ 
diff --git a/doc/version.tex b/doc/version.tex
index 6999e04..4733c40 100644
--- a/doc/version.tex
+++ b/doc/version.tex
@@ -1,4 +1,4 @@
-\newcommand{\version}{1.17}
-\newcommand{\sha}{f09e3ec}
+\newcommand{\version}{1.18}
+\newcommand{\sha}{897231e}
 \newcommand{\versionname}{none}
-\newcommand{\versiondate}{30-11-17}
+\newcommand{\versiondate}{07-12-17}
diff --git a/src/META b/src/META
index 8e06331..4c29269 100644
--- a/src/META
+++ b/src/META
@@ -1,6 +1,6 @@
 # OASIS_START
-# DO NOT EDIT (digest: 631f03c8500ab788a77a0b4e1034ad5a)
-version = "1.17"
+# DO NOT EDIT (digest: 01cad35253defa68c861569ae46c957c)
+version = "1.18"
 description = "shared by Verimag/synchronous tools (lustre, lutin, rdbg)."
 requires = "unix str camlp4 num"
 archive(byte) = "lutils.cma"
diff --git a/src/gnuplotRif.ml b/src/gnuplotRif.ml
index 46d283e..5a9f857 100644
--- a/src/gnuplotRif.ml
+++ b/src/gnuplotRif.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 24/11/2017 (at 11:32) by Erwan Jahier> *)
+(* Time-stamp: <modified the 07/12/2017 (at 17:54) by Erwan Jahier> *)
 (*-----------------------------------------------------------------------
 ** This file may only be copied under the terms of the GNU Library General
 ** Public License
@@ -230,7 +230,7 @@ let terminal_kind_to_string tk file =
       | Ps -> "set term post solid \nset output \"" ^ base_fn ^ ".ps\"\n"
       | Cps  -> "set term post color solid \nset output \"" ^ base_fn ^ ".ps\"\n"
       | Eps  -> "set term post color solid  eps\nset output \"" ^ base_fn ^ ".eps\"\n"
-      | Latex  -> "set term solid  latex\nset output \"" ^ base_fn ^ ".tex\"\n"
+      | Latex  -> "set term latex\nset output \"" ^ base_fn ^ ".tex\"\n"
       | X11 -> "set terminal x11"
       | Qt -> "set terminal qt size 1600,400"
       | Default -> ""
diff --git a/src/gnuplotRifMain.ml b/src/gnuplotRifMain.ml
index 417a7e0..c0d273d 100644
--- a/src/gnuplotRifMain.ml
+++ b/src/gnuplotRifMain.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 09/10/2017 (at 22:50) by Erwan Jahier> *)
+(* Time-stamp: <modified the 07/12/2017 (at 17:36) by Erwan Jahier> *)
 (*-----------------------------------------------------------------------
 ** This file may only be copied under the terms of the GNU Library General
 ** Public License
@@ -122,6 +122,8 @@ let main () =
       rloop()
     )
   in
-  if !terminal = NoDisplay then () else rloop ()
+  match !terminal with
+  | X11| Wxt | Qt | Default ->  rloop ()
+  | Jpg | Ps | Pdf | Cps | Eps | Latex | NoDisplay ->  ()
 
 let _ = main ()
diff --git a/src/lutilsVersion.ml b/src/lutilsVersion.ml
index e1cbf23..fe53159 100644
--- a/src/lutilsVersion.ml
+++ b/src/lutilsVersion.ml
@@ -1,2 +1,2 @@
-let str="1.17"
-let sha="f09e3ec"
+let str="1.18"
+let sha="897231e"
diff --git a/test/gnuplot-rif b/test/gnuplot-rif
new file mode 120000
index 0000000..520ec74
--- /dev/null
+++ b/test/gnuplot-rif
@@ -0,0 +1 @@
+../_build/src/gnuplotRifMain.native
\ No newline at end of file
-- 
GitLab