        SUBROUTINE indivTest(testInfo)
! Run an individual test set in both real and complex mode
! and generate output as specified by the user. 
        TYPE (testInfoType), INTENT (INOUT), TARGET :: testInfo

        TYPE (testInfoType) :: testInfoComplex

! Copy over the input data provided in testInfo to the
! structure for the complex test
        testInfoComplex%testNo = testInfo%testNo
        testInfoComplex%testDescript = testInfo%testDescript
        testInfoComplex%invector => testInfo%invector
        testInfoComplex%expectedStatus = testInfo%expectedStatus
        testInfoComplex%expectedNorm = testInfo%expectedNorm
        testInfoComplex%nVal = testInfo%nVal
        testInfoComplex%incxVal = testInfo%incxVal
        testInfoComplex%initialStatus = testInfo%initialStatus
        
        CALL indivRealTest(testInfo)
        CALL indivComplexTest(testInfoComplex)

        END SUBROUTINE indivTest
  
        SUBROUTINE indivRealTest(testInfo)
        USE checkTests, ONLY: getOutputLevel, setTemplate
  
          TYPE (testInfoType), INTENT (INOUT), TARGET :: testInfo
          REAL (wp), PARAMETER :: zero = 0.0E0_wp
          REAL (wp), POINTER :: x(:)
          INTEGER :: outLevel
  
          CHARACTER (LEN=*), PARAMETER :: flagtype(5) = [ 'overflow      ', &
            'divide_by_zero', 'invalid       ', 'underflow     ', &
            'inexact       ' ]
  
          ASSOCIATE (norm => testInfo%returnedNorm, &
                     flagsSet => testInfo%returnedStatus, &
                     testNo => testInfo%testNo, &
                     nVal => testInfo%nVal, &
                     incxVal => testInfo%incxVal, &
                     initialFlags => testInfo%initialStatus)
               
          x => testInfo%inVector
  
! For most examples we just want to test explicitly how the status
! flags have been affected by running the nrm2 routine.  We also
! want to test that the exit flags are the union of the
! flags as passed in and any that have signalled during the
! norm calculation. To allow for both we set the flags prior to the
! call from the values set when the test problem is defined. 
          CALL ieee_set_flag(ieee_all, initialFlags)

! Execute the function
          norm = realNrm2Function(nVal, x, incxVal)
          CALL ieee_get_flag(ieee_all, flagsSet)

          outLevel = getOutputLevel()
          CALL setTemplate(zero)
          SELECT CASE (outLevel)
          CASE (1)
            CALL detailedOutput(testInfo,'R')
          CASE (2)
            CALL intermediateOutput(testInfo,'R')
          CASE (3)
            CALL minimalOutput(testInfo,'R')
          END SELECT
  
        END ASSOCIATE
        END SUBROUTINE indivRealTest
  
        SUBROUTINE indivComplexTest(testInfo)
        USE checkTests, ONLY: getOutputLevel, setTemplate
  
          TYPE (testInfoType), INTENT (INOUT), TARGET :: testInfo
          REAL (wp), PARAMETER :: zero = 0.0E0_wp
          REAL (wp), POINTER :: x(:)
          INTEGER :: outLevel, errno, nc
          COMPLEX (wp), ALLOCATABLE :: xc(:)
  
          CHARACTER (LEN=*), PARAMETER :: flagtype(5) = [ 'overflow      ', &
            'divide_by_zero', 'invalid       ', 'underflow     ', &
            'inexact       ' ]
  
          ASSOCIATE (norm => testInfo%returnedNorm, &
                     flagsSet => testInfo%returnedStatus, &
                     testNo => testInfo%testNo, &
                     nVal => testInfo%nVal, &
                     incxVal => testInfo%incxVal, &
                     initialFlags => testInfo%initialStatus)
               
          x => testInfo%inVector
          IF (incxVal==1) THEN
            n = (nVal + 1)/2
            nc = n
          ELSE
            n = nVal
            nc = (n-1)*incxVal + 1
          END IF
  
! For most examples we just want to test explicitly how the status
! flags have been affected by running the nrm2 routine.  We also
! want to test that the exit flags are the union of the
! flags as passed in and any that have signalled during the
! norm calculation. To allow for both we set the flags prior to the
! call from the values set when the test problem is defined. 
          CALL ieee_set_flag(ieee_all, initialFlags)

          ALLOCATE(xc(nc), STAT=errno)
          IF (errno /= 0) THEN
            WRITE(*, '(''Allocate error from indivComplexTest. &
                     &Errno = '',i5)')errno
            STOP
          END IF

          IF (incxVal == 1) THEN
            DO i = 1, nVal/2
              xc(i) = CMPLX(x(2*i-1), x(2*i), KIND=wp)
            END DO
! If size(x) is odd then pad with a zero
            IF (MOD(nVal, 2) == 1) THEN
              xc(nc) = CMPLX(x(nVal), zero, KIND=wp)
            END IF
          ELSE IF (incxVal > 1) THEN
! Alternate real and imaginary values
            DO i = 1, nc, 2
              xc(i) = CMPLX(x(i), zero, KIND=wp)
            END DO
            DO i = 2, nc, 2
              xc(i) = CMPLX(zero, x(i), KIND=wp)
            END DO
            
          END IF
   
  ! Execute the function
          norm = complexNrm2Function(n, xc, incxVal)
          CALL ieee_get_flag(ieee_all, flagsSet)

          outLevel = getOutputLevel()
          CALL setTemplate(zero)
          SELECT CASE (outLevel)
          CASE (1)
            CALL detailedOutput(testInfo, 'C')
          CASE (2)
            CALL intermediateOutput(testInfo, 'C')
          CASE (3)
            CALL minimalOutput(testInfo, 'C')
          END SELECT
  
        END ASSOCIATE
        DEALLOCATE(xc)
        END SUBROUTINE indivComplexTest
