MODULE ttm$create_test_environment;

{ PURPOSE:
{ Contains the procedures needed to create a test environment.

*copyc amt$access_selection
*copy amp$get_file_attributes
*copy amp$get_next
*copy amp$put_next
*copy clp$add_file_to_command_list
*copy clp$convert_string_to_file_ref
*copy clp$create_variable
*copy clp$change_variable
*copy clp$create_environment_variable
*copy clp$create_procedure_variable
*copy clp$delete_file_from_cmnd_list
*copy clp$evaluate_parameters
*copy clp$get_working_catalog
*copy clp$read_variable
*copy clp$get_variable_value
*copy clp$include_command
*copy clp$set_working_catalog
*copy clp$write_variable
*copy fsp$close_file
*copy fsp$open_file
*copy osp$set_status_abnormal
*copy pmp$exit
*copy pmp$get_user_identification
*copy pmp$log

{ Purpose:
{   The module contains the procedures needed to create the environment
{   for feature testing.
{ Design:
{   SCL job scope variables are initialized and object libraries are
{   added to the command list to enable the job to execute feature tests.

{ PROCEDURE (ttm$crete) crete_pdt (
{       use_catalog, uc              : file =
{         $fname(':'//$string($job_default(lf))//'.testve')
{       tool_library, tl             :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .test_tools.bound_product
{       test_development_library, tdl:  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       feature_test_procedures, ftp :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .osf$f_test_procedures
{       feature_test_binary, ftb     :  any of
{                                         key not_available keyend
{                                       file
{                                       anyend = .osf$f_test_binaries
{       feature_test_data, ftd       :  any of
{                                         key not_available keyend
{                                       file
{                                       anyend = .osf$f_test_data
{       scu_test_procedures, stp     :  any of
{                                         key not_available keyend
{                                       file
{                                       anyend = .scf$f_test_procedures
{       scu_test_binary, stb         :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       scu_test_data, std           :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .scf$f_test_data
{       cybil_test_procedures, ctp   :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       cybil_test_binary, ctb       :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       cybil_test_data, ctd         :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       ocu_test_procedures, otp     :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .ocf$f_test_procedures
{       ocu_test_binary, otb         :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .ocf$f_test_binaries
{       ocu_test_data, otd           :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       product_set_test_data,pstd   :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .psf$p_test_data
{       system_test_procedures, sytp :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .stf$test_procedures
{       system_test_binary, sytb     :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .stf$test_binaries
{       system_test_data, sytd       :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = .stf$test_data
{       wef_test_procedures, wtp     :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       wef_test_binary, wtb         :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       password_suffix, pws         : string = 'pw'
{       product_set_version, psv     : string 5 = '*****'
{       tape_vsn, tv                 : string 1..6 = $optional
{       tape_density, td             : key mt9$800, mt9$1600, mt9$6250, ..
{                                        mt18$38000 keyend = mt9$6250
{       remote_family,ref            : string = ''
{       cybil_path, cp               :  any of
{                                         key not_available keyend
{                                         file
{                                       anyend = NOT_AVAILABLE
{       results_file, rf             :  file = $user.ttf$results
{       log_option, lo               :  any of
{                                         key printer,p keyend
{                                         file
{                                       anyend = printer
{       status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 59] of clt$pdt_parameter_name,
      parameters: array [1 .. 30] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        default_value: string (49),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (25),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (22),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (20),
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (16),
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (22),
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (16),
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type12: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (22),
      recend,
      type14: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (20),
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type16: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (16),
      recend,
      type17: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (20),
      recend,
      type18: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (18),
      recend,
      type19: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (14),
      recend,
      type20: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (20),
      recend,
      type21: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (20),
      recend,
      type22: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
        default_value: string (4),
      recend,
      type23: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
        default_value: string (7),
      recend,
      type24: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type25: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (8),
      recend,
      type26: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
        default_value: string (2),
      recend,
      type27: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (13),
      recend,
      type28: record
        header: clt$type_specification_header,
        default_value: string (17),
      recend,
      type29: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        default_value: string (7),
      recend,
      type30: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 7, 20, 7, 55, 26, 700],
    clc$command, 59, 30, 0, 0, 0, 0, 30, 'TTM$CRETE'], [
    ['CP                             ',clc$abbreviation_entry, 27],
    ['CTB                            ',clc$abbreviation_entry, 11],
    ['CTD                            ',clc$abbreviation_entry, 12],
    ['CTP                            ',clc$abbreviation_entry, 10],
    ['CYBIL_PATH                     ',clc$nominal_entry, 27],
    ['CYBIL_TEST_BINARY              ',clc$nominal_entry, 11],
    ['CYBIL_TEST_DATA                ',clc$nominal_entry, 12],
    ['CYBIL_TEST_PROCEDURES          ',clc$nominal_entry, 10],
    ['FEATURE_TEST_BINARY            ',clc$nominal_entry, 5],
    ['FEATURE_TEST_DATA              ',clc$nominal_entry, 6],
    ['FEATURE_TEST_PROCEDURES        ',clc$nominal_entry, 4],
    ['FTB                            ',clc$abbreviation_entry, 5],
    ['FTD                            ',clc$abbreviation_entry, 6],
    ['FTP                            ',clc$abbreviation_entry, 4],
    ['LO                             ',clc$abbreviation_entry, 29],
    ['LOG_OPTION                     ',clc$nominal_entry, 29],
    ['OCU_TEST_BINARY                ',clc$nominal_entry, 14],
    ['OCU_TEST_DATA                  ',clc$nominal_entry, 15],
    ['OCU_TEST_PROCEDURES            ',clc$nominal_entry, 13],
    ['OTB                            ',clc$abbreviation_entry, 14],
    ['OTD                            ',clc$abbreviation_entry, 15],
    ['OTP                            ',clc$abbreviation_entry, 13],
    ['PASSWORD_SUFFIX                ',clc$nominal_entry, 22],
    ['PRODUCT_SET_TEST_DATA          ',clc$nominal_entry, 16],
    ['PRODUCT_SET_VERSION            ',clc$nominal_entry, 23],
    ['PSTD                           ',clc$abbreviation_entry, 16],
    ['PSV                            ',clc$abbreviation_entry, 23],
    ['PWS                            ',clc$abbreviation_entry, 22],
    ['REF                            ',clc$abbreviation_entry, 26],
    ['REMOTE_FAMILY                  ',clc$nominal_entry, 26],
    ['RESULTS_FILE                   ',clc$nominal_entry, 28],
    ['RF                             ',clc$abbreviation_entry, 28],
    ['SCU_TEST_BINARY                ',clc$nominal_entry, 8],
    ['SCU_TEST_DATA                  ',clc$nominal_entry, 9],
    ['SCU_TEST_PROCEDURES            ',clc$nominal_entry, 7],
    ['STATUS                         ',clc$nominal_entry, 30],
    ['STB                            ',clc$abbreviation_entry, 8],
    ['STD                            ',clc$abbreviation_entry, 9],
    ['STP                            ',clc$abbreviation_entry, 7],
    ['SYSTEM_TEST_BINARY             ',clc$nominal_entry, 18],
    ['SYSTEM_TEST_DATA               ',clc$nominal_entry, 19],
    ['SYSTEM_TEST_PROCEDURES         ',clc$nominal_entry, 17],
    ['SYTB                           ',clc$abbreviation_entry, 18],
    ['SYTD                           ',clc$abbreviation_entry, 19],
    ['SYTP                           ',clc$abbreviation_entry, 17],
    ['TAPE_DENSITY                   ',clc$nominal_entry, 25],
    ['TAPE_VSN                       ',clc$nominal_entry, 24],
    ['TD                             ',clc$abbreviation_entry, 25],
    ['TDL                            ',clc$abbreviation_entry, 3],
    ['TEST_DEVELOPMENT_LIBRARY       ',clc$nominal_entry, 3],
    ['TL                             ',clc$abbreviation_entry, 2],
    ['TOOL_LIBRARY                   ',clc$nominal_entry, 2],
    ['TV                             ',clc$abbreviation_entry, 24],
    ['UC                             ',clc$abbreviation_entry, 1],
    ['USE_CATALOG                    ',clc$nominal_entry, 1],
    ['WEF_TEST_BINARY                ',clc$nominal_entry, 21],
    ['WEF_TEST_PROCEDURES            ',clc$nominal_entry, 20],
    ['WTB                            ',clc$abbreviation_entry, 21],
    ['WTP                            ',clc$abbreviation_entry, 20]],
    [
{ PARAMETER 1
    [55, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 49],
{ PARAMETER 2
    [52, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 25],
{ PARAMETER 3
    [50, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 4
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 22],
{ PARAMETER 5
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 20],
{ PARAMETER 6
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 16],
{ PARAMETER 7
    [35, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 22],
{ PARAMETER 8
    [33, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 9
    [34, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 16],
{ PARAMETER 10
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 11
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 12
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 13
    [19, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 22],
{ PARAMETER 14
    [17, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 20],
{ PARAMETER 15
    [18, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 16
    [24, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 16],
{ PARAMETER 17
    [42, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 20],
{ PARAMETER 18
    [40, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 18],
{ PARAMETER 19
    [41, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 14],
{ PARAMETER 20
    [57, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 20],
{ PARAMETER 21
    [56, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 20],
{ PARAMETER 22
    [23, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 8, clc$optional_default_parameter, 0, 4],
{ PARAMETER 23
    [25, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 8, clc$optional_default_parameter, 0, 7],
{ PARAMETER 24
    [47, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 8, clc$optional_parameter, 0, 0],
{ PARAMETER 25
    [46, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 155, clc$optional_default_parameter, 0, 8],
{ PARAMETER 26
    [30, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 8, clc$optional_default_parameter, 0, 2],
{ PARAMETER 27
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 67, clc$optional_default_parameter, 0, 13],
{ PARAMETER 28
    [31, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 17],
{ PARAMETER 29
    [16, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 104, clc$optional_default_parameter, 0, 7],
{ PARAMETER 30
    [36, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type],
    '$fname('':''//$string($job_default(lf))//''.testve'')'],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.test_tools.bound_product'],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.osf$f_test_procedures'],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.osf$f_test_binaries'],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.osf$f_test_data'],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.scf$f_test_procedures'],
{ PARAMETER 8
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 9
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.scf$f_test_data'],
{ PARAMETER 10
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 11
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 12
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 13
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.ocf$f_test_procedures'],
{ PARAMETER 14
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.ocf$f_test_binaries'],
{ PARAMETER 15
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 16
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.psf$p_test_data'],
{ PARAMETER 17
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.stf$test_procedures'],
{ PARAMETER 18
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.stf$test_binaries'],
{ PARAMETER 19
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    '.stf$test_data'],
{ PARAMETER 20
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 21
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 22
    [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE],
    '''pw'''],
{ PARAMETER 23
    [[1, 0, clc$string_type], [5, 5, FALSE],
    '''*****'''],
{ PARAMETER 24
    [[1, 0, clc$string_type], [1, 6, FALSE]],
{ PARAMETER 25
    [[1, 0, clc$keyword_type], [4], [
    ['MT18$38000                     ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['MT9$1600                       ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['MT9$6250                       ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['MT9$800                        ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
    ,
    'mt9$6250'],
{ PARAMETER 26
    [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE],
    ''''''],
{ PARAMETER 27
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NOT_AVAILABLE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'NOT_AVAILABLE'],
{ PARAMETER 28
    [[1, 0, clc$file_type],
    '$user.ttf$results'],
{ PARAMETER 29
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['P                              ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
      ['PRINTER                        ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]]
    ,
    'printer'],
{ PARAMETER 30
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$use_catalog = 1,
      p$tool_library = 2,
      p$test_development_library = 3,
      p$feature_test_procedures = 4,
      p$feature_test_binary = 5,
      p$feature_test_data = 6,
      p$scu_test_procedures = 7,
      p$scu_test_binary = 8,
      p$scu_test_data = 9,
      p$cybil_test_procedures = 10,
      p$cybil_test_binary = 11,
      p$cybil_test_data = 12,
      p$ocu_test_procedures = 13,
      p$ocu_test_binary = 14,
      p$ocu_test_data = 15,
      p$product_set_test_data = 16,
      p$system_test_procedures = 17,
      p$system_test_binary = 18,
      p$system_test_data = 19,
      p$wef_test_procedures = 20,
      p$wef_test_binary = 21,
      p$password_suffix = 22,
      p$product_set_version = 23,
      p$tape_vsn = 24,
      p$tape_density = 25,
      p$remote_family = 26,
      p$cybil_path = 27,
      p$results_file = 28,
      p$log_option = 29,
      p$status = 30;

    VAR
      pvt: array [1 .. 30] of clt$parameter_value;
  TYPE
    string_line = string (256);

  VAR
    exit_message: string_line,
    length: integer,
    opened: boolean := FALSE,
    output_id: amt$file_identifier;

?? FMT (FORMAT := ON) ??

{ PURPOSE:
{ This function returns the length in characters of the input string
{ DESIGN:
{ Counts down blanks and returns length when a non-blank is found.

  FUNCTION strlen#
    (    input_string: string ( * )): integer;

    VAR
      i: integer;

    strlen# := 0;

  /count_loop/
    FOR i := #SIZE (input_string) DOWNTO 1 DO
      IF input_string (i) <> ' ' THEN
        strlen# := i;
        EXIT /count_loop/; {----->
      IFEND;
    FOREND /count_loop/;

  FUNCEND strlen#;

{ PURPOSE:
{   This procedure displays the string output_str to $OUTPUT.
{ DESIGN:
{   A global variable OPENED is used so that the FSP$OPEN call
{   needs to be made only once.

  PROCEDURE output_message#
    (    output_str: string ( * ));

    VAR
      fba: amt$file_byte_address,
      lfn: amt$local_file_name,
      local_status: ost$status,
      open_attrib: array [1 .. 1] of amt$access_selection;

    IF NOT opened THEN
      fsp$open_file ('$OUTPUT', amc$record, NIL, NIL, NIL, NIL, NIL, output_id,
            local_status);
      IF NOT local_status.normal THEN
        pmp$exit (local_status);
      IFEND;
      opened := TRUE;
    IFEND;
    amp$put_next (output_id, ^output_str, strlen# (output_str), fba,
          local_status);
    IF NOT local_status.normal THEN
      pmp$exit (local_status);
    IFEND;

  PROCEND output_message#;

{ PURPOSE:
{ Write to the job log the SCL test tool variable and its value.
{ DESIGN:
{ Use pmp$log.

  PROCEDURE output_var_to_log#
    (    var_name: string ( * );
         var_value: string ( * ));

    VAR
      length: integer,
      log_status: ost$status,
      output_line: ost$string;

    output_line.value := '';
    STRINGREP (output_line.value, length, var_name, var_value);
    pmp$log (output_line.value (1, length), log_status);

  PROCEND output_var_to_log#;

{ PURPOSE:
{ Create an SCL string variable if one does not already exist.
{ DESIGN:
{ Clp$read_variable is used to determine if the variable exists.

  PROCEDURE create_test_tool_var#
    (    variable_name: string ( * );
     VAR variable_ref: clt$variable_reference;
     VAR already_exists: boolean);

    VAR
      length: integer,
      local_status: ost$status,
      var_scope: clt$variable_scope;

    clp$read_variable (variable_name, variable_ref, local_status);
    IF local_status.condition = cle$unknown_variable THEN

{ variable not created yet

      already_exists := FALSE;
      var_scope.kind := clc$job_variable;
      clp$create_variable (variable_name, clc$string_value,
            osc$max_string_size, 1, 1, var_scope, variable_ref, local_status);
      IF NOT local_status.normal THEN
        IF local_status.condition = cle$var_already_created THEN
          already_exists := TRUE;
          var_scope.kind := clc$xref_variable;
          clp$create_variable (variable_name, clc$string_value,
                osc$max_string_size, 1, 1, var_scope, variable_ref,
                local_status);
          IF NOT local_status.normal THEN
            pmp$exit (local_status);
          IFEND;
          clp$read_variable (variable_name, variable_ref, local_status);
          IF NOT local_status.normal THEN
            pmp$exit (local_status);
          IFEND;
        ELSE
          pmp$exit (local_status);
        IFEND;
      IFEND;
    ELSE
      already_exists := TRUE;
    IFEND;

  PROCEND create_test_tool_var#;

{ PURPOSE:
{   This procedure writes the value of variable_string to the SCL variable
{   identified by variable_name.
{ DESIGN:
{   Variable_ref contains the reference to the
{   SCL variable.  #UNCHECKED_CONVERSION is used because the string field of
{   CLT$VARIABLE_REFERENCE is an array of cells, this means that type checking
{   can not be performed when copying the string to the variable reference
{   field.

  PROCEDURE write_test_tool_str_var#
    (    variable_name: string ( * );
     VAR variable_ref: clt$variable_reference;
         variable_string: ost$string);

    VAR
      length: integer,
      local_status: ost$status,
      string_var_cell_array: ^array [1 .. * ] of cell;

    PUSH string_var_cell_array: [1 .. #SIZE (variable_string)];
    #UNCHECKED_CONVERSION (variable_string, string_var_cell_array^);
    variable_ref.value.string_value := string_var_cell_array;
    clp$write_variable (variable_name, variable_ref.value, local_status);
    IF NOT local_status.normal THEN
      pmp$exit (local_status);
    IFEND;

  PROCEND write_test_tool_str_var#;

{ PURPOSE:
{ Insure that the intended testing family_name will be used.
{ DESIGN:
{ The family_name found on the USE_CATALOG parameter will be substitued for
{ the one found in the file_string.

  PROCEDURE substitute_use_catalog_fam#
    (    test_tool_family: string ( * );
     VAR file_string: ost$string);

    VAR
      def_family_name_length: integer,
      identification: ost$user_identification,
      length: integer,
      local_status: ost$status,
      temp_string: ost$string;

    pmp$get_user_identification (identification, local_status);

{ Returns default family

    def_family_name_length := strlen# (identification.family) + 2;
    temp_string.value := '';

{ Overwrite file_ref family with test_tool family

    STRINGREP (temp_string.value, length,
          test_tool_family (1, strlen# (test_tool_family)),
          file_string.value (def_family_name_length, file_string.size));
    temp_string.size := length;
    file_string := temp_string;

  PROCEND substitute_use_catalog_fam#;

{ PURPOSE:
{ This procedure makes sure that a given library has the correct attributes
{ DESIGN:
{ The values of all variables are checked to verify that the libraries
{ and files which will be used exist and are of the proper type.  If
{ abnormalities exist, the user is notified.

  PROCEDURE check_library_validity#
    (    library_name: string ( * );
         library_variable: fst$parsed_file_reference;
         library_type: string ( * );
     VAR library_valid: boolean);

    VAR
      contains_data: boolean,
      file_attributes: ^amt$get_attributes,
      length: integer,
      lib_contents: ost$name,
      lib_processor: ost$name,
      lib_structure: ost$name,
      local_file: boolean,
      local_status: ost$status,
      message: string_line,
      perm_file: boolean;

    PUSH file_attributes: [1 .. 4];
    file_attributes^ [1].key := amc$file_length;
    file_attributes^ [2].key := amc$file_contents;
    file_attributes^ [3].key := amc$file_processor;
    file_attributes^ [4].key := amc$file_structure;

    IF library_type = 'OBJECT' THEN
      lib_contents := 'OBJECT';
      lib_processor := 'UNKNOWN';
      lib_structure := 'LIBRARY';
    ELSE

{ library_type = 'SOURCE'

      lib_contents := 'LEGIBLE';
      lib_processor := 'SCU';
      lib_structure := 'LIBRARY';
    IFEND;

    library_valid := TRUE;
    amp$get_file_attributes (library_variable.path, file_attributes^,
         local_file, perm_file, contains_data, local_status);
    IF NOT local_status.normal THEN
      pmp$exit (local_status);
    IFEND;
    message := '';
    IF file_attributes^ [1].file_length = 0 THEN
      library_valid := FALSE;
      STRINGREP (message, length, ' --WARNING:  Library specified for ',
            library_name (5, strlen# (library_name)), ' is empty.');
      output_message# (message);
      exit_message := message;
ELSEIF (file_attributes^ [2].file_contents <> lib_contents) OR
          (file_attributes^ [3].file_processor <> lib_processor) OR
          (file_attributes^ [4].file_structure <> lib_structure) THEN
      library_valid := FALSE;
      STRINGREP (message, length, ' --WARNING:   Library specified for ',
            library_name (5, strlen# (library_name)), ' is not an ',
            library_type (1, strlen# (library_type)), ' library.');
      output_message# (message);
      exit_message := message;
    IFEND;
  PROCEND check_library_validity#;


{ PURPOSE:
{ Process and save the parameter list of create_test_environment.
{ DESIGN:
{ For each parameter, create the appropriate TTV$ job variable and assign
{ the appropriate value. For file type parameters call PROCESS_FILE_PARAMETER#
{ to check that the attributes of the file match the intended application.
{ Finally put the parameter list in the job variable ttv$crete_param_list.
{ NOTE:
{ The first parameter must be use_catalog as the other parameter values are
{ dependent on its value, and since we process the parameter list from
{ beginning to end.

  PROCEDURE process_crete_param_list#;

    VAR
      cmnd_list_candidate: boolean,
      length: integer,
      library_file: fst$parsed_file_reference,
      library_type: ost$string,
      library_valid : boolean,
      local_status: ost$status,
      log_status: ost$status,
      message: string_line,
      param_list: ost$string,
      parameter_index: integer,
      parameter_string: ost$string,
      parameter_value: clt$data_value,
      pdt_index: integer,
      pdt_name: clt$parameter_name,
      use_catalog :ost$string,
      var_exists: boolean,
      var_name : ost$name,
      var_reference: clt$variable_reference,
      variable_report: ost$string;

    param_list.value := '';
    param_list.size := 0;
    FOR parameter_index := 1 TO (p$status - 1) DO
      variable_report.value := '';
      pdt_index:=pdt.parameters [parameter_index].name_index;
      pdt_name:=pdt.names [pdt_index].name;
      var_name := '';
      STRINGREP (var_name, length, 'TTV$', pdt_name (1, strlen# (pdt_name)));
      create_test_tool_var# (var_name, var_reference, var_exists);
      IF pvt [parameter_index].value <> NIL THEN
        parameter_value := pvt [parameter_index].value^;
        parameter_string.value := '';
        parameter_string.size := 0;
        CASE parameter_value.kind OF
        = clc$keyword =
          parameter_string.value := parameter_value.keyword_value;
          parameter_string.size := strlen# (parameter_value.keyword_value);
        = clc$string =
          parameter_string.value := parameter_value.string_value^;
          parameter_string.size := strlen# (parameter_value.string_value^);
        = clc$name =
          parameter_string.value := parameter_value.name_value;
          parameter_string.size := strlen# (parameter_string.value);
        = clc$file =
          clp$convert_string_to_file_ref (parameter_value.file_value^,
              library_file, local_status);
          IF NOT local_status.normal THEN
            pmp$exit (local_status);
          IFEND;
          parameter_string.value := library_file.path;
          parameter_string.size := strlen# (parameter_string.value);
          IF var_name = 'TTV$USE_CATALOG' THEN
            use_catalog := parameter_string;
          ELSEIF (NOT pvt [parameter_index].specified) AND
                 (NOT (var_name = 'TTV$RESULTS_FILE')) THEN
            substitute_use_catalog_fam# (use_catalog.value, parameter_string);
            library_file.path := parameter_string.value;
          IFEND;
          library_valid:=FALSE;
          cmnd_list_candidate := FALSE;
          library_type.value :='UNKNOWN';
          process_file_type#(var_name, library_type.value,
              cmnd_list_candidate);
          IF library_type.value = 'UNKNOWN' THEN
            process_stndrd_files# (var_name, parameter_string, library_file);
          ELSE
            check_library_validity#(var_name, library_file,
                library_type.value, library_valid);
            IF library_valid THEN
              IF (library_type.value= 'OBJECT') AND (cmnd_list_candidate) THEN
                add_file_to_cmnd_list#(var_name, parameter_string,
                    library_file);
              IFEND;
            ELSE      { IF not library_valid
              parameter_string.value := 'INVALID_LIBRARY';
              parameter_string.size := strlen# (parameter_string.value);
              message := '';
              STRINGREP (message, length, ' --WARNING:  ',
                  pdt_name (1, strlen# (pdt_name)),
                  ' reset to INVALID_LIBRARY.');
              pmp$log (message (1, strlen# (message)), log_status);
              exit_message := message;
            IFEND;
          IFEND;
        CASEND;
        write_test_tool_str_var# (var_name, var_reference,
            parameter_string);
        STRINGREP (variable_report.value, length, ' = ', parameter_string.value
            (1, parameter_string.size));
        output_var_to_log# (var_name, variable_report.value (1,length));

        IF (pvt [parameter_index].specified) THEN
          STRINGREP (param_list.value, length, param_list.
              value (1, strlen# (param_list.value) + 1),
              pdt_name (1, strlen# (pdt_name)), '=', parameter_string.value
              (1, parameter_string.size), ' ');
          param_list.size := length;
        IFEND;
      IFEND;
    FOREND;
    write_test_tool_str_var# ('TTV$CRETE_PARAM_LIST', var_reference,
          param_list);
    output_var_to_log# ('ttv$crete_param_list = ', param_list.
          value (1, param_list.size));
  PROCEND process_crete_param_list#;

{ PURPOSE:
{ Process results, log and other non-library parameters.
{ DESIGN:
{ Any file needing special attention will be handled here: The RESULTS_FILE
{ needs to ensure a permanent file path was specified and the LOG_FILE needs
{ to be opened to allow failing tests to write to it.

  PROCEDURE process_stndrd_files#
    (    parameter_name: ost$name;
         parameter_value: ost$string;
         library_file: fst$parsed_file_reference);

    VAR
      command_line :string_line,
      echo :boolean,
      first_name : fst$path_element_substring,
      length : integer,
      local_status : ost$status,
      log_option_attachment_options: array [1 .. 1] of fst$attachment_option,
      log_option_file_identifier: amt$file_identifier,
      log_status : ost$status;

    IF parameter_name = 'TTV$RESULTS_FILE' THEN
      command_line := '';
      STRINGREP (command_line, length, 'DISPLAY_CATALOG_ENTRY F=',
          parameter_value.value (1, parameter_value.size), ' O=$NULL');
      echo := FALSE;
      clp$include_command (command_line, echo, log_status);
      IF (NOT log_status.normal) THEN
        IF (log_status.condition <>pfe$unknown_permanent_file) THEN
          exit_message := ' --ERROR:  The RESULTS_FILE parameter must be' CAT
              ' a valid permanent file path.';
          output_message# (exit_message);
          pmp$log (exit_message (1, strlen# (exit_message)), local_status);
          exit_message := '          CRETE Used Display_Catalog_Entry to' CAT
              ' certify the parameter.';
          output_message# (exit_message);
          pmp$log (exit_message (1, strlen# (exit_message)), local_status);
          exit_message := '          The following status was returned:';
          output_message# (exit_message);
          pmp$log (exit_message (1, strlen# (exit_message)), local_status);
          pmp$exit (log_status);
        IFEND;
      IFEND;
    ELSEIF parameter_name = 'TTV$LOG_OPTION' THEN
      IF parameter_value.value <> 'PRINTER' THEN

{ Create a log file used for failed tests.

        log_option_attachment_options [1].selector :=
             fsc$access_and_share_modes;
        log_option_attachment_options [1].access_modes.selector :=
             fsc$specific_access_modes;
        log_option_attachment_options [1].access_modes.value :=
             $fst$file_access_options [fsc$append];
        log_option_attachment_options [1].share_modes.selector :=
             fsc$specific_share_modes;
        log_option_attachment_options [1].share_modes.value :=
             $fst$file_access_options [];
        fsp$open_file (parameter_value.value, amc$record,
             ^log_option_attachment_options, NIL, NIL, NIL, NIL,
             log_option_file_identifier, local_status);
        IF NOT local_status.normal THEN
          IF local_status.condition <> pfe$cycle_busy THEN
            pmp$exit (local_status);
          IFEND;
        ELSE
          fsp$close_file (log_option_file_identifier, local_status);
          IF NOT local_status.normal THEN
            pmp$exit (local_status);
          IFEND;
        IFEND;
      IFEND;
    IFEND;
  PROCEND process_stndrd_files#;

{ PURPOSE:
{ Libraries needed for the test environment are added to the command list.g
{ DESIGN:
{ The library specified will be added to the command list. If it is the tool
{ library it will be added to the top of the command list else it will be
{ placed at the bottom of the command list.

 PROCEDURE add_file_to_cmnd_list#
    (    parameter_name: ost$name;
         parameter_value: ost$string;
         library_file: fst$parsed_file_reference);

  VAR
    command_line: string_line,
    command_list_file : clt$command_list_entry_file,
    echo : boolean,
    element_ptr : ^clt$data_value,
    length : integer,
    link_ptr : ^clt$data_value,
    local_status : ost$status,
    log_status: ost$status,
    message: string_line,
    next_value : clt$data_value,
    next_ptr : clt$data_value,
    prev_ptr : ^clt$data_value,
    var_value : ^clt$data_value;

    command_list_file.kind := clc$command_list_entry_path;
    command_list_file.path := ^library_file.path;
{ Add libraries to the end of the command list except the tool_library.

    IF parameter_name <> 'TTV$TOOL_LIBRARY' THEN
      clp$add_file_to_command_list (command_list_file, TRUE, local_status);
    ELSE
      clp$add_file_to_command_list (command_list_file, FALSE, local_status);
    IFEND;
    IF local_status.normal THEN
       clp$get_variable_value ('TTV$LIBRARIES_ADDED', var_value, local_status);
       IF NOT local_status.normal THEN
         pmp$exit(local_status);
       IFEND;
       next_value.kind := clc$string;
       next_value.string_value := ^parameter_value.value;
       next_ptr.kind := clc$list;
       next_ptr.element_value := ^next_value;
       next_ptr.link := NIL;
       link_ptr := var_value^.link;
       prev_ptr := var_value;
       element_ptr :=var_value^.element_value;
       IF element_ptr = NIL THEN
         var_value:= ^next_ptr;
       ELSE
        While (link_ptr <> NIL) DO
           element_ptr :=link_ptr^.element_value;
           prev_ptr := link_ptr;
           link_ptr :=link_ptr^.link;
         Whilend;
         prev_ptr^.link:= ^next_ptr;
       IFEND;
       clp$change_variable('TTV$LIBRARIES_ADDED',var_value, local_status);

    ELSEIF local_status.condition <> cle$duplicate_command_list_ent THEN
      message := '';
      STRINGREP (message, length,
          ' ## Create_test_environment unable to crecle e=',
          parameter_value.value (1, strlen# (parameter_value.value)));
      output_message# (message);
      exit_message := message;
      command_line := '';
      echo := FALSE;
      STRINGREP (command_line, length, 'display_value $condition(',
           local_status.condition, ')  o=$job_log');
      clp$include_command (command_line, echo, log_status);
      command_line := '';
      STRINGREP (command_line, length, 'display_value $condition(',
           local_status.condition, ')  O=$output');
      clp$include_command (command_line, echo, log_status);
      message := '';
      message := ' --WARNING:  Create_test_environment continuing ...';
      output_message# (message);
    IFEND;
    IF parameter_name = 'TTV$TOOL_LIBRARY' THEN
      command_line := '';
      STRINGREP (command_line, length, 'SET_PROGRAM_ATTRIBUTES AL=',
          parameter_value.value (1, strlen# (parameter_value.value)));
      echo := FALSE;
      clp$include_command (command_line, echo, local_status);
    IFEND;
  PROCEND add_file_to_cmnd_list#;

{ PURPOSE:
{ Process each File Type Parameter to record what type of additional processing
{ CRETE should do to add libraries to the command list or to set the values of
{ results and log type files.
{ DESIGN:
{ Each file will fall into one of four categories - Source, Binary(add to cmnd
{ list), Binary(do not add to cmnd list) and Unknown.  The parameter name will
{ determine the file type since standards were defined where any "data" file
{ is a SOURCE library, any "procedures" file is an OBJECT file and will be
{ added by crete to the command list, any "binary" file is an OBJECT fil that
{ will not be added to the command list, and any other file is an UNKNOWN file
{ to be used for logs and results_files.

  PROCEDURE process_file_type#
    (    parameter_name: ost$name;
         VAR library_type : string (*);
         VAR cmnd_list_candidate: boolean);

    VAR
      binary_key : ost$string,
      data_key : ost$string,
      I : integer,
      length: integer,
      local_status: ost$status,
      param_var: ost$string,
      procedure_key :ost$string;

    procedure_key.value :='_TEST_PROCEDURES';
    procedure_key.size :=16;
    binary_key.value :='_TEST_BINARY';
    binary_key.size := 12;
    data_key.value :='_TEST_DATA';
    data_key.size := 10;
    param_var.value := parameter_name;
    param_var.size := Strlen#(parameter_name);

    FOR I := 1 TO (param_var.size+1-procedure_key.size) DO
      IF param_var.value(i,procedure_key.size) = procedure_key.value(1,*) THEN
        library_type:= 'OBJECT ';
        cmnd_list_candidate := TRUE;
      IFEND;
    FOREND;
    IF library_type = 'UNKNOWN' THEN
      FOR I := 1 TO (param_var.size+1-binary_key.size) DO
        IF param_var.value(i,binary_key.size) = binary_key.value(1,*) THEN
          library_type:= 'OBJECT ';
          cmnd_list_candidate := FALSE;
        IFEND;
      FOREND;
    IFEND;
    IF library_type = 'UNKNOWN' THEN
      FOR I := 1 TO (param_var.size+1-data_key.size) DO
        IF param_var.value(i,data_key.size) = data_key.value(1,*) THEN
          library_type:= 'SOURCE ';
          cmnd_list_candidate := FALSE;
        IFEND;
      FOREND;
    IFEND;
    IF (library_type='UNKNOWN') THEN
      IF (param_var.value='TTV$TOOL_LIBRARY') THEN
         library_type:= 'OBJECT ';
         cmnd_list_candidate := TRUE;
      ELSEIF (param_var.value='TTV$TEST_DEVELOPMENT_LIBRARY') THEN
         library_type:= 'OBJECT ';
         cmnd_list_candidate := FALSE;
      IFEND;
    IFEND;
  PROCEND process_file_type#;

{ PURPOSE:
{ Remove command list entries added by previous calls to CRETE.
{ DESIGN:
{ On subsequent calls to CRETE, to remove specified test and test_tool
{ libraries from the command list, check the TTV$LIBRARIES_ADDED variable
{ to determine if CRETE was responsible for adding the library before
{ allowing CRETE to remove the library.

  PROCEDURE  remove_added_cmd_list_entries#;

    VAR
      command_list_file : clt$command_list_entry_file,
      command_line : string_line,
      echo : boolean,
      init_var_value: clt$data_value,
      library_file: fst$parsed_file_reference,
      list_element_ptr: ^clt$data_value,
      list_link_ptr: ^clt$data_value,
      list_type_spec: [STATIC, READ, cls$declaration_section] record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend := [[1, 0, clc$list_type], [8, 0, clc$max_list_size, FALSE],
        [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]]],
      local_status: ost$status,
      string_var: ost$string,
      variable_exists: boolean,
      variable_name : string (19),
      var_value: ^clt$data_value;

{ Create SCL LIST type variable TTV$LIBRARIES_ADDED to monitor additions and
{ deletions of tool and test libraries on subsequent calls to CRETE and on
{ calls to delete_test_environment.

    variable_name:= 'TTV$LIBRARIES_ADDED';
    var_value := NIL;
    clp$get_variable_value (variable_name, var_value, local_status);
    IF local_status.condition = cle$unknown_variable THEN

{ variable not created yet, so set its initial value and create the variable.

      variable_exists := FALSE;
      init_var_value.kind := clc$list;
      init_var_value.element_value := NIL;
      init_var_value.link := NIL;
      clp$create_environment_variable (variable_name, clc$job_scope,
          clc$read_write, clc$immediate_evaluation, #SEQ(list_type_spec),
          ^init_var_value, local_status);
      IF NOT local_status.normal THEN
        IF local_status.condition = cle$var_already_created THEN
          variable_exists := TRUE;
          clp$create_procedure_variable (variable_name, clc$xref_scope,
              clc$read_write, clc$immediate_evaluation, #SEQ(list_type_spec),
              var_value, local_status);
          IF NOT local_status.normal THEN
            pmp$exit (local_status);
          IFEND;
          clp$get_variable_value (variable_name, var_value, local_status);
          IF NOT local_status.normal THEN
            pmp$exit (local_status);
          IFEND;
        ELSE
          pmp$exit (local_status);
        IFEND;
      IFEND;
    ELSE
      variable_exists := TRUE;
    IFEND;

{ If the libraries_added variable exists and it contains a valid entry
{ then delete the recorded entries from the command list.

    IF (variable_exists = TRUE) AND (var_value^.element_value <> NIL) THEN
        list_link_ptr := var_value;
        list_element_ptr := var_value;
      WHILE (list_link_ptr <> NIL) DO
        list_link_ptr := list_element_ptr^.link;
        string_var.value := list_element_ptr^.element_value^.string_value^;
        clp$convert_string_to_file_ref (string_var.value, library_file,
              local_status);
        IF NOT local_status.normal THEN
            pmp$exit (local_status);
        IFEND;
        command_list_file.kind := clc$command_list_entry_path;
        command_list_file.path := ^library_file.path;
        clp$delete_file_from_cmnd_list (command_list_file, local_status);
        command_line := '';
        STRINGREP (command_line, length, 'SET_PROGRAM_ATTRIBUTES DL=',
            string_var.value (1, strlen# (string_var.value)));
        echo := FALSE;
        clp$include_command (command_line, echo, local_status);
        IF (list_link_ptr <> NIL) THEN
          list_element_ptr := list_link_ptr;
        IFEND;
      WHILEND;
      var_value^.element_value := NIL;
      var_value^.link := NIL;
      clp$change_variable('TTV$LIBRARIES_ADDED',var_value, local_status);
    IFEND;
  PROCEND remove_added_cmd_list_entries#;

{ PURPOSE :
{   Creates an environment for NOS/VE feature/ regression tests.
{ DESIGN:
{   Remove all command list entries added by previous calls to CRETE.  Then
{   process each parameter from beginning to end (with the requirement that
{   the USE_CATALOG parameter is first). The value of all tool, procedure,
{   binary, or data files is created by prefixing the value of the use_catalog
{   parameter with the value of each of the other default (tool, procedure,
{   binary, and data) parameters.  No prefix is added to a user specified
{   parameter. Job scope variables are created, libraries are put on the
{   command list and logged to the job log.  $LOCAL will also be added to the
{   command list if it not already there, and the addition will be logged for
{   future deletion by a call to Delete_test_environment.

  PROGRAM [XDCL] ttp$create_test_environment
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

    VAR
      catalog_reference: clt$file_reference,
      library_file: fst$parsed_file_reference,
      local_var : ost$string,
      local_status: ost$status,
      log_status: ost$status,
      param_val_string: ost$string,
      parameter_value: clt$data_value,
      path: ^pft$path,
      pc: clt$path_container,
      var_exists: boolean,
      var_name: ost$name,
      var_reference: clt$variable_reference;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt,
          local_status);
    IF NOT local_status.normal THEN
      pmp$exit (local_status);
    IFEND;
    exit_message := '';

{ Remove previous CRETE additions to the Command_List.

    remove_added_cmd_list_entries#;

{ Create an SCL variable in which to save the parameter list.

    create_test_tool_var# ('TTV$CRETE_PARAM_LIST', var_reference, var_exists);

{ Process each parameter and save the specified parameter list

    process_crete_param_list#;

{ Verify the working catalog is $LOCAL.

    clp$get_working_catalog (catalog_reference, pc, path, local_status);
    IF catalog_reference.path_name <> ':$LOCAL' THEN
      clp$set_working_catalog ('$LOCAL', local_status);
      IF NOT local_status.normal THEN
        pmp$exit (local_status);
      IFEND;
      pmp$log (' --WARNING:  Working catalog is set to $local.', log_status);
      output_message# (' --WARNING:  Working catalog is set to $local.');
    IFEND;

{ $LOCAL is a required entry in the command list for the test environment
{ to be complete - add $local if it is not there and record the addition
{ for future removal of the test environment.

    local_var.value := '$LOCAL';
    local_var.size := strlen#(local_var.value);
    clp$convert_string_to_file_ref(local_var.value,library_file, local_status);
    IF NOT local_status.normal THEN
      pmp$exit (local_status);
    IFEND;
    var_name :='';
    add_file_to_cmnd_list#(var_name, local_var, library_file);

{ Set abnormal status if status was specified and exit_message <> ''.

    IF pvt [p$status].specified THEN
      IF exit_message <> '' THEN
        osp$set_status_abnormal ('TT', 15999, exit_message, status);
        pmp$log (exit_message, log_status);
        pmp$exit(status);
      IFEND;
    IFEND;

{ Affirm test environment for user if there were no abnormalities.

    IF exit_message = '' THEN
      output_message# (' -- INFORMATIVE -- Test environment available.');
    ELSE
      output_message# (
            ' --WARNING:  PROBLEMS CREATING TEST ENVIRONMENT: See job_log ');
      output_message# (
             '     or messages_received to assess impact on planned testing.');
      pmp$log (' --WARNING:  PROBLEMS CREATING TEST ENVIRONMENT: See job_log',
             log_status);
      pmp$log  ('    or messages received to assess impact on planned testing',
             log_status);
    IFEND;

  PROCEND ttp$create_test_environment;
MODEND ttm$create_test_environment;
