* Bug 15779 fixed: test_run() refused * in tests names 16/20516/5
Samuel GOUGEON [Sun, 23 Sep 2018 15:19:38 +0000 (17:19 +0200)]
  http://bugzilla.scilab.org/15779

  Page updated: http://bugzilla.scilab.org/attachment.cgi?id=4795

  Help ja_JP: misformated history section fixed

  Now (example):
--> test_run elementary_functions dec2*
   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147

   001/004 - [elementary_functions] dec2oct.....................passed
   002/004 - [elementary_functions] dec2hex.....................passed
   003/004 - [elementary_functions] dec2bin.....................passed
   004/004 - [elementary_functions] dec2base....................passed
   ---------------------------------------------------------------------
   Summary
   ../..

Change-Id: Ib333d3839d0ab67620bfd4615c5ca21573e8295d

scilab/CHANGES.md
scilab/modules/development_tools/help/en_US/test_run.xml
scilab/modules/development_tools/help/fr_FR/test_run.xml
scilab/modules/development_tools/help/ja_JP/test_run.xml
scilab/modules/development_tools/macros/test_run.sci
scilab/modules/development_tools/tests/nonreg_tests/bug_15779.tst [new file with mode: 0644]

index 155c115..9662ca6 100644 (file)
@@ -612,6 +612,7 @@ Known issues
 * [#15758](http://bugzilla.scilab.org/show_bug.cgi?id=15758): sparse([0 0],1) crashes scilab (regression)
 * [#15762](http://bugzilla.scilab.org/show_bug.cgi?id=15762): `error()` refused multiline error messages.
 * [#15774](http://bugzilla.scilab.org/show_bug.cgi?id=15774): `clean()` failed on sparse complex matrix.
+* [#15779](http://bugzilla.scilab.org/show_bug.cgi?id=15779): `test_run` did not accept the wildcard * in tests names.
 * [#15809](http://bugzilla.scilab.org/show_bug.cgi?id=15809): HDF5 load/save was super slow for nested lists.
 * [#15814](http://bugzilla.scilab.org/show_bug.cgi?id=15814): Selecting graphic children with booleans yielded an error.
 * [#15818](http://bugzilla.scilab.org/show_bug.cgi?id=15818): `polarplot()` example could not be subplotted. `polarplot`'s demo did not display 'View code' and too often prompted the user.
index 76f3c9e..3963400 100644 (file)
@@ -4,8 +4,8 @@
  * Copyright (C) INRIA
  * Copyright (C) 2009-2011 - DIGITEO - Michael Baudin
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added 32/64bits separation
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="test_run" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="test_run" xml:lang="en">
     <refnamediv>
         <refname>test_run</refname>
         <refpurpose>
                         The names of the tests to execute during this run. If <varname>test_name</varname>
                         is <literal>[]</literal>, all tests found in the module or in the directory are executed.
                     </para>
+                    <para>
+                        The wildcard * can be used, like in <literal>*sin</literal>,
+                        <literal>*sin</literal>, or <literal>*sin*</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
@@ -479,6 +486,45 @@ test_run('SCI/contrib/toolbox_skeleton')
 test_run('boolean',[],[],TMPDIR+"/boolean_test_run.xml");
 test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
  ]]></programlisting>
+        <para>
+            <emphasis role="bold">Selections with wildcard *:</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+test_run elementary_functions *space
+test_run elementary_functions dec2*
+test_run string *ascii*
+ ]]></programlisting>
+    <screen><![CDATA[
+--> test_run elementary_functions *space
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/002 - [elementary_functions] logspace....................passed
+   002/002 - [elementary_functions] linspace....................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+
+--> test_run elementary_functions dec2*
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/004 - [elementary_functions] dec2oct.....................passed
+   002/004 - [elementary_functions] dec2hex.....................passed
+   003/004 - [elementary_functions] dec2bin.....................passed
+   004/004 - [elementary_functions] dec2base....................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+
+--> test_run string *ascii*
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/003 - [string] isascii...................................passed
+   002/003 - [string] asciimat..................................passed
+   003/003 - [string] ascii.....................................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+]]></screen>
     </refsection>
     <refsection>
         <title>Internal Design</title>
@@ -540,6 +586,12 @@ test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
                     </para>
                 </revdescription>
             </revision>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    <para>Tests names with the * wildcard like sin*, *sin, or *sin* are now allowed</para>
+                </revdescription>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index 99cbf95..ee797ed 100644 (file)
@@ -4,8 +4,8 @@
  * Copyright (C) INRIA
  * Copyright (C) 2009-2011 - DIGITEO - Michael Baudin
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added 32/64bits separation
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="test_run" xml:lang="fr">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="test_run" xml:lang="fr">
     <refnamediv>
         <refname>test_run</refname>
         <refpurpose>
                 <term>test_name</term>
                 <listitem>
                     <para>
-                        Un tableau de chaînes de caractères ou <literal>[]</literal> (ou <literal>"[]"</literal>). Le nom des tests à exécuter lors de cette passe de tests, tous les tests si <literal>[]</literal>
+                        Noms des tests à effectuer (tableau de texte), ou <literal>[]</literal>
+                        ou <literal>"[]"</literal> pour tous les tests disponibles pour le
+                        module considéré.
+                    </para>
+                    <para>
+                        Le joker * peut être utilisé, tel que dans <literal>*sin</literal>,
+                        <literal>*sin</literal>, ou <literal>*sin*</literal>.
                     </para>
                 </listitem>
             </varlistentry>
                 <term>options</term>
                 <listitem>
                     <para>
-                        Un tableau de chaînes de caractères ou <literal>[]</literal> (ou <literal>"[]"</literal>). Les options à utiliser pour la passe de test, les options par défaut si <literal>[]</literal>
+                        Un tableau de chaînes de caractères : étiquettes des options à utiliser
+                        pour le lot de tests (liste ci-après).
+                        Indiquer <literal>[]</literal> ou <literal>"[]"</literal> pour utiliser
+                        les options par défaut.
                     </para>
                     <variablelist>
                         <varlistentry>
@@ -403,7 +415,7 @@ test_run(['time','string']);
 // Teste un sous-module
 test_run('optimization|neldermead');
 
-// Teste définit par le chemin d'accès
+// Test défini par le chemin d'accès
 test_run(SCI+'/modules/core');
 
 // Lance un test spécifique
@@ -461,6 +473,45 @@ test_run('SCI/contrib/toolbox_skeleton')
 test_run('boolean',[],[],TMPDIR+"/boolean_test_run.xml");
 test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
  ]]></programlisting>
+        <para>
+            <emphasis role="bold">Sélections avec joker * :</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+test_run elementary_functions *space
+test_run elementary_functions dec2*
+test_run string *ascii*
+ ]]></programlisting>
+    <screen><![CDATA[
+--> test_run elementary_functions *space
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/002 - [elementary_functions] logspace....................passed
+   002/002 - [elementary_functions] linspace....................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+
+--> test_run elementary_functions dec2*
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/004 - [elementary_functions] dec2oct.....................passed
+   002/004 - [elementary_functions] dec2hex.....................passed
+   003/004 - [elementary_functions] dec2bin.....................passed
+   004/004 - [elementary_functions] dec2base....................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+
+--> test_run string *ascii*
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/003 - [string] isascii...................................passed
+   002/003 - [string] asciimat..................................passed
+   003/003 - [string] ascii.....................................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+]]></screen>
     </refsection>
     <refsection>
         <title>Design interne</title>
