]> git.sur5r.net Git - i3/i3/commitdiff
tests: implement restart testing (actual option still missing)
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 21 Dec 2011 23:15:06 +0000 (23:15 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 21 Dec 2011 23:15:30 +0000 (23:15 +0000)
testcases/lib/SocketActivation.pm
testcases/lib/TestWorker.pm
testcases/lib/i3test.pm
testcases/restart-state.golden [new file with mode: 0644]

index 361977940e33c6f0c7a7279607914579e9fdc259..0dadad750edeccf4c28a505a1f83aae226a52eca 100644 (file)
@@ -92,6 +92,10 @@ sub activate_i3 {
         my $outdir = $args{outdir};
         my $test = $args{testname};
 
+        if ($args{restart}) {
+            $i3cmd .= ' -L ' . abs_path('restart-state.golden');
+        }
+
         if ($args{valgrind}) {
             $i3cmd =
                 qq|valgrind -v --log-file="$outdir/valgrind-for-$test.log" | .
index 855396263994c7fa4767bc03890366cc7ecf0949..dcb39ebcee362d246995e4d22c4ee0ab8da9f1fb 100644 (file)
@@ -101,8 +101,8 @@ sub worker_wait {
             $test->failure_output(\*STDERR);
             $test->todo_output(\*STDOUT);
 
-            @ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE COVERAGE)}
-                = ($self->{display}, basename($file), $outdir, 0, 0, 0);
+            @ENV{qw(DISPLAY TESTNAME OUTDIR VALGRIND STRACE COVERAGE RESTART)}
+                = ($self->{display}, basename($file), $outdir, 0, 0, 0, 0);
 
             package main;
             local $@;
index aecec5342ea7e1b5d52d928c7999605c6dc700b3..0f4b97c6b65601234ef95b24dbd5fb1fca5633d3 100644 (file)
@@ -505,6 +505,7 @@ sub launch_with_config {
         testname => $ENV{TESTNAME},
         valgrind => $ENV{VALGRIND},
         strace => $ENV{STRACE},
+        restart => $ENV{RESTART},
         cv => $cv,
     );
 
diff --git a/testcases/restart-state.golden b/testcases/restart-state.golden
new file mode 100644 (file)
index 0000000..bca4495
--- /dev/null
@@ -0,0 +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":[]}
\ No newline at end of file