Skip to content

Commit 311b9e2

Browse files
committed
tests: implement restart testing (actual option still missing)
1 parent 622b94f commit 311b9e2

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

testcases/lib/SocketActivation.pm

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ sub activate_i3 {
9292
my $outdir = $args{outdir};
9393
my $test = $args{testname};
9494

95+
if ($args{restart}) {
96+
$i3cmd .= ' -L ' . abs_path('restart-state.golden');
97+
}
98+
9599
if ($args{valgrind}) {
96100
$i3cmd =
97101
qq|valgrind -v --log-file="$outdir/valgrind-for-$test.log" | .

testcases/lib/TestWorker.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ sub worker_wait {
101101
$test->failure_output(\*STDERR);
102102
$test->todo_output(\*STDOUT);
103103

104-
@ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE COVERAGE)}
105-
= ($self->{display}, basename($file), $outdir, 0, 0, 0);
104+
@ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE COVERAGE RESTART)}
105+
= ($self->{display}, basename($file), $outdir, 0, 0, 0, 0);
106106

107107
package main;
108108
local $@;

testcases/lib/i3test.pm

+1
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ sub launch_with_config {
505505
testname => $ENV{TESTNAME},
506506
valgrind => $ENV{VALGRIND},
507507
strace => $ENV{STRACE},
508+
restart => $ENV{RESTART},
508509
cv => $cv,
509510
);
510511

testcases/restart-state.golden

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":6752976,"type":0,"orientation":"none","percent":null,"urgent":false,"focused":false,"layout":"default","border":"none","rect":{"x":0,"y":0,"width":1280,"height":1024},"window_rect":{"x":0,"y":0,"width":0,"height":0},"geometry":{"x":0,"y":0,"width":0,"height":0},"name":"root","window":null,"nodes":[{"id":6809472,"type":1,"orientation":"none","percent":1,"urgent":false,"focused":false,"layout":"output","border":"none","rect":{"x":0,"y":0,"width":1280,"height":1024},"window_rect":{"x":0,"y":0,"width":0,"height":0},"geometry":{"x":0,"y":0,"width":0,"height":0},"name":"xroot-0","window":null,"nodes":[{"id":6810064,"type":5,"orientation":"vertical","percent":null,"urgent":false,"focused":false,"layout":"dockarea","border":"none","rect":{"x":0,"y":0,"width":1280,"height":0},"window_rect":{"x":0,"y":0,"width":0,"height":0},"geometry":{"x":0,"y":0,"width":0,"height":0},"name":"topdock","window":null,"nodes":[],"floating_nodes":[],"focus":[],"fullscreen_mode":0,"swallows":[{"dock":2,"insert_where":2}]},{"id":6831664,"type":2,"orientation":"none","percent":null,"urgent":false,"focused":false,"layout":"default","border":"none","rect":{"x":0,"y":0,"width":1280,"height":1024},"window_rect":{"x":0,"y":0,"width":0,"height":0},"geometry":{"x":0,"y":0,"width":0,"height":0},"name":"content","window":null,"nodes":[{"id":6832880,"type":4,"orientation":"horizontal","percent":null,"urgent":false,"focused":true,"layout":"default","border":"none","rect":{"x":0,"y":0,"width":1280,"height":1024},"window_rect":{"x":0,"y":0,"width":0,"height":0},"geometry":{"x":0,"y":0,"width":0,"height":0},"name":"1","num":1,"window":null,"nodes":[],"floating_nodes":[],"focus":[],"fullscreen_mode":1,"swallows":[]}],"floating_nodes":[],"focus":[6832880],"fullscreen_mode":0,"swallows":[]},{"id":6832224,"type":5,"orientation":"vertical","percent":null,"urgent":false,"focused":false,"layout":"dockarea","border":"none","rect":{"x":0,"y":1024,"width":1280,"height":0},"window_rect":{"x":0,"y":0,"width":0,"height":0},"geometry":{"x":0,"y":0,"width":0,"height":0},"name":"bottomdock","window":null,"nodes":[],"floating_nodes":[],"focus":[],"fullscreen_mode":0,"swallows":[{"dock":3,"insert_where":2}]}],"floating_nodes":[],"focus":[6831664,6810064,6832224],"fullscreen_mode":0,"swallows":[]}],"floating_nodes":[],"focus":[6809472],"fullscreen_mode":0,"swallows":[]}

0 commit comments

Comments
 (0)