{"action":"created","comment":{"url":"https://api.github.com/repos/ament/ament_cmake/pulls/comments/47038813","id":47038813,"diff_hunk":"@@ -47,7 +47,7 @@ macro(ament_add_gtest target)\n endmacro()\n \n function(_ament_add_gtest target)\n-  cmake_parse_arguments(ARG \"SKIP_LINKING_MAIN_LIBRARIES\" \"TIMEOUT\" \"\" ${ARGN})\n+  cmake_parse_arguments(ARG \"SKIP_LINKING_MAIN_LIBRARIES\" \"TIMEOUT;ENV\" \"\" ${ARGN})","path":"ament_cmake_gtest/cmake/ament_add_gtest.cmake","position":5,"original_position":5,"commit_id":"c11ba372d468633b0ce46d45412a0dc1beedcf97","original_commit_id":"c11ba372d468633b0ce46d45412a0dc1beedcf97","user":{"login":"dirk-thomas","id":1335366,"avatar_url":"https://avatars.githubusercontent.com/u/1335366?v=3","gravatar_id":"","url":"https://api.github.com/users/dirk-thomas","html_url":"https://github.com/dirk-thomas","followers_url":"https://api.github.com/users/dirk-thomas/followers","following_url":"https://api.github.com/users/dirk-thomas/following{/other_user}","gists_url":"https://api.github.com/users/dirk-thomas/gists{/gist_id}","starred_url":"https://api.github.com/users/dirk-thomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirk-thomas/subscriptions","organizations_url":"https://api.github.com/users/dirk-thomas/orgs","repos_url":"https://api.github.com/users/dirk-thomas/repos","events_url":"https://api.github.com/users/dirk-thomas/events{/privacy}","received_events_url":"https://api.github.com/users/dirk-thomas/received_events","type":"User","site_admin":false},"body":"Please add `ENV` before `TIMEOUT` (for alpha. order) and document it in the docblock above.","created_at":"2015-12-09T00:55:18Z","updated_at":"2015-12-09T00:55:18Z","html_url":"https://github.com/ament/ament_cmake/pull/50#discussion_r47038813","pull_request_url":"https://api.github.com/repos/ament/ament_cmake/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/ament/ament_cmake/pulls/comments/47038813"},"html":{"href":"https://github.com/ament/ament_cmake/pull/50#discussion_r47038813"},"pull_request":{"href":"https://api.github.com/repos/ament/ament_cmake/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/ament/ament_cmake/pulls/50","id":53062311,"html_url":"https://github.com/ament/ament_cmake/pull/50","diff_url":"https://github.com/ament/ament_cmake/pull/50.diff","patch_url":"https://github.com/ament/ament_cmake/pull/50.patch","issue_url":"https://api.github.com/repos/ament/ament_cmake/issues/50","number":50,"state":"open","locked":false,"title":"add option to pass extra env to ament_add_*test","user":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"body":"I needed this to pass some environment to tests on OS X. I think the changes are pretty self explanatory.\r\n\r\nOne nice thing is that you can pass generator expressions through this variable and it works, e.g. I have the cmake code:\r\n\r\n```\r\nament_add_gtest(test_allocator\r\n    test/rcl/test_allocator.cpp\r\n    ENV DYLD_INSERT_LIBRARIES=$<TARGET_FILE:${PROJECT_NAME}_memory_tools_interpose>)\r\n```\r\n\r\nWhich results in these args to `run_test.py`:\r\n\r\n```\r\n3: Test command: /usr/local/bin/python3 \"-u\" \"/Users/william/ros2/install/share/ament_cmake_test/cmake/run_test.py\" \"/Users/william/ros2/build/rcl/test_results/rcl/test_time.gtest.xml\" \"--output-file\" \"/Users/william/ros2/build/rcl/ament_cmake_gtest/test_time.txt\" \"--env\" \"DYLD_INSERT_LIBRARIES=/Users/william/ros2/build/rcl/librcl_memory_tools_interpose.dylib\" \"--command\" \"/Users/william/ros2/build/rcl/test_time\" \"--gtest_output=xml:/Users/william/ros2/build/rcl/test_results/rcl/test_time.gtest.xml\"\r\n3: Test timeout computed to be: 60\r\n3: -- run_test.py: extra environment variables:\r\n3:  - DYLD_INSERT_LIBRARIES=/Users/william/ros2/build/rcl/librcl_memory_tools_interpose.dylib\r\n3: -- run_test.py: invoking following command in '/Users/william/ros2/build/rcl':\r\n3:  - /Users/william/ros2/build/rcl/test_time --gtest_output=xml:/Users/william/ros2/build/rcl/test_results/rcl/test_time.gtest.xml\r\n3: Running main() from gtest_main.cc\r\n[ ... ]\r\n```","created_at":"2015-12-09T00:52:01Z","updated_at":"2015-12-09T00:55:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15aafd6b7fa6408afaeeb2922270507407eb2601","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ament/ament_cmake/pulls/50/commits","review_comments_url":"https://api.github.com/repos/ament/ament_cmake/pulls/50/comments","review_comment_url":"https://api.github.com/repos/ament/ament_cmake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ament/ament_cmake/issues/50/comments","statuses_url":"https://api.github.com/repos/ament/ament_cmake/statuses/c11ba372d468633b0ce46d45412a0dc1beedcf97","head":{"label":"ament:pass_extra_env_to_tests","ref":"pass_extra_env_to_tests","sha":"c11ba372d468633b0ce46d45412a0dc1beedcf97","user":{"login":"ament","id":7365061,"avatar_url":"https://avatars.githubusercontent.com/u/7365061?v=3","gravatar_id":"","url":"https://api.github.com/users/ament","html_url":"https://github.com/ament","followers_url":"https://api.github.com/users/ament/followers","following_url":"https://api.github.com/users/ament/following{/other_user}","gists_url":"https://api.github.com/users/ament/gists{/gist_id}","starred_url":"https://api.github.com/users/ament/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ament/subscriptions","organizations_url":"https://api.github.com/users/ament/orgs","repos_url":"https://api.github.com/users/ament/repos","events_url":"https://api.github.com/users/ament/events{/privacy}","received_events_url":"https://api.github.com/users/ament/received_events","type":"Organization","site_admin":false},"repo":{"id":19872267,"name":"ament_cmake","full_name":"ament/ament_cmake","owner":{"login":"ament","id":7365061,"avatar_url":"https://avatars.githubusercontent.com/u/7365061?v=3","gravatar_id":"","url":"https://api.github.com/users/ament","html_url":"https://github.com/ament","followers_url":"https://api.github.com/users/ament/followers","following_url":"https://api.github.com/users/ament/following{/other_user}","gists_url":"https://api.github.com/users/ament/gists{/gist_id}","starred_url":"https://api.github.com/users/ament/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ament/subscriptions","organizations_url":"https://api.github.com/users/ament/orgs","repos_url":"https://api.github.com/users/ament/repos","events_url":"https://api.github.com/users/ament/events{/privacy}","received_events_url":"https://api.github.com/users/ament/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ament/ament_cmake","description":"Supporting CMake packages for working with ament","fork":false,"url":"https://api.github.com/repos/ament/ament_cmake","forks_url":"https://api.github.com/repos/ament/ament_cmake/forks","keys_url":"https://api.github.com/repos/ament/ament_cmake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ament/ament_cmake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ament/ament_cmake/teams","hooks_url":"https://api.github.com/repos/ament/ament_cmake/hooks","issue_events_url":"https://api.github.com/repos/ament/ament_cmake/issues/events{/number}","events_url":"https://api.github.com/repos/ament/ament_cmake/events","assignees_url":"https://api.github.com/repos/ament/ament_cmake/assignees{/user}","branches_url":"https://api.github.com/repos/ament/ament_cmake/branches{/branch}","tags_url":"https://api.github.com/repos/ament/ament_cmake/tags","blobs_url":"https://api.github.com/repos/ament/ament_cmake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ament/ament_cmake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ament/ament_cmake/git/refs{/sha}","trees_url":"https://api.github.com/repos/ament/ament_cmake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ament/ament_cmake/statuses/{sha}","languages_url":"https://api.github.com/repos/ament/ament_cmake/languages","stargazers_url":"https://api.github.com/repos/ament/ament_cmake/stargazers","contributors_url":"https://api.github.com/repos/ament/ament_cmake/contributors","subscribers_url":"https://api.github.com/repos/ament/ament_cmake/subscribers","subscription_url":"https://api.github.com/repos/ament/ament_cmake/subscription","commits_url":"https://api.github.com/repos/ament/ament_cmake/commits{/sha}","git_commits_url":"https://api.github.com/repos/ament/ament_cmake/git/commits{/sha}","comments_url":"https://api.github.com/repos/ament/ament_cmake/comments{/number}","issue_comment_url":"https://api.github.com/repos/ament/ament_cmake/issues/comments{/number}","contents_url":"https://api.github.com/repos/ament/ament_cmake/contents/{+path}","compare_url":"https://api.github.com/repos/ament/ament_cmake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ament/ament_cmake/merges","archive_url":"https://api.github.com/repos/ament/ament_cmake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ament/ament_cmake/downloads","issues_url":"https://api.github.com/repos/ament/ament_cmake/issues{/number}","pulls_url":"https://api.github.com/repos/ament/ament_cmake/pulls{/number}","milestones_url":"https://api.github.com/repos/ament/ament_cmake/milestones{/number}","notifications_url":"https://api.github.com/repos/ament/ament_cmake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ament/ament_cmake/labels{/name}","releases_url":"https://api.github.com/repos/ament/ament_cmake/releases{/id}","created_at":"2014-05-16T22:13:54Z","updated_at":"2015-07-08T05:42:14Z","pushed_at":"2015-12-09T00:52:01Z","git_url":"git://github.com/ament/ament_cmake.git","ssh_url":"git@github.com:ament/ament_cmake.git","clone_url":"https://github.com/ament/ament_cmake.git","svn_url":"https://github.com/ament/ament_cmake","homepage":"","size":577,"stargazers_count":4,"watchers_count":4,"language":"CMake","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":4,"default_branch":"master"}},"base":{"label":"ament:master","ref":"master","sha":"4c778a83ce280a6be93b091956c35d9cfb26654f","user":{"login":"ament","id":7365061,"avatar_url":"https://avatars.githubusercontent.com/u/7365061?v=3","gravatar_id":"","url":"https://api.github.com/users/ament","html_url":"https://github.com/ament","followers_url":"https://api.github.com/users/ament/followers","following_url":"https://api.github.com/users/ament/following{/other_user}","gists_url":"https://api.github.com/users/ament/gists{/gist_id}","starred_url":"https://api.github.com/users/ament/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ament/subscriptions","organizations_url":"https://api.github.com/users/ament/orgs","repos_url":"https://api.github.com/users/ament/repos","events_url":"https://api.github.com/users/ament/events{/privacy}","received_events_url":"https://api.github.com/users/ament/received_events","type":"Organization","site_admin":false},"repo":{"id":19872267,"name":"ament_cmake","full_name":"ament/ament_cmake","owner":{"login":"ament","id":7365061,"avatar_url":"https://avatars.githubusercontent.com/u/7365061?v=3","gravatar_id":"","url":"https://api.github.com/users/ament","html_url":"https://github.com/ament","followers_url":"https://api.github.com/users/ament/followers","following_url":"https://api.github.com/users/ament/following{/other_user}","gists_url":"https://api.github.com/users/ament/gists{/gist_id}","starred_url":"https://api.github.com/users/ament/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ament/subscriptions","organizations_url":"https://api.github.com/users/ament/orgs","repos_url":"https://api.github.com/users/ament/repos","events_url":"https://api.github.com/users/ament/events{/privacy}","received_events_url":"https://api.github.com/users/ament/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ament/ament_cmake","description":"Supporting CMake packages for working with ament","fork":false,"url":"https://api.github.com/repos/ament/ament_cmake","forks_url":"https://api.github.com/repos/ament/ament_cmake/forks","keys_url":"https://api.github.com/repos/ament/ament_cmake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ament/ament_cmake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ament/ament_cmake/teams","hooks_url":"https://api.github.com/repos/ament/ament_cmake/hooks","issue_events_url":"https://api.github.com/repos/ament/ament_cmake/issues/events{/number}","events_url":"https://api.github.com/repos/ament/ament_cmake/events","assignees_url":"https://api.github.com/repos/ament/ament_cmake/assignees{/user}","branches_url":"https://api.github.com/repos/ament/ament_cmake/branches{/branch}","tags_url":"https://api.github.com/repos/ament/ament_cmake/tags","blobs_url":"https://api.github.com/repos/ament/ament_cmake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ament/ament_cmake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ament/ament_cmake/git/refs{/sha}","trees_url":"https://api.github.com/repos/ament/ament_cmake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ament/ament_cmake/statuses/{sha}","languages_url":"https://api.github.com/repos/ament/ament_cmake/languages","stargazers_url":"https://api.github.com/repos/ament/ament_cmake/stargazers","contributors_url":"https://api.github.com/repos/ament/ament_cmake/contributors","subscribers_url":"https://api.github.com/repos/ament/ament_cmake/subscribers","subscription_url":"https://api.github.com/repos/ament/ament_cmake/subscription","commits_url":"https://api.github.com/repos/ament/ament_cmake/commits{/sha}","git_commits_url":"https://api.github.com/repos/ament/ament_cmake/git/commits{/sha}","comments_url":"https://api.github.com/repos/ament/ament_cmake/comments{/number}","issue_comment_url":"https://api.github.com/repos/ament/ament_cmake/issues/comments{/number}","contents_url":"https://api.github.com/repos/ament/ament_cmake/contents/{+path}","compare_url":"https://api.github.com/repos/ament/ament_cmake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ament/ament_cmake/merges","archive_url":"https://api.github.com/repos/ament/ament_cmake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ament/ament_cmake/downloads","issues_url":"https://api.github.com/repos/ament/ament_cmake/issues{/number}","pulls_url":"https://api.github.com/repos/ament/ament_cmake/pulls{/number}","milestones_url":"https://api.github.com/repos/ament/ament_cmake/milestones{/number}","notifications_url":"https://api.github.com/repos/ament/ament_cmake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ament/ament_cmake/labels{/name}","releases_url":"https://api.github.com/repos/ament/ament_cmake/releases{/id}","created_at":"2014-05-16T22:13:54Z","updated_at":"2015-07-08T05:42:14Z","pushed_at":"2015-12-09T00:52:01Z","git_url":"git://github.com/ament/ament_cmake.git","ssh_url":"git@github.com:ament/ament_cmake.git","clone_url":"https://github.com/ament/ament_cmake.git","svn_url":"https://github.com/ament/ament_cmake","homepage":"","size":577,"stargazers_count":4,"watchers_count":4,"language":"CMake","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ament/ament_cmake/pulls/50"},"html":{"href":"https://github.com/ament/ament_cmake/pull/50"},"issue":{"href":"https://api.github.com/repos/ament/ament_cmake/issues/50"},"comments":{"href":"https://api.github.com/repos/ament/ament_cmake/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/ament/ament_cmake/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/ament/ament_cmake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ament/ament_cmake/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/ament/ament_cmake/statuses/c11ba372d468633b0ce46d45412a0dc1beedcf97"}}}}