@@ -517,6 +568,14 @@ test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
                     </para>
                 </revdescription>
             </revision>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    <para>Les noms de tests avec joker * sont désormais utilisables,
+                        tels que sin*, *sin, ou *sin*
+                    </para>
+                </revdescription>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index ce6fca6..0e05dcb 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA
  * Copyright (C) 2009-2011 - DIGITEO - Michael Baudin
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="test_run" xml:lang="ja">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="test_run" xml:lang="ja">
     <refnamediv>
         <refname>test_run</refname>
         <refpurpose>テストを実行</refpurpose>
             <varlistentry>
                 <term>test_name</term>
                 <listitem>
-                    <para>文字列配列</para>
+                    <para>
+                        A string array or <literal>[]</literal> or <literal>"[]"</literal>:
+                        The names of the tests to execute during this run. If <varname>test_name</varname>
+                        is <literal>[]</literal>, all tests found in the module or in the directory are executed.
+                    </para>
+                    <para>
+                        The wildcard * can be used, like in <literal>*sin</literal>,
+                        <literal>*sin</literal>, or <literal>*sin*</literal>.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
 // test_run([],[]);
 // test_run("[]","[]");
 // test_run [] [];
+
 // 1つまたは複数のモジュールをテスト
 // =============================================
 // 1つのモジュールをテスト
 test_run('time');
