Quick Start: Check failure

Test introducing a failed check on a form title.

Before you begin

To complete this quick start, it is assumed that you have downloaded and installed the GGC package. If you need to perform this task, go to Install the GGC package.

You must have:
  • A complied price.42m application.
  • A generated guilog named price_sample.guilog.
If you need either of these files, complete the steps in Quick Start: Generate and execute a test scenario.
About this quick start

In this quick start, you are simulating a typical development situation, where the development team have changed the title of a form. This will be trapped in your GGC test.

Steps

  1. Start the Genero Desktop Client.
    For OS-specific instructions on starting the Genero Desktop Client, see the Genero Desktop Client User Guide.
    The Genero Desktop Client launches and you see the monitor screen.
  2. Generate a test scenario from the GUI log.
    cd ${GGCDIR}/src/quick-start
    ggcgen bdl --check-form price_sample.guilog

    In this example the ggcgen bdl command is run with the --check-form option just to check the form title.

    The file price_sample.4gl is the created test scenario.

  3. Modify the form name check.
    Open the price_sample.4gl for editing. Change the form name check in the original code from "price" to "bad price". For example, in the original code you have:
    CALL ggc.assert(ggc.getFormName() == "price", SFMT("Form name is not valid, expected: 'price', got: '%1'", getFormName()))
    Update this with:
    CALL ggc.assert(ggc.getFormName() == "bad_price", SFMT("Form name is not valid, expected: 'bad price', got: '%1'", getFormName()))
  4. Compile the scenario.
    fglcomp price_sample.4gl
    The generated test scenario compiles and creates the application file price_sample.42m.
  5. Start the GGC server.
    Before you execute a test scenario, you must start the GGC server. To continue in the same terminal window, you must run the command in the background; alternatively, you can open another terminal to start the GGC server from.
    • UNIX® like OS:
      ggcadmin startbdlserver &
    • Windows®: Use "start /min" to have the command run in a new, minimized window:
      start /min ggcadmin startbdlserver
  6. Type the following command to run the test:
    fglrun price_sample tcp --command-line "fglrun price"

    Where the path to the test application (price_sample) and the application being tested (price) is the current working directory.

    The test runs, and the results display in the output.
    Figure: Output for check failure quick start


    The scenario is not marked as failed, but notice that there is a Check failures section, and that there you see "GGC-2" with the message describing the failure.

    Note:

    The output is intended as a sample to show test session statistics, the format may change in future product releases.