Skip to content

Commit f3a1b57

Browse files
committed
Merge branch 'dev'
2 parents 4c36c23 + a9cdb29 commit f3a1b57

30 files changed

+825
-46
lines changed

.travis.php.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xdebug.remote_enable=1

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ language: python
22
python:
33
- "2.6"
44
- "2.7"
5+
rvm: 1.9.3
6+
notifications:
7+
irc: "irc.freenode.org#vdebug"
8+
before_install:
9+
- sudo apt-get update && sudo apt-get install vim-gtk php5-cli php5-xdebug
10+
before_script:
11+
- "export DISPLAY=:99.0"
12+
- "sh -e /etc/init.d/xvfb start"
13+
- "bundle install"
514
# command to install dependencies
6-
install: "pip install -r requirements.txt --use-mirrors"
15+
install: pip install -r requirements.txt --use-mirrors
716
# command to run tests
8-
script: python vdebugtests.py
17+
script: bundle exec rake travis

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rake', '~> 10.0.4'
4+
gem 'rspec', '~> 2.13.0'
5+
gem 'vimrunner', '~> 0.3.0'
6+
gem 'cucumber'

Gemfile.lock

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
builder (3.2.2)
5+
cucumber (1.3.3)
6+
builder (>= 2.1.2)
7+
diff-lcs (>= 1.1.3)
8+
gherkin (~> 2.12.0)
9+
multi_json (~> 1.7.5)
10+
multi_test (~> 0.0.1)
11+
diff-lcs (1.2.4)
12+
gherkin (2.12.0)
13+
multi_json (~> 1.3)
14+
multi_json (1.7.7)
15+
multi_test (0.0.1)
16+
rake (10.0.4)
17+
rspec (2.13.0)
18+
rspec-core (~> 2.13.0)
19+
rspec-expectations (~> 2.13.0)
20+
rspec-mocks (~> 2.13.0)
21+
rspec-core (2.13.1)
22+
rspec-expectations (2.13.0)
23+
diff-lcs (>= 1.1.3, < 2.0)
24+
rspec-mocks (2.13.1)
25+
vimrunner (0.3.0)
26+
27+
PLATFORMS
28+
ruby
29+
30+
DEPENDENCIES
31+
cucumber
32+
rake (~> 10.0.4)
33+
rspec (~> 2.13.0)
34+
vimrunner (~> 0.3.0)

Rakefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
require 'rspec/core/rake_task'
2+
require 'cucumber'
3+
require 'cucumber/rake/task'
4+
5+
task :travis do
6+
system("export DISPLAY=:99.0 && bundle exec rake test:all")
7+
raise "Tests failed!" unless $?.exitstatus == 0
8+
end
9+
10+
namespace :test do
11+
desc "Run all tests (unit and integration/specs)"
12+
task :all do
13+
puts "Running unit tests"
14+
Rake::Task["test:unit"].execute
15+
puts "Running integration (spec) tests"
16+
Rake::Task[:spec].execute
17+
puts "Running cucumber features"
18+
Rake::Task[:features].execute
19+
end
20+
21+
desc "Run unit tests"
22+
task :unit do
23+
cmd = "python vdebugtests.py"
24+
puts cmd
25+
system cmd
26+
end
27+
28+
desc "Run integration tests (alias for `spec`)"
29+
task :integration do
30+
Rake::Task[:spec]
31+
end
32+
end
33+
34+
RSpec::Core::RakeTask.new(:spec)
35+
Cucumber::Rake::Task.new(:features) do |t|
36+
t.cucumber_opts = "features --format pretty"
37+
end
38+
39+
task :default => "test:all"

doc/Vdebug.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,16 @@ the "pydbgp" tool, created by ActiveState (who make the Komodo Edit/IDE
240240
software).
241241

242242
To do this, go to http://code.activestate.com/komodo/remotedebugging/,
243-
download the Python client for your OS and extract it. Inside this package is
244-
a binary file called pydbgp that we can include when running a script, which
245-
will allow for remote debugging.
243+
download the Python client for your OS and extract it.
246244

