Quick Start: Check failure

Test introducing a failed check on a form title.

Before you begin
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.
    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. 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.