From patchwork Tue Jul 10 13:07:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D3899: run-tests: add missing life-cycle methods on the example custom test result From: phabricator X-Patchwork-Id: 32734 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 10 Jul 2018 13:07:00 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGf4a214300957: run-tests: add missing life-cycle methods on the example custom test result (authored by lothiraldan, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3899?vs=9490&id=9495 REVISION DETAIL https://phab.mercurial-scm.org/D3899 AFFECTED FILES tests/basic_test_result.py tests/test-run-tests.t CHANGE DETAILS To: lothiraldan, #hg-reviewers Cc: mercurial-devel diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -1252,8 +1252,10 @@ $ 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 + ON_END! Test reusability for third party tools ====================================== diff --git a/tests/basic_test_result.py b/tests/basic_test_result.py --- a/tests/basic_test_result.py +++ b/tests/basic_test_result.py @@ -1,4 +1,4 @@ -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