Merge lp:~aacid/unity-2d/unity-2d_test_common_definitions into lp:unity-2d
Proposed by
Albert Astals Cid
on 2012-01-26
| Status: | Merged |
|---|---|
| Approved by: | Gerry Boland on 2012-01-26 |
| Approved revision: | 871 |
| Merged at revision: | 869 |
| Proposed branch: | lp:~aacid/unity-2d/unity-2d_test_common_definitions |
| Merge into: | lp:unity-2d |
| Diff against target: |
265 lines (+32/-29) 5 files modified
tests/launcher/always_visible_tests.rb (+2/-3) tests/launcher/autohide_show_tests.rb (+24/-25) tests/launcher/launcher_sizing.rb (+0/-1) tests/misc/lib/definitions.rb (+3/-0) tests/run-tests.rb (+3/-0) |
| To merge this branch: | bzr merge lp:~aacid/unity-2d/unity-2d_test_common_definitions |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gerry Boland | 2012-01-26 | Approve on 2012-01-26 | |
|
Review via email:
|
|||
Description of the Change
[test] Add a file with the common definitions of variables
To post a comment you must log in.
| Albert Astals Cid (aacid) wrote : | # |
Makes sense, included in run-tests.rb
lp:~aacid/unity-2d/unity-2d_test_common_definitions
updated
on 2012-01-26
- 871. By Albert Astals Cid on 2012-01-26
-
Include definitions.rb from run-tests.rb as suggested by Gerry


This is great, thank you.
Suggestions:
1. Would it not make sense to include the definitions.rb file in run-tests.rb? I don't see it causing problems
2. If you disagree with 1, then I want to point out the following:
In Ruby1.8, require is pretty stupid. Whenever you require a file, it keeps a list of the files you 'require' to prevent you requiring the same file twice. Great! But the way it does this is naive. In your case it saves $PWD + '../misc/ definitions. rb' -> '/home/ you/dev/ unity-2d- shell/tests/ launcher/ ../misc/ definitions. rb'
Now for a test in the tests/places directory, if you do the same require statement, require considers '/home/ you/dev/ unity-2d- shell/tests/ places/ ../misc/ definitions. rb' which doesn't match anything in the list, so the file gets required again, and you get constant redefined warnings.
Ruby1.9 fixes this. But we're stuck with 1.8 for now (Testability has't been ported to 1.9).
Solution: require $library_path + '/misc/ definitions. rb'