Merge lp:~aacid/unity-2d/unity-2d-shell_get_shape_builddir into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Albert Astals Cid on 2012-01-27
Status: Merged
Approved by: Gerry Boland on 2012-01-30
Approved revision: 946
Merged at revision: 944
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell_get_shape_builddir
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 35 lines (+7/-6)
2 files modified
tests/run-tests.rb (+6/-5)
tests/shell/input_shaping.rb (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell_get_shape_builddir
Reviewer Review Type Date Requested Status
Gerry Boland 2012-01-27 Approve on 2012-01-30
Ugo Riboni 2012-01-27 Pending
MichaƂ Sawicz 2012-01-27 Pending
Review via email: mp+90462@code.launchpad.net

Description of the Change

[test] Use the proper way to get the path to the built binary

To post a comment you must log in.
Gerry Boland (gerboland) wrote :

Would be cleaner to have the binary_dir in run-tests.rb a global constant so all tests can use it.

You can use the 'system' call, because we need to figure out a way to have additional test utilities on the system-under-test, so enforcing $SUT.execute_shell_command is pointless just now in this case.

review: Needs Fixing
Albert Astals Cid (aacid) wrote :

I converted binary_dir into a constant so it can be used in input_shaping.rb

945. By Albert Astals Cid on 2012-01-30

Make binary_dir a constant

946. By Albert Astals Cid on 2012-01-30

remove "warning: already initialized constant BINARY_DIR"

Gerry Boland (gerboland) wrote :

Nice! Thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/run-tests.rb'
2--- tests/run-tests.rb 2012-01-27 08:53:59 +0000
3+++ tests/run-tests.rb 2012-01-30 08:59:27 +0000
4@@ -42,12 +42,13 @@
5 # installed applications instead
6 binary_dir_file = $library_path + '/../binary_dir.txt'
7 if File.exists?(binary_dir_file)
8- binary_dir = File.open(binary_dir_file).first.strip
9- puts 'Running tests on applications contained within ' + binary_dir
10- UNITY_2D_SHELL = binary_dir + '/shell/app/unity-2d-shell'
11- UNITY_2D_PANEL = binary_dir + '/panel/app/unity-2d-panel'
12- UNITY_2D_SPREAD = binary_dir + '/spread/app/unity-2d-spread'
13+ BINARY_DIR = File.open(binary_dir_file).first.strip
14+ puts 'Running tests on applications contained within ' + BINARY_DIR
15+ UNITY_2D_SHELL = BINARY_DIR + '/shell/app/unity-2d-shell'
16+ UNITY_2D_PANEL = BINARY_DIR + '/panel/app/unity-2d-panel'
17+ UNITY_2D_SPREAD = BINARY_DIR + '/spread/app/unity-2d-spread'
18 else
19+ BINARY_DIR = ""
20 puts 'NOTICE: source not configured, tests will be carried out on *installed* applications!'
21 UNITY_2D_SHELL = 'unity-2d-shell'
22 UNITY_2D_PANEL = 'unity-2d-panel'
23
24=== modified file 'tests/shell/input_shaping.rb'
25--- tests/shell/input_shaping.rb 2012-01-20 13:32:37 +0000
26+++ tests/shell/input_shaping.rb 2012-01-30 08:59:27 +0000
27@@ -56,7 +56,7 @@
28
29 # Get the shape of the shell window using our custom tool
30 maskpath = tempfilename('shape', '.png')
31- out = %x{#{pwd}/../getshape/getshape #{shell_id} #{maskpath}}
32+ out = %x{#{BINARY_DIR}/tests/getshape/getshape #{shell_id} #{maskpath}}
33 assert($?.exitstatus == 0, "Failed to call getshape to get the shape of the window")
34 return maskpath
35 end

Subscribers

People subscribed via source and target branches