Commit Graph

347 Commits

Author SHA1 Message Date
Pietro Gagliardi b8b1123027 And rewrote TestEventBlocksHonored. Now we can expand it. 2019-05-25 22:30:08 -04:00
Pietro Gagliardi f77f8d49d3 Restructured TestEventSendersHonored to use the new deinterleaved handler; this also makes it use baseParams and creates events per impl rather than globally. 2019-05-25 22:21:16 -04:00
Pietro Gagliardi a8ab5be01a Started deinterlacing the handler got and want parameters into struct handler. 2019-05-25 22:07:56 -04:00
Pietro Gagliardi 3cd08a5b2d Simplified the event structures. Next step is to deduplicate handlers. 2019-05-25 21:19:22 -04:00
Pietro Gagliardi c41ac17dd4 Rewrote test/events.c to localize the actual uiEventFire() testing code. 2019-05-25 21:11:03 -04:00
Pietro Gagliardi d6cde02825 More event tests. Okay, I definitely need a better way to handle these. 2019-05-23 21:42:52 -04:00
Pietro Gagliardi 5a6c302ae0 Added TestEventSendersHonored. 2019-05-22 11:44:30 -04:00
Pietro Gagliardi bf3492cd9c Cleaned up event test names. 2019-05-22 11:16:15 -04:00
Pietro Gagliardi d346a8ca8e Laid out the other things to test for events.c. 2019-05-21 21:12:01 -04:00
Pietro Gagliardi 43fd636071 And cleaned up the subtest architecture and made both tests properly subtested. Now for the rest of the tests. 2019-05-21 21:01:13 -04:00
Pietro Gagliardi bf1172bc0a Parameterized TestBasicEventsAddDeleteEventHandlers. Now we'll split it into subtests. 2019-05-21 20:16:41 -04:00
Pietro Gagliardi 009a9c25aa Oops (only spotted it when forcing a failure). 2019-05-20 22:26:11 -04:00
Pietro Gagliardi 7be128d5bb Changed TestBasicEventsSingleHandler to use subtests. It works! 2019-05-20 22:20:04 -04:00
Pietro Gagliardi 102dff6489 And added testingprivOutbufString() and enabled testingTRun(). Now to rewrite the events tests to use it. 2019-05-20 22:03:56 -04:00
Pietro Gagliardi 57e4e0d13b Removed the computedName field in testingT; we manage the memory for subtest names in testingTRun() itself. 2019-05-20 21:33:55 -04:00
Pietro Gagliardi 6412d8365f Stored the full options struct in testingT, so options can be passed to subtests; this also avoids the need to pass them into testingprivTRun(). 2019-05-20 21:22:02 -04:00
Pietro Gagliardi 3c9ff9c4bc Added a data parameter to test scaffolds; this is currently NULL, but subtests will use it (the subtest function is called directly, not through a scaffold). 2019-05-20 21:10:29 -04:00
Pietro Gagliardi bd666b8ec9 Started writing subtests. I'll need to make a few more structural changes to the test scaffolding for this. 2019-05-20 20:56:47 -04:00
Pietro Gagliardi 4112630f59 And fixed the remaining kinks with testingprivOutbuf. Now we can add subtests! (Forgot to mention that the previous commit also simplified the indent logic and split the actual function to run a test into its own function; this in particular also contributes to subtests.) 2019-05-20 20:07:59 -04:00
Pietro Gagliardi 9f0bb3aacb Fixed uiprivArray/testingprivArray bugs that led to the crash. Now to fix up the rest of the code. 2019-05-20 11:12:16 -04:00
Pietro Gagliardi a4c6817d33 Rewrote testing.c to use testingprivOutbuf. It doesn't quite work yet... 2019-05-20 10:57:31 -04:00
Pietro Gagliardi 9bec2005a1 Added smprintf() and outbuf to the testingpriv.h functions, introducing a simpler outbuf API along the way. Changing the test suite to actually use this comes next. 2019-05-19 23:15:35 -04:00
Pietro Gagliardi 40508a457c Changed testingSet to use testingprivArray. 2019-05-19 18:06:58 -04:00
Pietro Gagliardi 2d8764f06b Split the testing allocation and print functions into their own file, and added uiprivArray as testingprivArray. Switching everything to use testingprivArray will come next. 2019-05-19 17:55:31 -04:00
Pietro Gagliardi 66f1f75992 Started rearranging things to allow for subtests; I should clean up the allocation stuff in libui first, so they can be borrowed. 2019-05-19 11:05:20 -04:00
Pietro Gagliardi 35759935ae Added more cases to the AddDelete tests. Now to add subtests so we can more easily pluralize these tests, including handling cases of different senders. 2019-05-19 01:06:43 -04:00
Pietro Gagliardi 973696137f Reduced noise in event tests when a handler that should have run did not run. 2019-05-18 22:21:23 -04:00
Pietro Gagliardi 3b1f5e0e54 Added more event tests. DeleteHandler obviously does not work... and I really need to add subtests. 2019-05-18 21:21:55 -04:00
Pietro Gagliardi 43f7d1a661 Started the events test suite. 2019-05-18 13:26:55 -04:00
Pietro Gagliardi 637c7a7e2c Oops 2019-05-10 21:36:38 -04:00
Pietro Gagliardi 07dc3ee025 Finished the test set implementation, moving the tester itself to use it. This also moves uiInit() into main(); in TestInit, we'll hook into uiInit() to avoid actually doing the initialization. 2019-05-10 21:16:29 -04:00
Pietro Gagliardi 7f986ef073 Started adding more flexible test set functionality. 2019-05-09 22:54:14 -04:00
Pietro Gagliardi bc0d3120c8 Added verbosity to the test suite. Now we can move on. 2019-05-05 15:59:59 -04:00
Pietro Gagliardi 3ebc58a5bf Fixed build issues in MinGW-w64. 2019-05-05 15:20:54 -04:00
Pietro Gagliardi b7f06074fb Converted testing.c to buffer test output. Also reordered test logs to be after the status line, like in Go. Now we can add verbosity control, and then maybe later even subtests! 2019-05-05 14:26:38 -04:00
Pietro Gagliardi 8b70e6d247 Cleaned up internal helper functions in testing.c, including adding one for vsnprintf() and snprintf(). This is the first step toward buffering test output and adding verbosity control. 2019-05-05 13:35:07 -04:00
Pietro Gagliardi d49f8ae7e6 Switched the macOS code to use timerprivInt128ToUint64(). Also rearranged the arguments of timerprivInt128ToInt64() and added proper timerDurationMin/Max constants instead of the incorrect-for-that-function timerTimeMin/Max in the Windows code. 2019-05-05 11:16:17 -04:00
Pietro Gagliardi ff803bf792 And implemented 128-bit muldiv on Windows. 2019-05-05 11:03:17 -04:00
Pietro Gagliardi 288c74b026 Implemented the new MulDiv128 stuff on macOS. To make things easier in regards to signedness, this implementation also uses a base, like the Unix one, and the mach_timebase_info() conversion is done in timerMonotonicTime() instead. (Also added the admittedly-redundant-since-the-current(ish)-implementation-cannot-fail error check to mach_timebase_info().) As a result, timerTimeSub() can now be end - start on all platforms. Also found and fixed bugs in the actual muldiv128 algorithm implementation. Next up: Windows. 2019-05-05 03:17:11 -04:00
Pietro Gagliardi 952b36b1c2 Added proper 128-bit muldiv() stuff for macOS and Windows. Will actually use them next. Also fixed compiling on non-Windows. 2019-05-05 02:17:11 -04:00
Pietro Gagliardi ee3e587ddc Fixed build errors on Windows. 2019-05-04 21:47:04 -04:00
Pietro Gagliardi 98093ed46e Formatted test results across multiple lines in the same way as in Go. Also prettyprinted diffs in initmain.c. 2019-05-04 21:13:47 -04:00
Pietro Gagliardi 4c097f93f7 Implemented error checks in test/initmain.c. 2019-05-04 19:21:57 -04:00
Pietro Gagliardi 09e98af110 Removed a stale TODO caused by inaccurate timer code (that was in response to the old clock()-based Unix code). 2019-05-04 19:04:32 -04:00
Pietro Gagliardi 00411a4d07 Moved all the test infrasturcture files into a subdirectory of test/ called lib/. 2019-05-04 16:53:54 -04:00
Pietro Gagliardi 57abc83fe3 And split all the thread stuff into their own file. Almost done with all this test library cleanup! 2019-05-04 16:47:56 -04:00
Pietro Gagliardi 89e882c4a8 And fixed build errors on non-macOS systems. We're good! 2019-05-04 14:44:29 -04:00
Pietro Gagliardi bfd608cf8e And of course setitimer() doesn't allow us to override the struct sigvalue, so we can't chain out to outer SIGALRM calls. Hooray for global state! 2019-05-04 14:31:33 -04:00
Pietro Gagliardi 5836a2a236 Ugh, macOS doesn't support timer_create() and friends :| (Even up to 10.13, it seems; not sure about 10.14!) Switch back to setitimer(). Also rename oldsig to prevSig and remove a needless (for now???) cast. 2019-05-04 14:24:22 -04:00
Pietro Gagliardi 8655bbf19c Finished porting over the timer functions from testing_darwinunix.c to timer_darwinunix.c. This also includes changing timerRunWIthTimeout() from using setitimer() to using timer_create() and friends, and removing the fallbacks from timerSleep().
Also fixed a possible incorrect use of TlsSetValue() in the Windows code that I spotted while writing an intermediate version of the Unix code.
2019-05-04 12:13:07 -04:00