adding an iOS build to travis (#1847)
* fixing compilation of tests that cannot build bracket code with the corresponding wxUSE… macros * adding directive for iOS * adding a switch for skipping the run - not the build of tests right now I don’t know yet, how to run the test binary in the iOS simulator, but building it is still a good test in itself * adding skipping of tests * increasing minimum deployment to get proper c++17 support * using --disable-sys-libs, restoring other targets even when the zlib in -isysroot is used, due to deployment on lower iOS versions inflateValidate may not be available and crash. The guards are evaluated using macros from the zlib from the SDK, not from the lowest version supported.
This commit is contained in:
@@ -47,7 +47,7 @@ matrix:
|
||||
name: wxOSX Xcode 11.3
|
||||
- os: osx
|
||||
osx_image: xcode11.4
|
||||
env: wxCONFIGURE_FLAGS="--enable-monolithic --with-cxx=17 --host=i686-apple-darwin_sim --build=x86_64-apple-darwin17.7.0 --with-osx_iphone --with-macosx-version-min=9.0 --with-macosx-sdk=$(xcrun --sdk iphonesimulator --show-sdk-path) --enable-stl --with-libtiff=builtin" wxSKIP_GUI=1 wxSKIP_SAMPLES=1
|
||||
env: wxCONFIGURE_FLAGS="--enable-monolithic --with-cxx=17 --host=i686-apple-darwin_sim --build=x86_64-apple-darwin17.7.0 --with-osx_iphone --with-macosx-version-min=10.0 --with-macosx-sdk=$(xcrun --sdk iphonesimulator --show-sdk-path) --enable-stl --disable-sys-libs" wxSKIP_GUI=1 wxSKIP_TESTING=1 wxSKIP_SAMPLES=1
|
||||
name: wxOSX iOS Xcode 11.4
|
||||
- dist: bionic
|
||||
compiler: gcc
|
||||
|
@@ -73,6 +73,11 @@ case $wxTOOLSET in
|
||||
make -C tests $wxJOBS $wxMAKEFILE_FLAGS
|
||||
echo -en 'travis_fold:end:script.tests\\r'
|
||||
|
||||
if [ "$wxSKIP_TESTING" = 1 ]; then
|
||||
echo 'Skipping running tests'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo 'Testing...' && echo -en 'travis_fold:start:script.testing\\r'
|
||||
pushd tests && ./test && popd
|
||||
echo -en 'travis_fold:end:script.testing\\r'
|
||||
|
@@ -213,6 +213,7 @@
|
||||
#undef wxUSE_FINDREPLDLG
|
||||
#undef wxUSE_TASKBARICON
|
||||
#undef wxUSE_REARRANGECTRL
|
||||
#undef wxUSE_NATIVE_DATAVIEWCTRL
|
||||
|
||||
#define wxUSE_LOGWINDOW 0
|
||||
#define wxUSE_LOG_DIALOG 0
|
||||
@@ -235,6 +236,7 @@
|
||||
#define wxUSE_FINDREPLDLG 0
|
||||
#define wxUSE_TASKBARICON 0
|
||||
#define wxUSE_REARRANGECTRL 0
|
||||
#define wxUSE_NATIVE_DATAVIEWCTRL 0
|
||||
|
||||
#if wxUSE_WXHTML_HELP
|
||||
#undef wxUSE_WXHTML_HELP
|
||||
|
@@ -462,7 +462,13 @@ void ArchiveTestCase<ClassFactoryT>::runTest()
|
||||
if (m_archiver.empty())
|
||||
CreateArchive(out);
|
||||
else
|
||||
{
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
CreateArchive(out, m_archiver);
|
||||
#else
|
||||
CPPUNIT_FAIL("using external archivers is not supported on iOS");
|
||||
#endif
|
||||
}
|
||||
|
||||
// check archive could be created
|
||||
CPPUNIT_ASSERT(out.GetLength() > 0);
|
||||
@@ -489,7 +495,13 @@ void ArchiveTestCase<ClassFactoryT>::runTest()
|
||||
if (m_unarchiver.empty())
|
||||
ExtractArchive(in);
|
||||
else
|
||||
{
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
ExtractArchive(in, m_unarchiver);
|
||||
#else
|
||||
CPPUNIT_FAIL("using external archivers is not supported on iOS");
|
||||
#endif
|
||||
}
|
||||
|
||||
// check that all the test entries were found in the archive
|
||||
CPPUNIT_ASSERT(m_testEntries.empty());
|
||||
@@ -620,6 +632,7 @@ void ArchiveTestCase<ClassFactoryT>::CreateArchive(wxOutputStream& out)
|
||||
|
||||
// Create an archive using an external archive program
|
||||
//
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
template <class ClassFactoryT>
|
||||
void ArchiveTestCase<ClassFactoryT>::CreateArchive(wxOutputStream& out,
|
||||
const wxString& archiver)
|
||||
@@ -683,6 +696,7 @@ void ArchiveTestCase<ClassFactoryT>::CreateArchive(wxOutputStream& out,
|
||||
out.Write(in);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Do a standard set of modification on an archive, delete an entry,
|
||||
// rename an entry and add an entry
|
||||
@@ -864,6 +878,7 @@ void ArchiveTestCase<ClassFactoryT>::ExtractArchive(wxInputStream& in)
|
||||
|
||||
// Extract an archive using an external unarchive program
|
||||
//
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
template <class ClassFactoryT>
|
||||
void ArchiveTestCase<ClassFactoryT>::ExtractArchive(wxInputStream& in,
|
||||
const wxString& unarchiver)
|
||||
@@ -905,6 +920,7 @@ void ArchiveTestCase<ClassFactoryT>::ExtractArchive(wxInputStream& in,
|
||||
wxString dir = tmpdir.GetName();
|
||||
VerifyDir(dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Verifies the files produced by an external unarchiver are as expected
|
||||
//
|
||||
|
@@ -180,14 +180,18 @@ protected:
|
||||
|
||||
// 'archive up' the test data
|
||||
void CreateArchive(wxOutputStream& out);
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
void CreateArchive(wxOutputStream& out, const wxString& archiver);
|
||||
#endif
|
||||
|
||||
// perform various modifications on the archive
|
||||
void ModifyArchive(wxInputStream& in, wxOutputStream& out);
|
||||
|
||||
// extract the archive and verify its contents
|
||||
void ExtractArchive(wxInputStream& in);
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
void ExtractArchive(wxInputStream& in, const wxString& unarchiver);
|
||||
#endif
|
||||
void VerifyDir(wxString& path, size_t rootlen = 0);
|
||||
|
||||
// tests for the iterators
|
||||
|
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_AUI
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -128,3 +130,5 @@ TEST_CASE( "wxAuiNotebook::DoGetBestSize", "[aui]" )
|
||||
CHECK( nb->GetBestSize() == wxSize(250, 175 + 3*tabHeight) );
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_BOOKCTRL
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/panel.h"
|
||||
@@ -163,3 +165,5 @@ void BookCtrlBaseTestCase::Image()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(2, base->GetPageImage(2));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -34,7 +34,9 @@ private:
|
||||
#if !defined (__WXX11__)
|
||||
CPPUNIT_TEST( MessageDialog );
|
||||
#endif
|
||||
#if wxUSE_FILEDLG
|
||||
CPPUNIT_TEST( FileDialog );
|
||||
#endif
|
||||
CPPUNIT_TEST( CustomDialog );
|
||||
CPPUNIT_TEST( InitDialog );
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
@@ -60,13 +62,16 @@ void ModalDialogsTestCase::MessageDialog()
|
||||
wxTEST_DIALOG
|
||||
(
|
||||
rc = wxMessageBox("Should I fail?", "Question", wxYES|wxNO),
|
||||
wxExpectModal<wxMessageDialog>(wxNO),
|
||||
wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt").Optional()
|
||||
wxExpectModal<wxMessageDialog>(wxNO)
|
||||
#if wxUSE_FILEDLG
|
||||
,wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt").Optional()
|
||||
#endif
|
||||
);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(wxNO, rc);
|
||||
}
|
||||
|
||||
#if wxUSE_FILEDLG
|
||||
void ModalDialogsTestCase::FileDialog()
|
||||
{
|
||||
wxFileDialog dlg(NULL);
|
||||
@@ -89,7 +94,7 @@ void ModalDialogsTestCase::FileDialog()
|
||||
wxYield();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
class MyDialog : public wxDialog
|
||||
{
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -115,3 +117,5 @@ void ListViewTestCase::Focus()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, m_list->GetFocusedItem());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -8,6 +8,11 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_COLOURPICKERCTRL || \
|
||||
wxUSE_DIRPICKERCTRL || \
|
||||
wxUSE_FILEPICKERCTRL || \
|
||||
wxUSE_FONTPICKERCTRL
|
||||
|
||||
#include "wx/pickerbase.h"
|
||||
#include "pickerbasetest.h"
|
||||
|
||||
@@ -63,3 +68,5 @@ void PickerBaseTestCase::Controls()
|
||||
CPPUNIT_ASSERT(base->GetTextCtrl() != NULL);
|
||||
CPPUNIT_ASSERT(base->GetPickerCtrl() != NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -8,6 +8,11 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_COLOURPICKERCTRL || \
|
||||
wxUSE_DIRPICKERCTRL || \
|
||||
wxUSE_FILEPICKERCTRL || \
|
||||
wxUSE_FONTPICKERCTRL
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -215,3 +220,5 @@ void FontPickerCtrlTestCase::ColourSelection()
|
||||
m_font->GetSelectedColour(), selectedColour);
|
||||
}
|
||||
#endif //wxUSE_FONTPICKERCTRL
|
||||
|
||||
#endif
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#ifndef __WXOSX_IPHONE__
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -155,3 +157,5 @@ void RearrangeListTestCase::MoveClientData()
|
||||
CPPUNIT_ASSERT_EQUAL("third", m_rearrange->GetString(1));
|
||||
CPPUNIT_ASSERT_EQUAL("first", m_rearrange->GetString(2));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -220,3 +222,5 @@ void SpinCtrlDoubleTestCase::Digits()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(5, m_spin->GetDigits());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -127,6 +127,7 @@ TEST_CASE_METHOD(WindowTestCase, "Window::Mouse", "[window]")
|
||||
|
||||
CHECK(m_window->GetCursor().IsOk());
|
||||
|
||||
#if wxUSE_CARET
|
||||
//A plain window doesn't have a caret
|
||||
CHECK(!m_window->GetCaret());
|
||||
|
||||
@@ -134,6 +135,7 @@ TEST_CASE_METHOD(WindowTestCase, "Window::Mouse", "[window]")
|
||||
m_window->SetCaret(caret);
|
||||
|
||||
CHECK(m_window->GetCaret()->IsOk());
|
||||
#endif
|
||||
|
||||
m_window->CaptureMouse();
|
||||
|
||||
@@ -188,6 +190,7 @@ TEST_CASE_METHOD(WindowTestCase, "Window::ToolTip", "[window]")
|
||||
|
||||
TEST_CASE_METHOD(WindowTestCase, "Window::Help", "[window]")
|
||||
{
|
||||
#if wxUSE_HELP
|
||||
wxHelpProvider::Set(new wxSimpleHelpProvider());
|
||||
|
||||
CHECK( m_window->GetHelpText() == "" );
|
||||
@@ -195,6 +198,7 @@ TEST_CASE_METHOD(WindowTestCase, "Window::Help", "[window]")
|
||||
m_window->SetHelpText("helptext");
|
||||
|
||||
CHECK( m_window->GetHelpText() == "helptext" );
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(WindowTestCase, "Window::Parent", "[window]")
|
||||
|
@@ -248,7 +248,7 @@ private:
|
||||
CPPUNIT_TEST( ScrollWindowWithHandler );
|
||||
// for unknown reason, this test will cause the tests segmentation failed
|
||||
// under x11, disable it for now.
|
||||
#if !defined (__WXX11__)
|
||||
#if !defined (__WXX11__) && wxUSE_MENUS
|
||||
CPPUNIT_TEST( MenuEvent );
|
||||
#endif
|
||||
#if wxUSE_DOC_VIEW_ARCHITECTURE
|
||||
@@ -265,7 +265,9 @@ private:
|
||||
void ForwardEvent();
|
||||
void ScrollWindowWithoutHandler();
|
||||
void ScrollWindowWithHandler();
|
||||
#if wxUSE_MENUS
|
||||
void MenuEvent();
|
||||
#endif
|
||||
#if wxUSE_DOC_VIEW_ARCHITECTURE
|
||||
void DocView();
|
||||
#endif // wxUSE_DOC_VIEW_ARCHITECTURE
|
||||
@@ -429,6 +431,8 @@ void EventPropagationTestCase::ScrollWindowWithHandler()
|
||||
CPPUNIT_ASSERT_EQUAL( "apA", g_str );
|
||||
}
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
// Create a menu bar with a single menu containing wxID_APPLY menu item and
|
||||
// attach it to the specified frame.
|
||||
wxMenu* CreateTestMenu(wxFrame* frame)
|
||||
@@ -505,6 +509,7 @@ void EventPropagationTestCase::MenuEvent()
|
||||
|
||||
ASSERT_MENU_EVENT_RESULT( menu, "aomobowA" );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_DOC_VIEW_ARCHITECTURE
|
||||
|
||||
|
@@ -29,7 +29,9 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define TEST_DYNLIB
|
||||
#if wxUSE_MIMETYPE
|
||||
#define TEST_MIME
|
||||
#endif
|
||||
#define TEST_INFO_FUNCTIONS
|
||||
#define TEST_STACKWALKER
|
||||
#define TEST_STDPATHS
|
||||
|
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -811,3 +813,5 @@ TEST_CASE( "wxMenuItemAccelEntry", "[menu][accelentry]" )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -139,11 +139,12 @@ void GarbageTestCase::DoLoadFile(const wxString& fullname)
|
||||
ASSERT_FUNC_FAILS(icon.LoadFile, fullname);
|
||||
wxFOR_ALL_VALID_BITMAP_TYPES(ASSERT_FUNC_FAILS_FOR_TYPE, icon.LoadFile, fullname);
|
||||
|
||||
#if wxUSE_ANIMATIONCTRL
|
||||
// test wxAnimation
|
||||
wxAnimation anim;
|
||||
ASSERT_FUNC_FAILS(anim.LoadFile, fullname);
|
||||
wxFOR_ALL_VALID_ANIMATION_TYPES(ASSERT_FUNC_FAILS_FOR_TYPE, anim.LoadFile, fullname);
|
||||
|
||||
#endif
|
||||
|
||||
// test wxDynamicLibrary
|
||||
wxDynamicLibrary lib;
|
||||
@@ -177,11 +178,12 @@ void GarbageTestCase::DoLoadStream(wxInputStream& stream)
|
||||
ASSERT_FUNC_FAILS(img.LoadFile, stream);
|
||||
wxFOR_ALL_VALID_BITMAP_TYPES(ASSERT_FUNC_FAILS_FOR_TYPE, img.LoadFile, stream);
|
||||
|
||||
#if wxUSE_ANIMATIONCTRL
|
||||
// test wxAnimation
|
||||
wxAnimation anim;
|
||||
ASSERT_FUNC_FAILS(anim.Load, stream);
|
||||
wxFOR_ALL_VALID_BITMAP_TYPES(ASSERT_FUNC_FAILS_FOR_TYPE, anim.Load, stream);
|
||||
|
||||
#endif
|
||||
/*
|
||||
// test wxHtmlWindow
|
||||
wxHtmlWindow *htmlwin = new wxHtmlWindow(wxTheApp->GetTopWindow());
|
||||
|
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_DATAVIEWCTRL
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
@@ -170,3 +172,5 @@ TEST_CASE_METHOD(PersistenceTests, "wxPersistDVC", "[persist][wxDataViewCtrl]")
|
||||
delete list->GetParent();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -287,6 +287,7 @@ TEST_CASE_METHOD(BoxSizerTestCase, "BoxSizer::SetMinSize", "[sizer]")
|
||||
CHECK(m_sizer->GetMinSize().x == 100);
|
||||
}
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
TEST_CASE_METHOD(BoxSizerTestCase, "BoxSizer::BestSizeRespectsMaxSize", "[sizer]")
|
||||
{
|
||||
m_sizer->Clear();
|
||||
@@ -332,6 +333,7 @@ TEST_CASE_METHOD(BoxSizerTestCase, "BoxSizer::RecalcSizesRespectsMaxSize1", "[si
|
||||
|
||||
CHECK(listbox2->GetSize().GetWidth() == maxWidth);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_CASE_METHOD(BoxSizerTestCase, "BoxSizer::RecalcSizesRespectsMaxSize2", "[sizer]")
|
||||
{
|
||||
|
Reference in New Issue
Block a user