{"action":"created","issue":{"url":"https://api.github.com/repos/waf-project/waf/issues/1852","repository_url":"https://api.github.com/repos/waf-project/waf","labels_url":"https://api.github.com/repos/waf-project/waf/issues/1852/labels{/name}","comments_url":"https://api.github.com/repos/waf-project/waf/issues/1852/comments","events_url":"https://api.github.com/repos/waf-project/waf/issues/1852/events","html_url":"https://github.com/waf-project/waf/pull/1852","id":189041975,"number":1852,"title":"waf_unit_test: add possibility to dump the environment variables before test run","user":{"login":"fedepell","id":19709142,"avatar_url":"https://avatars.githubusercontent.com/u/19709142?v=3","gravatar_id":"","url":"https://api.github.com/users/fedepell","html_url":"https://github.com/fedepell","followers_url":"https://api.github.com/users/fedepell/followers","following_url":"https://api.github.com/users/fedepell/following{/other_user}","gists_url":"https://api.github.com/users/fedepell/gists{/gist_id}","starred_url":"https://api.github.com/users/fedepell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedepell/subscriptions","organizations_url":"https://api.github.com/users/fedepell/orgs","repos_url":"https://api.github.com/users/fedepell/repos","events_url":"https://api.github.com/users/fedepell/events{/privacy}","received_events_url":"https://api.github.com/users/fedepell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-14T07:02:50Z","updated_at":"2016-11-21T06:51:56Z","closed_at":"2016-11-18T22:40:59Z","pull_request":{"url":"https://api.github.com/repos/waf-project/waf/pulls/1852","html_url":"https://github.com/waf-project/waf/pull/1852","diff_url":"https://github.com/waf-project/waf/pull/1852.diff","patch_url":"https://github.com/waf-project/waf/pull/1852.patch"},"body":"Often when a unit test run via waf_unit_test has problems it is not immediate to study it by hand (or for example with gdb) since when waf runs it the library path is created dynamically by waf depending on the dependencies. \r\nThis patch adds a new parameter ut_dumpenv which, if specified, is the name of a file (created where the test is executed, that is the test cwd) that will contain all the environment used by the test execution. This can be then sourced/exported to easily run the tests in the same environment they are run by waf. It was tested also with pytest where the PYTHONPATH has the same issues.\r\nExample usage:\r\n\r\n`bld.program(source='test/unit_test.cpp', includes=['src/'] , use=['GTEST','ex-lib-c'], target='unit_test', features='test', ut_dumpenv='envdump1.txt')`\r\n\r\nWill create envdump1.txt with the various variables in build directory (which will properly set LD_LIBRARY_PATH to find the dependant libraries referenced in use)\r\n"},"comment":{"url":"https://api.github.com/repos/waf-project/waf/issues/comments/261857841","html_url":"https://github.com/waf-project/waf/pull/1852#issuecomment-261857841","issue_url":"https://api.github.com/repos/waf-project/waf/issues/1852","id":261857841,"user":{"login":"fedepell","id":19709142,"avatar_url":"https://avatars.githubusercontent.com/u/19709142?v=3","gravatar_id":"","url":"https://api.github.com/users/fedepell","html_url":"https://github.com/fedepell","followers_url":"https://api.github.com/users/fedepell/followers","following_url":"https://api.github.com/users/fedepell/following{/other_user}","gists_url":"https://api.github.com/users/fedepell/gists{/gist_id}","starred_url":"https://api.github.com/users/fedepell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedepell/subscriptions","organizations_url":"https://api.github.com/users/fedepell/orgs","repos_url":"https://api.github.com/users/fedepell/repos","events_url":"https://api.github.com/users/fedepell/events{/privacy}","received_events_url":"https://api.github.com/users/fedepell/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T06:51:56Z","updated_at":"2016-11-21T06:51:56Z","body":"\r\nThanks for the feedback! OK I'll put the suggested fixes in a new PR, no problem.\r\n\r\nFor the questions pending.\r\n\r\nThe script command line are to execute it easily with additional tools. For example to start it with gdb (or gdb on a core dump) or so. Without the command line arguments the user should edit the generated python file and change the execution parameters which I believe is not very handy especially if you want first to run it with gdb, then maybe manually with valgrind or some other tool.\r\n\r\nThe UT_CMDLINE is indeed just a helper for that: now when you execute it with command line arguments you don't have anymore the original command line, as the arguments are used instead of it. Using $UT_CMDLINE you can retrieve the original execution arguments (and use it after your custom gdb or whatever call)\r\n\r\n"}}
{"actor":{"display_login":"fedepell"}}