Skip to content

WUnit Wollok Unit Testing

Fernando Dodino edited this page Aug 31, 2019 · 11 revisions

The whole flow of testing begins when a user requests a .wtest file to be tested:

Tests

First part: launching tests

Wollok_Testing_Launch

Before Wollok Launcher starts, we need to setup some things: WollokLauncherParameters object has

  • a tests flag pointing to true value
  • and a testPort number (WollokTestLaunchDelegate sets testPort to WollokContextStateNotifier.listeningPort, from the UI-VM)

WollokLauncherModule has sets the test reporter to the corresponding one:

  • WollokRemoteTestNotifier if launcher was run from Wollok IDE
  • WollokConsoleTestsReporter if launcher was run from wollok-cli

Second part: Wollok Launcher

Wollok Launcher calls Wollok Interpreter which in turn calls to the WollokInterpreterEvaluator | WollokLauncherInterpreterEvaluator.

WollokInterpreterEvaluator delegates to several dispatch methods, but one of them is the main for tests/suites: WollokLauncherInterpreterEvaluator.evaluate(WFile). If you need to change the way tests are evaluated, this is the right place. Take a look into SuiteBuilder class.

Clone this wiki locally