Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Past structure of xmls folder:
In the past this folder contained this structure of folders, to separate the cases that are expected to be run only by the developer version (only developer) and the cases that could be run by both (official and developer versions).
\xmls
        \common
                       \cases_running
                       \cases_failing
        \only developer
                         \cases_running
                         \cases_failing


cases_running and cases_failing folders classify depending on if the test cases must be run successfully (cases_running) or if they will fail and the error is not solved yet (cases_failing).
Inside these could be an arbitrary number of xmls and its name was important to classify the cases as a tree. There was being one xml file for each family of test cases (for example, mesh_structured.xml, geom_intersection.xml, etc...). Big test cases, which may take a lot of memory, and may last a lot of time, were in specific xml's, in order to avoid the running simultaneously with other test cases to not collapse the computer.


Current structure of xmls folders:
Now all cases are defined in a single xml file, named 'tester_cases.xml', and this file is controlled by the CVS (to synchronize several users sharing its information).
The information of common/only_developer cases_running/cases_failing and 'tree classification' is now stored in the definition of each case.

Note: The old style could be already used to import some external cases (once imported its data is stored 'in tester_cases.xml' and the auxiliary files are not needed more)

File structure of tester_cases.xml:
The file content must be like this:

Code Block
languagexml
<?xml version="1.0" encoding="utf-8"?>

...


<cases version="1.0">

...

  
   <case>
      case fields
   </case>
    ...
   <case>
   </case>
</cases>


Case fields:
For each case is possible to use these keys, most of them are optional:
It is not necessary to know this syntax, the normal way is to fill the information in the GUI to define or modify a case.


General fields:
These fields are defined also in the preferences window, and it is not necessary to specify them again in each tests case: they must be set only if it's different of the general one!!

...

It will be tested if the content is true, as a Tcl expression.
Check

Example of a general case


Code Block
languagexml

...

  <case>
    <name>cmd.exe stdout</name>

...


    <help>tester sample of a program different of GiD, e.g. Windows cmd.exe</help>

...


    <exe>cmd.exe</exe>

...


    <args>/c date /t</args>

...


    <outfile>stdout</outfile>

...


    <readingproc>::tester::myownread</readingproc>

...


    <codetosource>
      proc ::tester::myownread { all }

...

 {
      scan $all "%d/%d/%d" dd mm

...

 yyyy
      set res [list day $dd month $mm year $yyyy]

...


      return $res
      }
    </codetosource>
    <check>
      <rule-1>$day>=1 && $day<=365</rule-1>

...


      <monthandyear>($month>1 && $month<12) && $year>=2007</monthandyear>

...


    </check>

...


  </case>


Example of a GiD case

Code Block

...

languagexml
  <case>
    <name>GiD 8.0.9 : camp1_8_s</name>

...


    <help>must fail one check of number of nodes</help>

...


    <exe>C:\Program Files\GiD\GiD 8.0.9\gid.exe</exe>

...


    <args>-b cases/iges_bch/camp1_8_s.bch -n</args>

...


    <timeout>3600</timeout>

...


    <check>
      <numnodes>$numnodes>1</numnodes>

...


      <numnodes-2>$numnodes>80000</numnodes-2>

...


    </check>

...


  </case>


Note that instead <args> could use the more simple syntax
<batch>cases/iges_bch/camp1_8_s.bch</batch>


Another example

Code Block
languagexml
  <exe>C:\gid project\gid_offscreen.bat</exe>

...


  <exe platform="Linux">/home/gid/gid_off</exe>

...

  
  <exe username="miguel">C:\GiD64\gid_offscreen.bat</exe>

...


  <exe username="miguel" platform="Linux">/home/miguel/GID/gid/gid_off</exe>

...

  
  <case>
    <help>OFF_Preprocess: batch launches tcl, creates geometry (using another batch), meshes, png and quits</help>

...


    <name>OFF_PreBatchBasic</name>

...


    <args>-offscreen -b+g "batchs/Pre/OffScreen/flapslat_batch00.bch"</args>

...


    <outputfile-1>flapslat_geom.png</outputfile-1>

...


    <outputfile-2>flapslat_mesh.png</outputfile-2>

...


    <check>
      <test-1>[file size flapslat_geom.png]>0</test-1>

...


      <test-2>[file size flapslat_mesh.png]>0</test-2>

...


    </check>

...


  </case>