Commit Graph

1301 Commits

Author SHA1 Message Date
Allan Odgaard
b234f19fb4 Checkin release notes v2.0-alpha.9387 2013-02-25 15:35:55 +01:00
Allan Odgaard
57c2aeda47 Use libdispatch for monitoring file changes
This is instead of using kqueue, which has more overhead and require a dedicated thread for the kevent run-loop.
2013-02-25 15:28:37 +01:00
Allan Odgaard
bd5b105a44 Only set -fobjc-link-runtime for app targets
Ideally this should be set for executable targets that use Objective-C (and have deployment target set to 10.7).

This change is a quick fix for not having pure C++ tests leak. For more info see https://github.com/sorbits/rdar/blob/master/LeakWith10_7ObjCRunTime/README.md
2013-02-25 15:28:37 +01:00
Allan Odgaard
ccf63ae206 Use proper PCH for tests
We previously passed an array to ‘pch_for’ where we should have passed a source path, though it appear to have worked.
2013-02-25 15:28:37 +01:00
Allan Odgaard
7de06dc9f4 Changing default bundle item settings could fail
The cache would not include changes to settings keys from delta bundles.
2013-02-25 15:28:37 +01:00
Allan Odgaard
ea5d7d3af9 Use weak pointers in most async dispatch blocks
This is mainly to expedite potential destruction of the objects referenced.
2013-02-25 15:27:29 +01:00
Allan Odgaard
3859e25429 Disallow copying scm::info_t
Presently not supported.
2013-02-25 15:27:29 +01:00
Allan Odgaard
e091bdb2f0 Use const for member data initialized by constructor 2013-02-25 15:26:45 +01:00
Allan Odgaard
eb893105e4 Disallow copying test::jail_t
Since we delete the jailed directory in the destructor we can’t support a deep copy of this type. Since we don’t need it, and it’s just a type used in tests, I opted for simply disabling this (to get a compiler error, should it be attempted) rather than introduce the necessary code to allow shallow copies.
2013-02-25 15:26:41 +01:00
Allan Odgaard
38be7f56db Add scm::info_t::pop_callback
Ideally we would be able to remove arbitrary callbacks rather than the last one added, but for this we would need to introduce some sort of handle (the callback itself is a block so not suitable as handle). The push/pop API for callbacks is sufficient for our use-case though.
2013-02-25 15:25:17 +01:00
Allan Odgaard
c4323efbb7 Use path::is_child instead of custom code 2013-02-25 15:25:17 +01:00
Allan Odgaard
6d6c3e4de6 Use path::is_absolute instead of custom code 2013-02-25 15:25:17 +01:00
Allan Odgaard
a3ec258912 Update settings tests to new system 2013-02-25 15:25:17 +01:00
Allan Odgaard
10ebd31ad9 Let SCM tests use same executable as driver
The was previously only done for the svn tests and the code had some flaws, like modifying the PATH environment variable.
2013-02-23 11:24:57 +01:00
Allan Odgaard
b4ee927fdf Expose scm::find_executable (for testing)
This is so that tests can use the exact same executable to create the repository, as is used to obtain status (svn repositories created with newer executables are often not backwards compatible).
2013-02-23 11:24:56 +01:00
Allan Odgaard
a6e99c1853 Don’t call super in main menu key equivalent handler
It was calling super to keep our custom code to a minimum, but it turns out that the superclass will sometimes invoke bundle menu items even when items from the other menus are better candidates.

Partially reverts 4b0a9a08c7.
2013-02-23 11:24:56 +01:00
Allan Odgaard
b9ebb6068f Remove unused private field
Basically to avoid a clang warning.
2013-02-23 11:24:56 +01:00
Allan Odgaard
b718106ff8 Make semi-internal API private
This was previously public so that we could write tests for it, but since the test runner is linked with the object files, it can access symbols that has visibility set to hidden.
2013-02-23 11:24:56 +01:00
Allan Odgaard
2f3cd66a2b Support relative includes in tests
Since we inline the test file, rather than include it, relative includes from this inlined code would not work.
2013-02-23 09:19:45 +01:00
Michael Sheets
a05b1dca2e Use integrated graphics on laptops
Before using the 'Open…' dialog caused the discreet graphics chip to be enabled until TextMate exited. Setting this flag tells the OS that we want and are able to use the integrated graphics to conserve the battery. Detailed in Apple Technical Q&A QA1734:

