lib/popcorn: add `test_path` shortcut in pop_tests
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 17 May 2017 13:49:33 +0000 (09:49 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 17 May 2017 13:49:46 +0000 (09:49 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/popcorn/pop_tests.nit

index 1deaeab..6c5985d 100644 (file)
@@ -131,6 +131,11 @@ class TestPopcorn
        # Port used to run App.
        var port: Int = test_port
 
+       # Directory of the current test suite
+       #
+       # Useful when your tested app need to load some external files.
+       var test_path: String = "NIT_TESTING_PATH".environ.dirname
+
        # Run the test suite on the App.
        fun run_test(app: App) do
                var server = new AppThread(host, port, app)