* "make check" will now launched the most important unitary tests (level 1). 72/6072/6
Sylvestre Ledru [Thu, 26 Jan 2012 15:22:39 +0000 (16:22 +0100)]
Change-Id: Ie9457cab08b0bac37fd93802238f33e0979f6bd5

scilab/CHANGES_5.4.X
scilab/Makefile.am
scilab/Makefile.in
scilab/Scilab.sln
scilab/Scilab_f2c.sln
scilab/Visual-Studio-settings/test-level/test-level.vcxproj [new file with mode: 0644]
scilab/Visual-Studio-settings/test-level/test-level.vcxproj.filters [new file with mode: 0644]
scilab/modules/development_tools/data/test_run_level.xml [new file with mode: 0644]
scilab/modules/development_tools/development_tools.iss
scilab/modules/development_tools/macros/test_run_level.sci [new file with mode: 0644]

index e8a45cd..34412bd 100644 (file)
@@ -149,6 +149,7 @@ Compilation
 
 * Enforce a minimal version of Flexdock (1.1.1).
 
+* "make check" will now launched the most important unitary tests (level 1).
 
 Bug fixes
 =========
index 67db1d0..29d45a2 100644 (file)
@@ -195,11 +195,13 @@ check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
        fi
 
 check-recursive: check-local
+       @echo "Check resursive disabled"
 check-local:
        @if test -x $(top_builddir)/scilab-bin; then \
-               COMMAND="try test_run();catch exit(-1);end;exit(0)";\
+               COMMAND="try test_run_level(1);catch exit(-1);end;exit(0)";\
                export LANG=C;\
-               $(top_builddir)/bin/scilab-adv-cli -nb -e "$$COMMAND"; \
+               echo "LANG=C $(top_builddir)/bin/scilab-cli -nb -e \"$$COMMAND\""; \
+               time $(top_builddir)/bin/scilab-cli -nb -e "$$COMMAND"; \
        else \
                echo "Cannot find Scilab binary"; \
        fi
index 968ff17..87c6456 100644 (file)
@@ -1691,11 +1691,13 @@ check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
        fi
 
 check-recursive: check-local
+       @echo "Check resursive disabled"
 check-local:
        @if test -x $(top_builddir)/scilab-bin; then \
-               COMMAND="try test_run();catch exit(-1);end;exit(0)";\
+               COMMAND="try test_run_level(1);catch exit(-1);end;exit(0)";\
                export LANG=C;\
-               $(top_builddir)/bin/scilab-adv-cli -nb -e "$$COMMAND"; \
+               echo "$(top_builddir)/bin/scilab-cli -nb -e \"$$COMMAND\""; \
+               time $(top_builddir)/bin/scilab-cli -nb -e "$$COMMAND"; \
        else \
                echo "Cannot find Scilab binary"; \
        fi