http://developer.apple.com/library/mac/#qa/qa1734/
2013-02-22 18:14:00 -06:00
Allan Odgaard
facfe2d6f2 Checkin release notes v2.0-alpha.9385 2013-02-22 18:23:10 +01:00
Allan Odgaard
104ed0e325 Treat ‘nil’ as empty string
With bindings, clearing a text field results in its value being set to nil.
2013-02-22 18:15:11 +01:00
Allan Odgaard
ca0c72e0c0 Fix potential retain loop via document SCM callback
If we closed a window with a document SCM callback for the current document, but that document was untitled (so it wouldn’t be cleared during shutdown), we would keep ‘self’ retained.
2013-02-22 17:59:42 +01:00
Allan Odgaard
e033b7031f Avoid non-POD static data in thread
The issue here is that the thread can outlive the data.
2013-02-22 16:07:35 +01:00
Allan Odgaard
cd2b0882f0 Use new test system for a few frameworks 2013-02-22 15:55:28 +01:00
Allan Odgaard
9ebcfcbd79 Support to_s for most integer types
Here “most” refers to signed and unsigned 16, 32, and 64 bit integers.
2013-02-22 15:53:05 +01:00
Allan Odgaard
972348687c Make fs-events wrapper thread safe
Previously this wasn’t used from multiple threads, but with the new testing system it can be.
2013-02-22 15:51:51 +01:00
Allan Odgaard
8041b71d98 fixup! Exclude file browser width from new windows’ width 2013-02-22 15:51:03 +01:00
Allan Odgaard
455ecafdb5 Make debug logging thread safe 2013-02-22 15:50:37 +01:00
Allan Odgaard
39d568e146 Rework items and key equivalents in File menu
Adding New File / Folder and Close All Tabs to the menu.
2013-02-21 22:38:06 +01:00
Allan Odgaard
7c8ad2df66 Show key equivalents in file browser action menu
Also change New Document → New File. Such title makes more sense when shown in the main menu.
2013-02-21 22:36:23 +01:00
Allan Odgaard
e974f165a2 Add newFolder: forwarding to document controller 2013-02-21 22:08:52 +01:00
Allan Odgaard
5e24b8554c Remove ‘InSelectedFolder’ suffix from action method
This makes it more suitable as action for a menu item in the File menu.
2013-02-21 22:00:15 +01:00
Allan Odgaard
1f0a558adc Add performCloseAllTabs: action method
Closes #808.
2013-02-21 21:58:32 +01:00
Allan Odgaard
2190b14ee2 Disable swipes if not at min/max X 2013-02-21 21:46:58 +01:00
Allan Odgaard
cbb0a7864d Drop ‘ng’ namespace for scm 2013-02-21 17:39:55 +01:00
Allan Odgaard
af4f1e16a1 Remove old SCM API 2013-02-21 17:01:24 +01:00
Allan Odgaard
c3e9fafb2d Include scm.h instead of scm_ng.h
Since scm.h includes scm_ng.h this is effectively the same.
2013-02-21 16:58:22 +01:00
Allan Odgaard
3f4f09dcd8 Update SCM tests to new API
This is both the new test system and the new (non-blocking) SCM API.
2013-02-21 16:54:00 +01:00
Allan Odgaard
15f922a148 Let to_s(fs::snapshot_t) return std::string
Previously it would dump the datatype to stderr.
2013-02-21 16:52:22 +01:00
Allan Odgaard
8e0e35bf3b Add API to wait for SCM status
This is only meant for tests where we wish to block execution until SCM status has been collected.
2013-02-21 16:43:43 +01:00
Allan Odgaard
e2ee734fd6 SCM background workers enabled by default
Normally we enable these on application launch when we receive an ‘application did become active’ notification, for tests though, this notification is lacking, but we do want it enabled for tests, and while we could do a constructor in the tests to enable it, it seems better to just enable it by default.

One issue is that if TextMate is launched “in the background” then it will still do SCM status gathering. Though long-term I may actually want to always have it enabled, even when TextMate is not active.
2013-02-21 16:39:26 +01:00
Allan Odgaard
01417054cb Add test system supporting grand central dispatch
The motivation for introducing a new test generator is that CxxTest cannot be used with tests that (indirectly) schedule code to run in the main queue.

There are a few other advantages of breaking with CxxTest:

 1. Less boilerplate: A test file need only contain a
    function named with a ‘test_’ prefix. No classes,
    inheritance, or similar. If you need fixtures, use the
    multitude of ways that C/C++ allows that (constructor
    functions or non-POD types with static storage).

 2. Concurrent tests: Test functions are scheduled with
    ‘dispatch_apply’ and will thus run concurrently. If
    you need serial execution you can wrap your tests in a
    block and schedule that to run in the main queue.
    Though you should catch exceptions and re-throw these
    in the test’s original queue, as the test assertions
    are using exceptions.

 3. Easier output of custom types: The assertion macros
    will call ‘to_s’ on the arguments given, so the only
    thing required to make these output nicely is to
    provide a ‘to_s’ overload for your custom type /
    enumeration. I know that the standard way to do this
    is overloading operator<< for a stream, but the
    TextMate code-base already uses the ‘to_s’
    convention.

Long-term I can see a few other advantages, like calling preprocessor on the input files to support #if/#else/#endif to disable tests, better support for Cocoa code (NSRunLoop), and introducing test timeouts.
2013-02-21 15:54:37 +01:00
Allan Odgaard
acd3bdf234 Convert leading em-spaces in symbol menu to item indent
By using the menu item’s indentation level property it is possible to “type to select” items, which previously would not work for items that had leading em-space as a prefix.

Closes #806.
2013-02-20 18:08:24 +01:00
Allan Odgaard
7a45f6949a Don’t use NSFileManager to trash symlinks
NSFileManager will resolve the link and move the original file to trash, which is generally not desired (or expected).
2013-02-20 13:04:20 +01:00
Allan Odgaard
a7c33be67e Remove cf::color_t
This wrapper is no longer used.
2013-02-20 12:54:52 +01:00
Allan Odgaard
4bae908d49 Move CGColorRef helper functions
These only have one user, so let’s make them private helper functions instead.
2013-02-20 12:54:26 +01:00
Allan Odgaard
0d8ccd17f0 Exclude file browser width from new windows’ width
Closes #679.
2013-02-19 22:08:13 +01:00
Allan Odgaard
0bf5a85a1c Resize window when toggling file browser
If you dislike this it can be disabled using:

    defaults write com.macromates.TextMate.preview disableFileBrowserWindowResize -bool YES
2013-02-19 21:13:53 +01:00
Michael Sheets
40f728ff8f Correct height of header when tabs above document is enabled
Previously this appeared correct because once you clicked the minimum height of the pop-up menu set it to the correct height. Corrects an issue noted by @fatiotus in #728.
2013-02-18 20:46:55 -06:00