Skip to content
Snippets Groups Projects
Commit f4a21430 authored by Boris Feld's avatar Boris Feld
Browse files

run-tests: add missing life-cycle methods on the example custom test result

A previous commit introduced `onStart` and `onEnd` methods on test result but
the one used in tests lacked those two methods. Fix it and add some output to
be sure they are called.

Differential Revision: https://phab.mercurial-scm.org/D3899
parent 875e033f
Branches
Tags
No related merge requests found
from __future__ import print_function
from __future__ import absolute_import, print_function
import unittest
......@@ -39,6 +39,12 @@
def addIgnore(self, test, reason):
print("IGNORE!", test, reason)
def onStart(self, test):
print("ON_START!", test)
def onEnd(self):
print("ON_END!")
def addOutputMismatch(self, test, ret, got, expected):
return False
......
......@@ -1252,5 +1252,6 @@
$ CUSTOM_TEST_RESULT=basic_test_result $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" test-success.t test-failure.t
# Ran 2 tests, 0 skipped, 0 failed.
ON_START! <__main__.TestSuite tests=[<__main__.TTest testMethod=test-failure.t>, <__main__.TTest testMethod=test-success.t>]>
FAILURE! test-failure.t output changed
SUCCESS! test-success.t
......@@ -1255,5 +1256,6 @@
FAILURE! test-failure.t output changed
SUCCESS! test-success.t
ON_END!
Test reusability for third party tools
======================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment