From 4ed28f681fd9f88decf1b66e39ebe38feeb768bc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 23:00:55 +0100 Subject: [PATCH] Add a common tag for wxItemContainer-derived classes tests This makes it possible to run the tests for all controls implementing wxItemContainer interface by just passing "[item-container]" on the test command line. --- tests/controls/bitmapcomboboxtest.cpp | 8 ++------ tests/controls/checklistboxtest.cpp | 7 ++----- tests/controls/choicetest.cpp | 7 ++----- tests/controls/comboboxtest.cpp | 7 ++----- tests/controls/htmllboxtest.cpp | 7 ++----- tests/controls/listboxtest.cpp | 7 ++----- tests/controls/ownerdrawncomboboxtest.cpp | 8 ++------ tests/controls/rearrangelisttest.cpp | 7 ++----- 8 files changed, 16 insertions(+), 42 deletions(-) diff --git a/tests/controls/bitmapcomboboxtest.cpp b/tests/controls/bitmapcomboboxtest.cpp index 7ac6c112d5..0ae29e3457 100644 --- a/tests/controls/bitmapcomboboxtest.cpp +++ b/tests/controls/bitmapcomboboxtest.cpp @@ -77,12 +77,8 @@ private: wxDECLARE_NO_COPY_CLASS(BitmapComboBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( BitmapComboBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( BitmapComboBoxTestCase, - "BitmapComboBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(BitmapComboBoxTestCase, + "[BitmapComboBoxTestCase][item-container]"); void BitmapComboBoxTestCase::setUp() { diff --git a/tests/controls/checklistboxtest.cpp b/tests/controls/checklistboxtest.cpp index 27a33ccf54..1c22990298 100644 --- a/tests/controls/checklistboxtest.cpp +++ b/tests/controls/checklistboxtest.cpp @@ -46,11 +46,8 @@ private: wxDECLARE_NO_COPY_CLASS(CheckListBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( CheckListBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CheckListBoxTestCase, "CheckListBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(CheckListBoxTestCase, + "[CheckListBoxTestCase][item-container]"); void CheckListBoxTestCase::setUp() { diff --git a/tests/controls/choicetest.cpp b/tests/controls/choicetest.cpp index eacb0e88e6..f08cf515fe 100644 --- a/tests/controls/choicetest.cpp +++ b/tests/controls/choicetest.cpp @@ -45,11 +45,8 @@ private: wxDECLARE_NO_COPY_CLASS(ChoiceTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( ChoiceTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ChoiceTestCase, "ChoiceTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(ChoiceTestCase, + "[ChoiceTestCase][item-container]"); void ChoiceTestCase::setUp() { diff --git a/tests/controls/comboboxtest.cpp b/tests/controls/comboboxtest.cpp index 6bec622644..c72373321e 100644 --- a/tests/controls/comboboxtest.cpp +++ b/tests/controls/comboboxtest.cpp @@ -88,11 +88,8 @@ private: wxDECLARE_NO_COPY_CLASS(ComboBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( ComboBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ComboBoxTestCase, "ComboBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(ComboBoxTestCase, + "[ComboBoxTestCase][item-container]"); // ---------------------------------------------------------------------------- // test initialization diff --git a/tests/controls/htmllboxtest.cpp b/tests/controls/htmllboxtest.cpp index e9a675a971..28acba6830 100644 --- a/tests/controls/htmllboxtest.cpp +++ b/tests/controls/htmllboxtest.cpp @@ -43,11 +43,8 @@ private: wxDECLARE_NO_COPY_CLASS(HtmlListBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( HtmlListBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlListBoxTestCase, "HtmlListBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(HtmlListBoxTestCase, + "[HtmlListBoxTestCase][item-container]"); void HtmlListBoxTestCase::setUp() { diff --git a/tests/controls/listboxtest.cpp b/tests/controls/listboxtest.cpp index f7e37a375d..2f89a76a50 100644 --- a/tests/controls/listboxtest.cpp +++ b/tests/controls/listboxtest.cpp @@ -68,11 +68,8 @@ private: wxDECLARE_NO_COPY_CLASS(ListBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( ListBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ListBoxTestCase, "ListBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(ListBoxTestCase, + "[ListBoxTestCase][item-container]"); //initialise the static variable bool ListBoxTestCase::ms_ownerdrawn = false; diff --git a/tests/controls/ownerdrawncomboboxtest.cpp b/tests/controls/ownerdrawncomboboxtest.cpp index abeb7a90a1..ffba96a4dc 100644 --- a/tests/controls/ownerdrawncomboboxtest.cpp +++ b/tests/controls/ownerdrawncomboboxtest.cpp @@ -75,12 +75,8 @@ private: wxDECLARE_NO_COPY_CLASS(OwnerDrawnComboBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( OwnerDrawnComboBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( OwnerDrawnComboBoxTestCase, - "OwnerDrawnComboBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(OwnerDrawnComboBoxTestCase, + "[OwnerDrawnComboBoxTestCase][item-container]"); // ---------------------------------------------------------------------------- // test initialization diff --git a/tests/controls/rearrangelisttest.cpp b/tests/controls/rearrangelisttest.cpp index ec83a40f66..e7f6038502 100644 --- a/tests/controls/rearrangelisttest.cpp +++ b/tests/controls/rearrangelisttest.cpp @@ -46,11 +46,8 @@ private: wxDECLARE_NO_COPY_CLASS(RearrangeListTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( RearrangeListTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( RearrangeListTestCase, "RearrangeListTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(RearrangeListTestCase, + "[RearrangeListTestCase][item-container]"); void RearrangeListTestCase::setUp() {