+
 // 複数のモジュールをテスト
 test_run(['time','string']);
+
 // サブモジュールをテスト
 test_run('optimization|neldermead');
+
 // パスで指定したモジュールを参照
 test_run(SCI+'/modules/core');
+
 // 指定したテストを実行
 // =============================================
 // テストを1つ指定
 test_run('time','datenum');
+
 // 複数のテストを指定
 test_run('time',['datenum';'calendar']);
+
 // いくつかのテストをスキップ
 // =============================================
 test_run('time',['datenum';'calendar'],'skip_tests');
+
 // オプション
 // =============================================
 // .dia と .dia.ref が等しいかどうかをチェックしません
 test_run('time','datenum','no_check_ref');
+
 // .dia.refファイルを作成しますが,.diaと.dia.refが等しいかどうかをチェックしません
 test_run([],[],'create_ref');
+
 // テストを実行しないが,利用可能なテストの一覧を表示します
 test_run([],[],'list');
+
 // このコマンドの使用法に関するいくつかの例を表示します
 test_run([],[],'help');
+
 // 非回帰テストのみを実行し,ユニットテストをスキップします
 test_run([],[],'nonreg_test');
+
 // ユニットテストのみを実行し,非回帰テストをスキップします
 test_run([],[],'unit_test');
+
 // エラー出力 (std err)をチェックしません
 test_run('boolean','bug_2799','no_check_error_output');
+
 // 複数のオプションを同時に指定
 test_run([],[],['no_check_ref','mode_nw']);
 // Console mode
@@ -453,6 +479,45 @@ test_run('SCI/contrib/toolbox_skeleton')
 test_run('boolean',[],[],TMPDIR+"/boolean_test_run.xml");
 test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
  ]]></programlisting>
+        <para>
+            <emphasis role="bold">Selections with wildcard *:</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+test_run elementary_functions *space
+test_run elementary_functions dec2*
+test_run string *ascii*
+ ]]></programlisting>
+    <screen><![CDATA[
+--> test_run elementary_functions *space
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/002 - [elementary_functions] logspace....................passed
+   002/002 - [elementary_functions] linspace....................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+
+--> test_run elementary_functions dec2*
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/004 - [elementary_functions] dec2oct.....................passed
+   002/004 - [elementary_functions] dec2hex.....................passed
+   003/004 - [elementary_functions] dec2bin.....................passed
+   004/004 - [elementary_functions] dec2base....................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+
+--> test_run string *ascii*
+   TMPDIR = C:\MyPath\AppData\Local\Temp\SCI_TMP_3668_1147
+
+   001/003 - [string] isascii...................................passed
+   002/003 - [string] asciimat..................................passed
+   003/003 - [string] ascii.....................................passed
+   --------------------------------------------------------------------------
+   Summary
+../..
+]]></screen>
     </refsection>
     <refsection>
         <title>内部設計</title>
@@ -505,8 +570,12 @@ test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
                         XMLファイルにエクスポートする4番目の引数が追加されました
                     </para>
                 </revdescription>
+            </revision>
+            <revision>
                 <revnumber>5.5.0</revnumber>
                 <revdescription>32/64bits separation available</revdescription>
+            </revision>
+            <revision>
                 <revnumber>6.0.0</revnumber>
                 <revdescription>
                     <para>profiling mode added to profile execution with valgrind (Linux only)</para>