247-
If we want to debug a script called "myscript.py", run the following: >
245+
Inside this package is a binary file called pydbgp that we can include when
246+
running a script, which will allow for remote debugging. If you're using
247+
version 8 or greater, then you will need to move the dbgp directory, which is
248+
inside pythonlib, to the same directory that contains the pydbgp executable.
249+
If you don't do this then you will get an error saying "No module named
250+
dbgp.client".
251+
252+
To debug a script called "myscript.py", run the following: >
248253
python -S path/to/pydbgp -d localhost:9000 myscript.py
249254
<
250255
adding in the path to the pydbgp binary file. Running it without starting
@@ -254,10 +259,12 @@ this, you're ready to go.
254259
NOTE: You may have a problem when trying to do an "eval". If you get an error
255260
mentioning something about not providing a length then you need to patch the
256261
client.py file in the Python remote debugger source code. I've created a patch
257-
that you can get at https://gist.github.com/3348076 - if using unix you can use
258-
the patch command to apply it, e.g: >
262+
that you can get at https://gist.github.com/3348076. It will only apply cleanly
263+
if it's for the same version as the package you downloaded.
264+
265+
If using unix you can use the `patch` command to apply the changes, e.g: >
259266

260-
patch dbgp/client.py < client.patch
267+
patch dbgp/client.py < client-7.1.0.patch
261268
<
262269
If you're still having trouble, drop me an email.
263270

features/correct_window_setup.feature

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Feature: Correct window setup
2+
In order to use Vdebug with all window panels
3+
As a user
4+
I want to see correct watch, stack and status information
5+
6+
Scenario: The status window
7+
Given I have a file example.php containing
8+
"""
9+
<?php
10+
$var1 = 1;
11+
?>
12+
"""
13+
When I start the debugger with the PHP script example.php
14+
Then the status should be break
15+
And the status window should contain localhost:9000
16+
17+
Scenario: The watch window
18+
Given I have a file example.php containing
19+
"""
20+
<?php
21+
$var1 = 1;
22+
$var2 = array("hello", "world");
23+
?>
24+
"""
25+
And I start the debugger with the PHP script example.php
26+
When I step over
27+
Then the watch window should show $var1
28+
And the watch window should show $var2
29+
And the watch window variable $var1 should be (int) 1
30+
And the watch window variable $var2 should be (uninitialized)
31+
32+
Scenario: The stack window
33+
Given I have a file example.php containing
34+
"""
35+
<?php
36+
$var1 = 1;
37+
$var2 = array("hello", "world");
38+
?>
39+
"""
40+
And I start the debugger with the PHP script example.php
41+
When I step over
42+
Then the first item on the stack should show the file example.php
43+
And the first item on the stack should show line 3
44+
45+
Scenario: Reading the stack window with multiple files
46+
Given I have a file example.php containing
47+
"""
48+
<?php
49+
include "example2.php";
50+
?>
51+
"""
52+
And I have a file example2.php containing
53+
"""
54+
<?php
55+
$var1 = 1;
56+
$var2 = array("hello", "world");
57+
?>
58+
"""
59+
And I start the debugger with the PHP script example.php
60+
When I step in
61+
Then item 1 on the stack should show the file example2.php
62+
And item 1 on the stack should show line 2
63+
And item 2 on the stack should show the file example.php
64+
And item 2 on the stack should show line 2

features/eval.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Feature: Evaluating expressions
2+
In order to evaluate variables in Vdebug
3+
As a user
4+
I want to see the evaluated variable in the watch window
5+
6+
Scenario: Evaluating a PHP expression
7+
Given I have a file example.php containing
8+
"""
9+
<?php
10+
$var1 = 1;
11+
?>
12+
"""
13+
And I start the debugger with the PHP script example.php
14+
When I evaluate $var1
15+
Then the watch window should show Eval of: '$var1'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
When "I step over" do
2+
vdebug.step_over
3+
vdebug.running?.should be(true), 'Vdebug is not running'
4+
end
5+
6+
When "I step in" do
7+
vdebug.step_in
8+
vdebug.running?.should be(true), 'Vdebug is not running'
9+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
When "I evaluate $expression" do |expr|
2+
vdebug.evaluate expr
3+
vdebug.running?.should be(true), 'Vdebug is not running'
4+
end

0 commit comments

Comments
 (0)