index b19bb50..efe285d 100644 (file)
@@ -546,6 +546,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "modules\xml\xml.vcxp
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types", "modules\types\types.vcxproj", "{626B9142-13A1-4765-A072-FB08952E7BB8}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-level", "Visual-Studio-settings\test-level\test-level.vcxproj", "{07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1622,6 +1624,10 @@ Global
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|Win32.Build.0 = Release|Win32
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.ActiveCfg = Release|x64
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.Build.0 = Release|x64
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Debug|Win32.ActiveCfg = Debug|Win32
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Debug|x64.ActiveCfg = Debug|x64
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Release|Win32.ActiveCfg = Release|Win32
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Release|x64.ActiveCfg = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 9d40b09..45bc520 100644 (file)
@@ -544,6 +544,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "modules\xml\xml.vcxp
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types", "modules\types\types.vcxproj", "{626B9142-13A1-4765-A072-FB08952E7BB8}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-level", "Visual-Studio-settings\test-level\test-level.vcxproj", "{07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1612,6 +1614,10 @@ Global
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|Win32.Build.0 = Release|Win32
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.ActiveCfg = Release|x64
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.Build.0 = Release|x64
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Debug|Win32.ActiveCfg = Debug|Win32
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Debug|x64.ActiveCfg = Debug|x64
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Release|Win32.ActiveCfg = Release|Win32
+               {07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}.Release|x64.ActiveCfg = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
diff --git a/scilab/Visual-Studio-settings/test-level/test-level.vcxproj b/scilab/Visual-Studio-settings/test-level/test-level.vcxproj
new file mode 100644 (file)
index 0000000..eda11ca
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{07F766A8-A2C1-4D9D-86DE-FD9C19952C7A}</ProjectGuid>
+    <Keyword>MakeFileProj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Makefile</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe" -nb -e test_run_level(1);</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()
+if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_run_level(1)</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()</NMakeCleanCommandLine>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe" -nb -e test_run_level(1);</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()
+if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_run_level(1)</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()</NMakeCleanCommandLine>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe" -nb -e test_run_level(1);</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()
+if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_run_level(1)</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()</NMakeCleanCommandLine>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+    <NMakeBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe" -nb -e test_run_level(1);</NMakeBuildCommandLine>
+    <NMakeReBuildCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()
+if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_run_level(1)</NMakeReBuildCommandLine>
+    <NMakeCleanCommandLine>if EXIST "$(SolutionDir)/bin/scilex.exe" "$(SolutionDir)/bin/scilex.exe"  -nb -e test_clean()</NMakeCleanCommandLine>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/Visual-Studio-settings/test-level/test-level.vcxproj.filters b/scilab/Visual-Studio-settings/test-level/test-level.vcxproj.filters
new file mode 100644 (file)
index 0000000..d7ef6a1
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/development_tools/data/test_run_level.xml b/scilab/modules/development_tools/data/test_run_level.xml
new file mode 100644 (file)
index 0000000..3b68681
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises
+ * 
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at    
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ -->
+
+<tests>
+  <level severity="1">
+    <module name="core">
+      <test>clear</test>
+      <test>colon</test>
+      <test>type</test>
+    </module>
+    
+    <module name="string">
+      <test>evstr</test>
+    </module>
+    
+    <module name="data_structures">
+      <test>fieldnames</test>
+      <test>hypermat</test>
+      <test>isfield</test>
+      <test>listextraction</test>
+      <test>listinsertion</test>
+      <test>lstcat</test>
+      <test>lstops</test>
+      <test>struct</test>
+    </module>
+    
+    <module name="development_tools|assert">
+      <test>checkalmostequal</test>
+      <test>checkequal</test>
+      <test>checkerror</test>
+      <test>checkfalse</test>
+      <test>checkfilesequal</test>
+      <test>checktrue</test>
+      <test>comparecomplex</test>
+      <test>computedigits</test>
+      <test>cond2reltol</test>
+      <test>cond2reqdigits</test>
+      <test>generror</test>
+    </module>
+    
+    <module name="elementary_functions">
+      <test>prod</test>
+      <test>linspace</test>
+      <test>logspace</test>
+      <test>gsort</test>
+      <test>round</test>
+      <test>floor</test>
+      <test>fix</test>
+      <test>complex</test>
+      <!--      <test>sin</test> Fails -->
+      <!--      <test>cos</test> Fails -->
+      <test>tand</test>
+      <test>abs</test>
+      <test>isempty</test>
+    </module>
+    
+    <module name="polynomials">
+      <test>polops</test>
+    </module>
+    
+    <module name="overloading">
+      <test>sparse</test>
+      <test>rational</test>
+    </module>
+    
+    <!-- 
+Randomly fail ...
+
+    <module name="output_stream">
+      <test>disp</test>
+      <test>msprintf</test>
+      <test>mprintf</test>
+      <test>diary</test>
+      <test>printf</test>
+      <test>sprintf</test>
+      <test>ssprint</test>
+    </module>
+-->
+    
+  </level>
+  
+  <level severity="2">
+    <module name="core">
+      <test>lasterror</test>
+      <test>who</test>
+      <test>stacksize</test>
+    </module>
+    
+    <module name="string">
+      <test>tokens</test>
+    </module>
+    
+    <module name="polynomials">
+      <test>roots</test>
+    </module>
+    
+  </level>
+  
+</tests>
index 7cc0692..92726c2 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 ; Copyright (C) INRIA - Allan CORNET
-; Copyright (C) DIGITEO - 2010 - Allan CORNET
+; Copyright (C) DIGITEO - 2010-2012 - Allan CORNET
 ;
 ; This file must be used under the terms of the CeCILL.
 ; This source file is licensed as described in the file COPYING, which
@@ -46,5 +46,6 @@ Source: modules\{#DEVTOOLS}\macros\assert\cleanmacros.bat; DestDir: {app}\module
 ;Source: modules\{#DEVTOOLS}\examples\*.*; DestDir: {app}\modules\{#DEVTOOLS}\examples; Flags: recursesubdirs; Components: {#COMPN_DEVTOOLS}
 ;
 Source: modules\{#DEVTOOLS}\tests\*.*; DestDir: {app}\modules\{#DEVTOOLS}\tests; Flags: recursesubdirs; Components: {#COMPN_DEVTOOLS} and {#COMPN_TESTS}
+Source: modules\{#DEVTOOLS}\data\test_run_level.xml; DestDir: {app}\modules\{#DEVTOOLS}\data; Flags: recursesubdirs; Components: {#COMPN_DEVTOOLS} and {#COMPN_TESTS}
 ;
 ;--------------------------------------------------------------------------------------------------------------
diff --git a/scilab/modules/development_tools/macros/test_run_level.sci b/scilab/modules/development_tools/macros/test_run_level.sci
new file mode 100644 (file)
index 0000000..b9e8bdc
--- /dev/null
@@ -0,0 +1,37 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// test_run  --
+//   Launch unit tests.
+
+function test_run_level(severity)
+  disp("Run all test level " + string(severity));
+  doc = xmlRead(SCI+"/modules/development_tools/data/test_run_level.xml");
+
+  // Retrieve the list of modules
+  modules=xmlXPath(doc, "/tests/level[@severity=" + string(severity) + "]/module");
+  
+  for (i=1:modules.size)
+
+    // Retrieve the list of tests
+    tests = xmlAsText(xmlXPath(modules(i),"test"));
+    
+    // Run the test
+    status = test_run(modules(i).attributes.name,  tests, ["no_check_error_output","short_summary"]);
+    
+    if (status == %f) then
+      error("At least one error has been detected. Failing all tests.");
+      // Since make check is launched by the build system
+      // It checks if any error occured and fails if it happens
+    end
+  end
+  
+  xmlDelete(doc);
+    
+endfunction