TESTING TCL PROC

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf TESTING TCL PROC

  • Creator
    Topic
  • #52780
    mike brown
    Participant

      Hi All

      I am drawing a blank on this, I want to run my TCL code without executing it to look for errors in the actual code. Does anyone know the command from the prompt I can use to accomplish this.

      thanks for your help.

      thanks Mike

    Viewing 4 reply threads
    • Author
      Replies
      • #75448
        Terry Kellum
        Participant

          tclsh will give you a TCL shell.  You can use that for simple concepts.

          The GUI has some great testers.  You can also edit your procs using Komodo Edit on your Window$ box to catch obvious bracket errors and such.

        • #75449
          Terry Kellum
          Participant

            Perhaps you mean hcitpstest :

            hcitpstest

            Tests user-created Tcl scripts in various contexts.

            Input: hcitpstest [-a] [-c ] [-e “proc args”]

            [-f ] [-i ] [-L] [-m ]

            [-r ] [-S] [-s ] []

            [“proc1 args1″…”procN argsN”]

            Where:

            ■-a processes all records in the file.

            ■-c specifies caller context name:

            ■ack_control

            ■fileset_ibdel

            ■fileset_ibdirparse

            ■pdupoc_read

            ■pdupoc_write

            ■prewrite

            ■proto_startup

            ■proto_startup_sendfail

            ■proto_startup_sendok

            ■reply_gen

            ■send_data_fail

            ■send_data_ok

            ■send_reply_fail

            ■send_reply_ok

            ■sms_fwd_data

            ■sms_fwd_reply

            ■sms_ib_data

            ■sms_ib_reply

            ■sms_ob_data

            ■sms_ob_reply

            ■xlt_gen

            ■xlt_post

            ■xlt_pre

            ■xlt_raw

            ■httpc_query

            Note:    For an explanation of the context names, see the “Interfaces” subsection of the “User Points of Control” section in Configuration.

            ■-e “proc args” specifies to end processing configuration.

            ■-f specifies the format type:

            ■-f len10 specifies 10-byte length-encoded.

            ■-f nl specifies newline terminated (the default).

            ■-f eof specifies end-of-file terminated.

            ■-i specifies the delay interval (time mode).

            ■-L specifies Tcl handle leak detection.

            ■-m specifies the maximum message count (time mode).

            ■-r specifies the run mode:

            ■-r run specifies normal run mode.

            ■-r start specifies startup mode.

            ■-r time specifies time-based mode.

            ■-r shutdown specifies shutdown mode.

            ■-S specifies to run message-less startup.

            ■-s specifies Save File basename.

            ■ specifies the data file with which to test (run mode).

            ■procN argsN specifies TPS module procs and args.

            Note:   If specifying a file location for test output, you must use either the

            “/” as the file delimiter (all platforms) or begin the file path with a “\” (Windows).

          • #75450
            mike brown
            Participant

              Great answers and i am looking for a command line “command” that executes the proc with actual running, checking for any abnormal lines of code..

              something in the neighborhood of

              exec -xn “tclname”

              i am not sure…

              thanks Mike

            • #75451
              David Barr
              Participant

                If it’s a TPS proc, you could just run it from the command line with an unknown mode:

                Code:

                live2% tcl
                tcl>tps_starpmmadt { MODE foo }
                Error: Unknown mode ‘foo’ in tps_starpmmadt
                tcl>

                If you get a message about “unknown mode”, you know that the proc runs. I would think that you’d get a different error if there were syntax errors.

              • #75452
                Robert Kersemakers
                Participant

                  I don’t think that last part is correct. I have made several tcls where I only got an error when the program passed through certain lines of the code. So if you get ‘unknown mode’ it only guarantees that this part of the code is (syntactically) correct.

                  Someone please correct me if I’m wrong!

                  Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

              Viewing 4 reply threads
              • The forum ‘Cloverleaf’ is closed to new topics and replies.