Menu

Installation and initial operation

Andreas Mangold Klaus Landwich

Download and extract ZIP-file

There is only one distribution zip file for all supported environments. Download the current zip file for sasunit from the download section and extract it to a folder of your choice on the machine running your SAS installation. In that folder, a substructure headed by a folder named sasunit\ should have been created now.

If you have a plain SAS installation and a configuration as described in the Release Notes under "Execution environments fully tested", you should now be able to run the example test suite. Otherwise, refer to the trouble shooting section below.

Choose appropriate command script

In the folder sasunit\example\bin two command scripts can be found for every supported environment: one which runs the whole test suite and one which runs only changed tests and tests for changed programs. Both of them run the appropriate test scenarios, collect the results and format the test report in HTML format.

The naming conventions for command scripts are as follows:

sasunit.<sas version>.<operating system>.<language>[.overwrite].<extension>
where

  • <sas version> may be 9.1, 9.2, 9.2_32, 9.3 or 9.3_32. Use the ones with suffix _32 only if you have a 32 bit SAS 9.2 or 9.3 under a 64 bit windows operating system, see also table below.
  • <operating system> may be linux or windows.
  • <language> may be en or de and influences the SAS language settings and the language of the SASUnit test reports generated.
  • [.overwrite] is optional and specifies that the whole test suite should run. If omitted, only changed tests and tests for changed programs are being run.
  • <extension> refers to cmd for windows or sh for linux.

For instance, sasunit.9.3.windows.en.overwrite.cmd starts SAS version 9.3 (64bit) under Microsoft Windows (64 bit), as well as SAS version 9.3 (32bit) under Microsoft Windows (32 bit), uses English SAS configuration, generates an English test report and always runs all test scenarios in the test suite.

We have different command scripts because the installation path of sas.exe varies between SAS versions.
You can determine the proper command file for SAS under windows from the following table:

SAS Version Operating System Command File
SAS 9.1.3 Windows 32 bit sasunit.9.1.*
SAS 9.2 32 bit Windows 32 bit sasunit.9.2.*
SAS 9.2 64 bit Windows 64 bit sasunit.9.2.*
SAS 9.2 32 bit Windows 64 bit sasunit.9.2_32.*
SAS 9.3 32 bit Windows 32 bit sasunit.9.3.*
SAS 9.3 64 bit Windows 64 bit sasunit.9.3.*
SAS 9.3 32 bit Windows 64 bit sasunit.9.3_32.*
Applies only to SASunit 1.5 or earlier:

There are two additional command scripts for Doxygen operation. They can be used for generation of program documentation and they extract program comments and write them to HTML files. You need to install Doxygen (www.doxygen.org) on your system in order to use them.

  • doxygen.cmd is used on Windows
  • doxygen.sh is used on Linux

Note for Linux users: You need to give execution rights to the LINUX script files. Use "chmod a+x ./sasunit.*.sh".

Run appropriate command script

Start the chosen command script. The current folder must be the folder where the scripts reside, this is always the case when you start a script from Windows explorer. The script runs in a command prompt window. If everything goes OK, the command prompt window closes. Otherwise the prompt window pauses and error or warning messages are shown, see trouble shooting section below.

Have a look at the documentation and the sample output

The script should have generated SASUnit test reports or programm documentation for the example test suite. You can access the documentation with the appropriate html file in folder example\doc:

  • test_doc_en.html opens English SASUnit test reports
  • test_doc_de.html opens German SASUnit test reports
  • program_doc.html opens Doxygen generated program documentation.

Note: These reports have been included with the SASUnit distribution so they can be accessed without even running any script.

The folder structure should be as follows:

sasunit              root installation folder
   \example          example root folder
      \bin           command scripts and configuration files
      \dat           data for example test suite
      \doc           html files for access to generated test reports and documentation
         \doxy       Doxygen generated files
         \sasunit    SASUnit generated files
            \de      German SASUnit generated test database (same substructure as for English)
            \en      English SASUnit generated test database 
               \log  SAS log files from run of test suite
               \tst  further results from run of test suite 
               \rep  generated report in HTML format
      \saspgm        test scenario programs and units under test for example test suite
   \saspgm           SASUnit resources 
      \sasunit       SASUnit SAS macros 
      \template      a template for new SAS programs with Doxygen compatible header

Trouble Shooting

If a script does not run, i.e. shows errors in the command prompt window, try the following steps:

  • When there is a message "file not found", you probably used the wrong command script for your environment. See section about script choice above.
  • When using the proper command script for your environment, it might be that you have a non standard SAS installation. Copy the command script and modify the path to sas.exe in the copy.
  • When errors or warnings in the SAS log are indicated, first try to open the test report by means of the proper html file in example\doc. If it opens, there is a link to run_all.log on the main page. Otherwise open example\doc\sasunit\<language>\run_all.doc. Errors or Warnings might result from special configuration of your SAS or OS installation.
  • We have a support forum at https://sourceforge.net/p/sasunit/discussion/support/.

Back to User's Guide


Related

Tickets: #100
Documentation: Release Notes Version 1.2.1
Documentation: User's Guide