Skip to content

5. Running and Test Output

Chesko edited this page Sep 13, 2016 · 5 revisions

Attaching Your Tests

To get your tests into the game, you have to create a new Quest that will have your test script attached to it.

  1. Create a new Quest in the Creation Kit. Give it a memorable name and press the OK button to close it.
  2. Re-open the quest and uncheck the Start Game Enabled and Run Once boxes.
  3. Go to the Scripts tab of the quest and add your Lilac test script to the quest. Remember to fill any required properties on the script after you add it.
  4. Finally, save your plug-in.

Closing and re-opening the Quest after naming it prevents a Creation Kit crash.

Running Your Tests

To run your tests, just start the quest that has your Lilac test script attached via the console:

startquest MyTestQuest

Test Results

Lilac prints the results of your tests to your Papyrus log. You must enable Papyrus logging to be able to see it.

When tests are passing, you will see SUCCESS next to each passed spec, along with a summary. The time next to each spec is how long it took to execute.

[05/14/2016 - 01:23:02PM] [Lilac] Starting Lilac 1.0 on [lilac_test <LilacTests (0A000D62)>]
[05/14/2016 - 01:23:02PM] [Lilac] Executed 1 SUCCESS (0.063000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 2 SUCCESS (0.015000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 3 SUCCESS (0.063000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 4 SUCCESS (0.015999 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 5 SUCCESS (0.015000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 6 SUCCESS (0.016001 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 7 SUCCESS (0.014999 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 8 SUCCESS (0.016001 secs)
[05/14/2016 - 01:23:02PM] [Lilac]   8 total  8 passed  0 failed

If a test fails, you will be given details of which specs failed and why. Apart from legibility of your test specs, this is why good descriptions in your suite describe and case it definitions are helpful. You will see an Expect #: value next to failing specs, which denotes which expectation in the spec has failed.

[05/14/2016 - 01:23:02PM] [Lilac] Starting Lilac 1.2 on [lilac_test <LilacTests (0A000D62)>]
[05/14/2016 - 01:23:02PM] [Lilac] Executed 1 SUCCESS (0.063000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 2 SUCCESS (0.015000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 3 SUCCESS (0.063000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 4 SUCCESS (0.015999 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 5 SUCCESS (0.015000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 6 SUCCESS (0.016001 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 7 (1 FAILED) failed (0.031000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Executed 8 (2 FAILED) failed (0.032000 secs)
[05/14/2016 - 01:23:02PM] [Lilac] Failed Tests (first 128 failed test steps shown):
[05/14/2016 - 01:23:02PM] [Lilac]  - Quest Tests:
[05/14/2016 - 01:23:02PM] [Lilac]     - should make sure quest stage is above 50:
[05/14/2016 - 01:23:02PM] [Lilac]         - Expect 1: expected 20 to be greater than 50
[05/14/2016 - 01:23:02PM] [Lilac]     - should verify all messages:
[05/14/2016 - 01:23:02PM] [Lilac]         - Expect 1: expected the caek is a lie to contain cake
[05/14/2016 - 01:23:02PM] [Lilac]   8 total  6 passed  2 failed

Clone this wiki locally