@@ -515,6 +584,12 @@ test_run('time','datenum',[],TMPDIR+"/time_datenum_test_run.xml");
                     </para>
                 </revdescription>
             </revision>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    <para>Tests names with the * wildcard like sin*, *sin, or *sin* are now allowed</para>
+                </revdescription>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index 1efabdc..fded26a 100644 (file)
@@ -3,8 +3,8 @@
 // Copyright (C) 2009-2011 - DIGITEO - Michael Baudin
 // Copyright (C) 2010-2012 - DIGITEO - Antoine ELIAS
 // Copyright (C) 2011 - DIGITEO - Allan CORNET
-//
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2016 - 2018 - Samuel GOUGEON
 //
 // This file is hereby licensed under the terms of the GNU GPL v2.0,
 // pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -381,10 +381,12 @@ function status = test_module(_params)
             for j = 1:size(directories, "*")
                 currentDir = directories(j);
                 testFile = currentDir + filesep() + _params.tests_mat(i) + ".tst";
-
-                if isfile(testFile) then
-                    tests($+1, [1,2]) = [currentDir, _params.tests_mat(i)];
-                    bFind = %t;
+                testFile = listfiles(testFile);  // allows *pattern*
+                for File = testFile'
+                    if isfile(File) then
+                        tests($+1, [1,2]) = [currentDir, basename(File)];
+                        bFind = %t;
+                    end
                 end
             end
 
diff --git a/scilab/modules/development_tools/tests/nonreg_tests/bug_15779.tst b/scilab/modules/development_tools/tests/nonreg_tests/bug_15779.tst
new file mode 100644 (file)
index 0000000..748637e
--- /dev/null
@@ -0,0 +1,77 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2018 - Samuel GOUGEON
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+// <-- ENGLISH IMPOSED -->
+// <-- INTERACTIVE TEST -->
+//   The display of durations of tests makes the REF not reproducible
+//
+// <-- Non-regression test for bug 15779 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/15779
+//
+// <-- Short Description -->
+// test_run(..,"*sin*") with a wildcarded pattern was not allowed
+
+test_run elementary_functions *space
+test_run elementary_functions sin*
+test_run elementary_functions *sin*
+
+// Compare the output to the following lists:
+
+//test_run elementary_functions *space
+//   TMPDIR = TMPDIR
+//   001/002 - [elementary_functions] logspace....................passed
+//   002/002 - [elementary_functions] linspace....................passed
+//   --------------------------------------------------------------------------
+//   Summary
+//   tests              2 - 100 %
+//   passed             2 - 100 %
+//   failed             0 -   0 %
+//   skipped            0
+//   length             3.00 sec
+//   --------------------------------------------------------------------------
+// ans  =
+//  T
+//
+//test_run elementary_functions sin*
+//   TMPDIR = TMPDIR
+//   001/004 - [elementary_functions] sinh........................passed
+//   002/004 - [elementary_functions] sind........................passed
+//   003/004 - [elementary_functions] sinc........................passed
+//   004/004 - [elementary_functions] sin.........................passed
+//   --------------------------------------------------------------------------
+//   Summary
+//   tests              4 - 100 %
+//   passed             4 - 100 %
+//   failed             0 -   0 %
+//   skipped            0
+//   length             8.49 sec
+//   --------------------------------------------------------------------------
+// ans  =
+//  T
+//
+//test_run elementary_functions *sin*
+//   TMPDIR = TMPDIR
+//   001/007 - [elementary_functions] sinh........................passed
+//   002/007 - [elementary_functions] sind........................passed
+//   003/007 - [elementary_functions] sinc........................passed
+//   004/007 - [elementary_functions] sin.........................passed
+//   005/007 - [elementary_functions] asinh.......................passed
+//   006/007 - [elementary_functions] asind.......................passed
+//   007/007 - [elementary_functions] asin........................passed
+//   --------------------------------------------------------------------------
+//   Summary
+//   tests              7 - 100 %
+//   passed             7 - 100 %
+//   failed             0 -   0 %
+//   skipped            0
+//   length             14.61 sec
+//   --------------------------------------------------------------------------
+// ans  =
+//  T