Блог пользователя Nada

Автор Nada, 10 лет назад, По-английски

How to Generate Test Cases Using Polygon

Step 1:

Download testlib

You will have 4 folders and 1 file, one folder is "Generator", it will contain 6 cpp files, each file generates a different kind of input, if you open any file you will know what kind of input it generates.

Step 2:

On polygon, after you finish writing your problem, click on "Files" at the upper bar. at Resource files, click "Add File", select the file "testlib.h" from your hard disk and click "Add".

Step 3:

Then, at Source files, click "Add File", and you should select the suitable cpp file for your problem from the folder "Generators" on your hard disk, and click "Add".

Now you are ready to generate your test cases.

Step 4:

Select "Tests" from the upper bar, you will find an empty text box written upon it "Script". in this text box you will call your generator with different parameters to generate different values.

Example: if you are using "sgen", then your script will be like this:

sgen 1 > $

sgen 2 > $

sgen 5 > $

sgen 8 > $

(Each dollar signs will be automatically replaced with the smallest available test index)

Step 5:

Save script and select "Invocations" from the upper bar, select "Want to run solutions?" to check for the generated test cases.

And you are done.

  • Проголосовать: нравится
  • +34
  • Проголосовать: не нравится

»
10 лет назад, # |
  Проголосовать: нравится -28 Проголосовать: не нравится

boooring

»
10 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I did this but at tests tab when i press "Check generators to be compilable" it says "No generators". what can i do?

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    in Source Files how to indicate that my source is a generator?

    • »
      »
      »
      10 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      Generators are cpp files that use testlib.h, make sure you added the header file for the testlib in the Resources files.

»
7 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

I am here for some really cool generators for non-self-crossing polygons. However, ...