Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 1b12348e57 [tests] Refactor API to check/assert current OS version. 2018-07-04 12:35:15 +02:00
Rolf Bjarne Kvinge 9703f17c91 [monotouch-test] Fix versions checks.
* Fix many version checks to be based on Xcode version instead of iOS version.
* Added/fixed a few expected values according to platform version to match behavior in older macOS versions.
2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge 171cf4987c
[monotouch-test] Tweak CalendarTest yet again. (#3015)
Hopefully third time's the charm...

Don't do date math (adding hours) to a local datetime, since DST *will* muddy
the waters and prove that 1=2.

Instead convert the date we want to calculate on to UTC, which should be DST-agnostic.

I've tested this by running the test for every hour during the next 10 years,
so that should cover mostly everything (although I'm still waiting for the
Delorean I ordered to be able to test both in the future and the past).

Previous attempts:

0442cdf9c0
5caddb3571

Should fix https://github.com/xamarin/maccore/issues/573.
2017-11-16 18:48:37 +01:00
Rolf Bjarne Kvinge 5caddb3571
[monotouch-test] Fix regression in CalendarTest to not compare UTC and local time directly. (#2964)
In 0442cdf9c0 the `now` variable was changed to
be a UTC date, but unfortunately the code that compares it to a local date
(NSDate.Now) wasn't updated.

Only year/month/day values were compared, which meant the test would fail if
run when UTC and local time didn't represent the same date (and conversely
would pass if the UTC and local date was the same date, which is why the
changed did not fail the PR test run: the PR was tested during the 19 hours of
the day when EST and UTC represent the sam date).

Fix this by converting the UTC `now` to NSDate instead of using NSDate.Now.

This has the additional benefit of also fixing a (much smaller) race
condition: if midnight occurred just between calculating `now` and NSDate.Now,
the test would also fail.
2017-11-07 16:12:00 +01:00
Rolf Bjarne Kvinge 0442cdf9c0
[monotouch-test] Tweak CalendarTest to work when 1h = 2h due to DST change. (#2957)
At 2:00 AM on November 5h 2017, winter came to our bots in Boston.

This meant that between 2:00 and 3:00 AM, subtracting 1h from the current
time yielded a time difference of 2h.

This was caught by our observant tests:

    [FAIL] CalendarTest.DateComponentsTest :   b hour
        Expected: 1
        But was:  2

To avoid such issues next time this test happens to run during this single
hour of the entire year that causes problems, change the test to use time
calculcation using UTC instead.
2017-11-06 15:17:12 +01:00
Alex Soto 9f4becd993 [tests] Allow monotouch-tests and introspection to run with Xcode 9 Beta 1 (#2185)
* [monotouch-test] Disable EmptyNib tests due to Xcode9 no longer builds nibs if deployment target < 7.0

EmptyNib.xib : ibtool error : Compiling IB documents for earlier than iOS 7 is no longer supported.

* [monotouch-test] Fixt CalendarTest.TestEnumerateDates

It seems that NSCalendar.CurrentCalendar.EnumerateDatesStartingAfterDate
won't stop enumerating unless `stop` is set to `true`.

* [Tests] Add CheckXcodeVersion support for Xcode 9

* [introspection] Avoid introspection to crash with Xcode 9 Beta 1

* [monotouch-test] bring back LogicalName removal from monotouch-test.csproj
2017-06-07 18:03:34 -07:00
Timothy Risi 687aa6f25f Port monotouch-test suite to Xamarin.Mac (#1445)
* Port the Monotouch-test suite to run on Xamarin.Mac

Adds over 1300 new API tests for XM
2017-01-12 09:13:56 -09:00
Rolf Bjarne Kvinge 0a8c6e3342 [tests] Check versions using Xcode version instead of platform version.
This is required to match API to the required platform version,
since our platforms have different version numbers.
2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge ecfdea9508 [tests] Import 2016-05-26 15:06:52 +02:00