| 8 | | azawawi just for you |
| 9 | | [[Image(syntax_issue.png)]] |
| 10 | | |
| 11 | | {{{#!perl |
| 12 | | |
| 13 | | |
| 14 | | sub on_run_this_test { |
| 15 | | my $self = shift; |
| 16 | | my $document = $self->current->document; |
| 17 | | unless ($document) { |
| 18 | | return $self->error( Wx::gettext("No document open") ); |
| 19 | | } |
| 20 | | |
| 21 | | # TO DO probably should fetch the current project name |
| 22 | | my $filename = defined( $document->{file} ) ? $document->{file}->filename : undef; |
| 23 | | unless ($filename) { |
| 24 | | return $self->error( Wx::gettext("Current document has no filename") ); |
| 25 | | } |
| 26 | | unless ( $filename =~ /\.t$/ ) { |
| 27 | | return $self->error( Wx::gettext("Current document is not a .t file") ); |
| 28 | | } |
| 29 | | |
| 30 | | # Find the project |
| 31 | | my $project_dir = $document->project_dir; |
| 32 | | unless ($project_dir) { |
| 33 | | return $self->error( Wx::gettext("Could not find project root") ); |
| 34 | | } |
| 35 | | |
| 36 | | my $dir = Cwd::cwd; |
| 37 | | chdir $project_dir; |
| 38 | | require File::Which; |
| 39 | | my $prove = File::Which::which('prove'); |
| 40 | | if (Padre::Constant::WIN32) { |
| 41 | | |
| 42 | | # This is needed since prove does not work with path containing |
| 43 | | # spaces. Please see ticket:582 |
| 44 | | require File::Temp; |
| 45 | | my $tempfile = File::Temp->new( UNLINK => 0 ); |
| 46 | | print $tempfile $filename; |
| 47 | | close $tempfile; |
| 48 | | |
| 49 | | my $things_to_test = $tempfile->filename; |
| 50 | | $self->run_command(qq{"$prove" - -lv < "$things_to_test"}); |
| 51 | | } else { |
| 52 | | $self->run_command("$prove -lv $filename"); |
| 53 | | } |
| 54 | | chdir $dir; |
| 55 | | } |
| 56 | | |
| 57 | | |
| 58 | | }}} |
| 59 | | |
| 60 | | |
| 61 | | |
| 62 | | == Tickets == |
| 63 | | just adjust the item to find open defects |
| 64 | | * current summary~=plugin |
| 65 | | [[TicketQuery(summary~=plugin,status=new,type=defect,order=version,desc=0,format=table,col=type|version|summary|owner|reporter|time)]] |
| 66 | | ---- |