Smith2: Script Translation Utility

Smith2 is a standalone command line program which allows you to convert .smith scripts into Ruby, Java or C++ source files, which can then be executed using the appropriate TestSmith API.

Enter Smith2 without parameters to see the main help screen, which looks like this:




      Smith2:


      The TestSmith Script Translation Utility (v1.4.0)


      ------------------------------------------------------------





      Syntax:    smith2 language script class-name [workspace]





      language   - language to translate to: RUBY, JAVA, CPP or MFC


                   this parameter is case-insensitive


      script     - full path name of .smith script to be converted


      class-name - class name of the Ruby, Java or C++ class to create


                   the output file/s will be created in the


                   appropriate default TestSmith API directory


      workspace  - use with MFC language only; if non-zero value


                   a MFC project and workspace will be created





      Example:   smith2 MFC c:\scripts\test1.smith NewTest 1





      ------------------------------------------------------------


      For more information please see the user guide at


      http://agilethinking.net/qualityforge/testsmith/userguide/smith2.html


Argument Details
  • language
    Only four values are acceptable: RUBY, JAVA, CPP and MFC. The values are not case-sensitive, so for example Java or cpp will also be accepted.
    RUBY will translate the .smith script to Ruby source; JAVA will translate the .smith script to Java source; CPP will translate the .smith script to C++ source; MFC will translate the .smith script to C++ source with 'Microsoft Foundation Classes' support.
  • script
    Full or relative path name of the .smith file which is to be translated. The .smith file is treated as a read-only file, i.e. the .smith file will still exist intact after the translation.
  • class-name
    The class name of the Ruby, Java or C++ class that will be created. The name must begin with A-Z; the other characters must be in the A-Z, a-z, 0-9 ranges or be an underscore _ character. The first character of the name will always be forced to upper case, to follow Ruby, Java and C++ class naming conventions.
    The output source file created for the class will be in the default TestSmith directory for that language, on the \QualityForge\TestSmith path: \RubySmith for RUBY translations, \TSJAPI for JAVA translations, \TSCAPI for CPP translations and \TSMFCAPI for MFC translations. Take care; if the output source file already exists it will be overidden.
  • workspace
    This parameter is only required if the translation is to MFC. If the value is numeric and non-zero a project directory will be created below the \TSMFCAPI directory containing the source files and the required project and workspace files which will also be generated. If the value is 0 or the parameter is not set the source files will be created directly in the \TSMFCAPI directory.
Additional Information

Please refer to the specific documentation for RubySmith, TSJAPI, TSCAPI and TSMFCAPI for detailed information on using TestSmith tests written in Ruby, Java or C++.