{"action":"created","comment":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/23443386","id":23443386,"diff_hunk":"@@ -27,6 +27,10 @@ r-resources-path=${CMAKE_CURRENT_SOURCE_DIR}/session/resources\n r-session-library=${CMAKE_CURRENT_BINARY_DIR}/r/R/packages/library\n r-session-package-archives=${RSTUDIO_DEPENDENCIES_DIR}/common\n \n+# override home and doc dirs\n+r-home-dir-override=${LIBR_HOME}\n+r-doc-dir-override=${LIBR_DOC_DIR}\n+","path":"src/cpp/conf/rsession-dev.conf","position":7,"original_position":7,"commit_id":"f79031b9bdc3bb67bf7e48c2e02379ae4072a9cc","original_commit_id":"f79031b9bdc3bb67bf7e48c2e02379ae4072a9cc","user":{"login":"jjallaire","id":104391,"avatar_url":"https://avatars.githubusercontent.com/u/104391?v=3","gravatar_id":"","url":"https://api.github.com/users/jjallaire","html_url":"https://github.com/jjallaire","followers_url":"https://api.github.com/users/jjallaire/followers","following_url":"https://api.github.com/users/jjallaire/following{/other_user}","gists_url":"https://api.github.com/users/jjallaire/gists{/gist_id}","starred_url":"https://api.github.com/users/jjallaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjallaire/subscriptions","organizations_url":"https://api.github.com/users/jjallaire/orgs","repos_url":"https://api.github.com/users/jjallaire/repos","events_url":"https://api.github.com/users/jjallaire/events{/privacy}","received_events_url":"https://api.github.com/users/jjallaire/received_events","type":"User","site_admin":false},"body":"The only issue with doing this is that it makes it hard for us to test features of rserver that dynamically change the version of R being run (e.g. the user profile feature in rstudio server pro). There is another conf/-dev pair called \"rdesktop-dev\" that I believe does what you want (and contains the -override flags already).","created_at":"2015-01-23T10:57:10Z","updated_at":"2015-01-23T10:57:10Z","html_url":"https://github.com/rstudio/rstudio/pull/275#discussion_r23443386","pull_request_url":"https://api.github.com/repos/rstudio/rstudio/pulls/275","_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/23443386"},"html":{"href":"https://github.com/rstudio/rstudio/pull/275#discussion_r23443386"},"pull_request":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/275"}}},"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/275","id":27574790,"html_url":"https://github.com/rstudio/rstudio/pull/275","diff_url":"https://github.com/rstudio/rstudio/pull/275.diff","patch_url":"https://github.com/rstudio/rstudio/pull/275.patch","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/275","number":275,"state":"open","locked":false,"title":"Use 'Catch' for unit testing","user":{"login":"kevinushey","id":1976582,"avatar_url":"https://avatars.githubusercontent.com/u/1976582?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinushey","html_url":"https://github.com/kevinushey","followers_url":"https://api.github.com/users/kevinushey/followers","following_url":"https://api.github.com/users/kevinushey/following{/other_user}","gists_url":"https://api.github.com/users/kevinushey/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinushey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinushey/subscriptions","organizations_url":"https://api.github.com/users/kevinushey/orgs","repos_url":"https://api.github.com/users/kevinushey/repos","events_url":"https://api.github.com/users/kevinushey/events{/privacy}","received_events_url":"https://api.github.com/users/kevinushey/received_events","type":"User","site_admin":false},"body":"NOTE: we can leave this for after Preview-2 merge, but we might want to merge soon to avoid inevitable merge conflicts due to the `session` -> `rsession` rename (see more later)\r\n\r\nThis PR adds some infrastructure for using [Catch](https://github.com/philsquared/Catch) to run unit tests in our C++ code. I provide a couple of small abstractions over Catch in `TestThat.hpp` and `TestRunner.hpp`.\r\n\r\nWe use a very similar interface to the `testthat` package for running tests. Any implementation file that wants to add unit tests can simply include the `<tests/TestThat.hpp>` header, and declare a test block with e.g.\r\n\r\n```cpp\r\ntest_that(\"this function works\") {\r\n    expect_true(<functionCall>);\r\n}\r\n```\r\n\r\n`test_that` and `expect_*` are macros that map to the Catch macro counterparts; we might want to use different names to avoid macro collisions just in case but this seems to work fine (and we don't use snake casing anywhere else in the code base)\r\n\r\nUnfortunately, on OS X, catch includes `<sys/proc.h>`, which has:\r\n\r\n```\r\nstruct session;\r\n```\r\n\r\nso one of the side effects is that I had to rename the `session` namespace to `rsession`. (That's all the noise you see in the `.cpp` files)\r\n\r\nThe `test-runner` CMake project is set up to glop up any file matching the glob `*Tests.cpp`, so adding new tests for a file is as simple as creating a new file `<File>Tests.cpp` and writing the Catch tests within.\r\n\r\nMy `cmake`-fu is a bit lacking so let me know if anything I've done seems particularly weird / off!","created_at":"2015-01-18T18:29:24Z","updated_at":"2015-01-23T10:57:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dadd0b91fef15e94a9afd4e773a2adfd7a120eb0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/rstudio/pulls/275/commits","review_comments_url":"https://api.github.com/repos/rstudio/rstudio/pulls/275/comments","review_comment_url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/275/comments","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/f79031b9bdc3bb67bf7e48c2e02379ae4072a9cc","head":{"label":"rstudio:feature/catch-unit-testing","ref":"feature/catch-unit-testing","sha":"f79031b9bdc3bb67bf7e48c2e02379ae4072a9cc","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments/{number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","created_at":"2010-12-07T19:10:25Z","updated_at":"2015-01-23T10:50:39Z","pushed_at":"2015-01-23T10:50:39Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":338104,"stargazers_count":924,"watchers_count":924,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":182,"mirror_url":null,"open_issues_count":3,"forks":182,"open_issues":3,"watchers":924,"default_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"0acc4ff41ce27bd53e8a4007335f96759bc7a0ab","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments/{number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","created_at":"2010-12-07T19:10:25Z","updated_at":"2015-01-23T10:50:39Z","pushed_at":"2015-01-23T10:50:39Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":338104,"stargazers_count":924,"watchers_count":924,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":182,"mirror_url":null,"open_issues_count":3,"forks":182,"open_issues":3,"watchers":924,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/275"},"html":{"href":"https://github.com/rstudio/rstudio/pull/275"},"issue":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/275"},"comments":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/rstudio/statuses/f79031b9bdc3bb67bf7e48c2e02379ae4072a9cc"}}}}