    PROGRAM sdTest
!
! main program used to run the complete test suite for a
! particular version of the Level BLAS routines *nrm2
! 
! The module sdTestMod contains the two routines that run the
! single and double precision versions of the test suite. For
! each precision the test suite is executed for both real and
! complex input data vectors.
! 
! The checkTests module contains a suite of routines that
! check the results generated by the BLAS routines under test
! against the expected values that are defined within the test
! suite. The routines used here
! 
! 1) control the level of checks performed (values only or
! both values and the IEEE status flags), and
! 
! 2) control the level of output generated when the test suite
! is executed.
! 
! testSubs is a module that is used to set consistent names
! for the four BLAS routines (dnrm2, dznrm2, snrm2 and scnrm2)
! and to provide a character variable (descript) which will be
! output as a heading to the results file.
! 
! For full details on how the user may control these features
! and how a new set of BLAS routines may be tested against the
! test suite, see the user manual which accompanies this package.

      USE sdTestMod, ONLY: runSpTests, runDpTests
      USE checkTests, ONLY: setOutputLevel, setJustValues, &
                            outputNoOfFails, zeroTestCounts
      USE testSubs, ONLY : dnrm2, snrm2, scnrm2, dznrm2, descript

! Output header to identify output
      WRITE(*,'(A)') '*************************************************'
      WRITE(*,'(A)') 'Output from nrm2 test suite using '// descript
      WRITE(*,'(A)') '*************************************************'
      WRITE(*,'(A)') ''

! Run the full tests for test coverage for the single
! precision implementation
      CALL zeroTestCounts
! The amount of output generated may be controlled by
! setting the output level here:
! 1: Detailed; 2: Intermediate; 3: Concise;
! see user manual for more details
! The default is 3.
!     CALL setOutputLevel(1)
      CALL setJustValues(.FALSE.)
      WRITE (*, '(''Single Precision Test Results'')')
      WRITE (*, '(''-----------------------------'')')
      CALL runSpTests(snrm2, scnrm2)
      CALL outputNoOfFails

! Run the full tests for test coverage for the double
! precision implementation
      CALL zeroTestCounts
! The amount of output generated may be controlled by
! setting the output level here:
! 1: Detailed; 2: Intermediate; 3: Concise;
! see user manual for more details
! The default is 3.
!     CALL setOutputLevel(1)
      CALL setJustValues(.FALSE.)
      WRITE (*, '(''Double Precision Test Results'')')
      WRITE (*, '(''-----------------------------'')')
      CALL runDpTests(dnrm2, dznrm2)
      CALL outputNoOfFails

    END PROGRAM sdTest
