diff --git a/test/bg_451x500_center.png b/test/bg/exact/h/center similarity index 100% rename from test/bg_451x500_center.png rename to test/bg/exact/h/center diff --git a/test/bg_451x500_fill.png b/test/bg/exact/h/fill similarity index 100% rename from test/bg_451x500_fill.png rename to test/bg/exact/h/fill diff --git a/test/bg_451x500.png b/test/bg/exact/h/in similarity index 100% rename from test/bg_451x500.png rename to test/bg/exact/h/in diff --git a/test/bg/exact/h/max b/test/bg/exact/h/max new file mode 120000 index 0000000000000000000000000000000000000000..0a90d85548348e7839c70878d360fa7d04b19245 --- /dev/null +++ b/test/bg/exact/h/max @@ -0,0 +1 @@ +center \ No newline at end of file diff --git a/test/bg_451x500_scale.png b/test/bg/exact/h/scale similarity index 100% rename from test/bg_451x500_scale.png rename to test/bg/exact/h/scale diff --git a/test/bg_451x500_tile.png b/test/bg/exact/h/tile similarity index 100% rename from test/bg_451x500_tile.png rename to test/bg/exact/h/tile diff --git a/test/bg.png b/test/bg/exact/in similarity index 100% rename from test/bg.png rename to test/bg/exact/in diff --git a/test/bg_all.png b/test/bg/exact/out similarity index 100% rename from test/bg_all.png rename to test/bg/exact/out diff --git a/test/bg_500x333_center.png b/test/bg/exact/w/center similarity index 100% rename from test/bg_500x333_center.png rename to test/bg/exact/w/center diff --git a/test/bg_500x333_fill.png b/test/bg/exact/w/fill similarity index 100% rename from test/bg_500x333_fill.png rename to test/bg/exact/w/fill diff --git a/test/bg_500x333.png b/test/bg/exact/w/in similarity index 100% rename from test/bg_500x333.png rename to test/bg/exact/w/in diff --git a/test/bg/exact/w/max b/test/bg/exact/w/max new file mode 120000 index 0000000000000000000000000000000000000000..0a90d85548348e7839c70878d360fa7d04b19245 --- /dev/null +++ b/test/bg/exact/w/max @@ -0,0 +1 @@ +center \ No newline at end of file diff --git a/test/bg_500x333_scale.png b/test/bg/exact/w/scale similarity index 100% rename from test/bg_500x333_scale.png rename to test/bg/exact/w/scale diff --git a/test/bg_500x333_tile.png b/test/bg/exact/w/tile similarity index 100% rename from test/bg_500x333_tile.png rename to test/bg/exact/w/tile diff --git a/test/bg_large_h_center.png b/test/bg/large/h/center similarity index 100% rename from test/bg_large_h_center.png rename to test/bg/large/h/center diff --git a/test/bg_large_h_fill.png b/test/bg/large/h/fill similarity index 100% rename from test/bg_large_h_fill.png rename to test/bg/large/h/fill diff --git a/test/bg_large_h.png b/test/bg/large/h/in similarity index 100% rename from test/bg_large_h.png rename to test/bg/large/h/in diff --git a/test/bg_large_h_max.png b/test/bg/large/h/max similarity index 100% rename from test/bg_large_h_max.png rename to test/bg/large/h/max diff --git a/test/bg_large_h_scale.png b/test/bg/large/h/scale similarity index 100% rename from test/bg_large_h_scale.png rename to test/bg/large/h/scale diff --git a/test/bg_large_h_tile.png b/test/bg/large/h/tile similarity index 100% rename from test/bg_large_h_tile.png rename to test/bg/large/h/tile diff --git a/test/bg_large_w_center.png b/test/bg/large/w/center similarity index 100% rename from test/bg_large_w_center.png rename to test/bg/large/w/center diff --git a/test/bg_large_w_fill.png b/test/bg/large/w/fill similarity index 100% rename from test/bg_large_w_fill.png rename to test/bg/large/w/fill diff --git a/test/bg_large_w.png b/test/bg/large/w/in similarity index 100% rename from test/bg_large_w.png rename to test/bg/large/w/in diff --git a/test/bg_large_w_max.png b/test/bg/large/w/max similarity index 100% rename from test/bg_large_w_max.png rename to test/bg/large/w/max diff --git a/test/bg_large_w_scale.png b/test/bg/large/w/scale similarity index 100% rename from test/bg_large_w_scale.png rename to test/bg/large/w/scale diff --git a/test/bg_large_w_tile.png b/test/bg/large/w/tile similarity index 100% rename from test/bg_large_w_tile.png rename to test/bg/large/w/tile diff --git a/test/bg_small_h_center.png b/test/bg/small/h/center similarity index 100% rename from test/bg_small_h_center.png rename to test/bg/small/h/center diff --git a/test/bg_small_h_fill.png b/test/bg/small/h/fill similarity index 100% rename from test/bg_small_h_fill.png rename to test/bg/small/h/fill diff --git a/test/bg_small_h.png b/test/bg/small/h/in similarity index 100% rename from test/bg_small_h.png rename to test/bg/small/h/in diff --git a/test/bg_small_h_max.png b/test/bg/small/h/max similarity index 100% rename from test/bg_small_h_max.png rename to test/bg/small/h/max diff --git a/test/bg_small_h_scale.png b/test/bg/small/h/scale similarity index 100% rename from test/bg_small_h_scale.png rename to test/bg/small/h/scale diff --git a/test/bg_small_h_tile.png b/test/bg/small/h/tile similarity index 100% rename from test/bg_small_h_tile.png rename to test/bg/small/h/tile diff --git a/test/bg_small_w_center.png b/test/bg/small/w/center similarity index 100% rename from test/bg_small_w_center.png rename to test/bg/small/w/center diff --git a/test/bg_small_w_fill.png b/test/bg/small/w/fill similarity index 100% rename from test/bg_small_w_fill.png rename to test/bg/small/w/fill diff --git a/test/bg_small_w.png b/test/bg/small/w/in similarity index 100% rename from test/bg_small_w.png rename to test/bg/small/w/in diff --git a/test/bg_small_w_max.png b/test/bg/small/w/max similarity index 100% rename from test/bg_small_w_max.png rename to test/bg/small/w/max diff --git a/test/bg_small_w_scale.png b/test/bg/small/w/scale similarity index 100% rename from test/bg_small_w_scale.png rename to test/bg/small/w/scale diff --git a/test/bg_small_w_tile.png b/test/bg/small/w/tile similarity index 100% rename from test/bg_small_w_tile.png rename to test/bg/small/w/tile diff --git a/test/bg_451x500_max.png b/test/bg_451x500_max.png deleted file mode 120000 index 47218274f420e56352920254e57219be2d648dab..0000000000000000000000000000000000000000 --- a/test/bg_451x500_max.png +++ /dev/null @@ -1 +0,0 @@ -bg_451x500_center.png \ No newline at end of file diff --git a/test/bg_500x333_max.png b/test/bg_500x333_max.png deleted file mode 120000 index 13547b7b1424dd8296ea441e181f557c54961bb4..0000000000000000000000000000000000000000 --- a/test/bg_500x333_max.png +++ /dev/null @@ -1 +0,0 @@ -bg_500x333_center.png \ No newline at end of file diff --git a/test/customlist b/test/customlist deleted file mode 100644 index 3595be4d78194d5adce2c8a3c8955f60f305e1da..0000000000000000000000000000000000000000 --- a/test/customlist +++ /dev/null @@ -1,4 +0,0 @@ -test/ok.gif; 16; 4; list; ok.gif; 256; 953; gif; 0; 16 -test/ok.jpg; 16; 4; list; ok.jpg; 256; 354; jpeg; 0; 16 -test/ok.png; 16; 4; list; ok.png; 256; 403; png; 0; 16 -test/ok.pnm; 16; 4; list; ok.pnm; 256; 269; pnm; 0; 16 diff --git a/test/fail.gif b/test/fail/gif similarity index 100% rename from test/fail.gif rename to test/fail/gif diff --git a/test/fail.jpg b/test/fail/jpg similarity index 100% rename from test/fail.jpg rename to test/fail/jpg diff --git a/test/fail.png b/test/fail/png similarity index 100% rename from test/fail.png rename to test/fail/png diff --git a/test/fail.pnm b/test/fail/pnm similarity index 100% rename from test/fail.pnm rename to test/fail/pnm diff --git a/test/feh-bg.i b/test/feh-bg.i index 63aecda8849cec9f0b34db2310b7df058177ce57..1cfb43f5a8f3fc0392dd5aaddff850750eb19fa1 100755 --- a/test/feh-bg.i +++ b/test/feh-bg.i @@ -10,11 +10,9 @@ use Time::HiRes qw/sleep/; sub set_bg { my ($mode, $file) = @_; - $file //= 'bg.png'; - ok( - system("feh --bg-${mode} test/${file}") == 0, - "Ran feh --bg-${mode} test/${file}" + system("feh --bg-${mode} test/bg/${file}") == 0, + "Ran feh --bg-${mode} test/bg/${file}" ); } @@ -33,32 +31,24 @@ sub check_bg { system("import -silent -window root /tmp/feh_${$}.png"); ok( - same_files("test/${file}", "/tmp/feh_${$}.png"), - "Wallpaper is test/${file}" + same_files("test/bg/${file}", "/tmp/feh_${$}.png"), + "Wallpaper is test/bg/${file}" ); } for my $mode (qw( center fill max scale tile )) { - set_bg($mode); - check_bg('bg_all.png'); - - set_bg($mode, 'bg_500x333.png'); - check_bg("bg_500x333_${mode}.png"); - - set_bg($mode, 'bg_451x500.png'); - check_bg("bg_451x500_${mode}.png"); - set_bg($mode, 'bg_small_w.png'); - check_bg("bg_small_w_${mode}.png"); + set_bg($mode, 'exact/in'); + check_bg('exact/out'); - set_bg($mode, 'bg_small_h.png'); - check_bg("bg_small_h_${mode}.png"); + for my $type (qw( exact small large )) { + for my $orientation (qw( w h )) { - set_bg($mode, 'bg_large_w.png'); - check_bg("bg_large_w_${mode}.png"); + set_bg($mode, "${type}/${orientation}/in"); + check_bg("${type}/${orientation}/${mode}"); - set_bg($mode, 'bg_large_h.png'); - check_bg("bg_large_h_${mode}.png"); + } + } } unlink("/tmp/feh_${$}.png"); diff --git a/test/feh.i b/test/feh.i index 94ab1382fa8c1a97f87119eda28c0c448ad493b6..b45952ecd42e88db05db86aef518c8bb90a34744 100755 --- a/test/feh.i +++ b/test/feh.i @@ -30,7 +30,7 @@ sub feh_start { my $id; $opts //= q{}; - $files //= 'test/ok.png'; + $files //= 'test/ok/png'; StartApp("feh ${opts} ${files}"); ($id) = WaitWindowViewable(qr{^feh}); @@ -100,190 +100,190 @@ for my $key (qw/q x {ESC}/) { test_no_win("$key pressed"); } -$win = feh_start(q{}, 'test/ok.png'); -test_win_title($win, 'feh [1 of 1] - test/ok.png'); +$win = feh_start(q{}, 'test/ok/png'); +test_win_title($win, 'feh [1 of 1] - test/ok/png'); feh_stop(); -$win = feh_start(q{}, 'test/ok.png test/ok.jpg test/ok.gif'); -test_win_title($win, 'feh [1 of 3] - test/ok.png'); +$win = feh_start(q{}, 'test/ok/png test/ok/jpg test/ok/gif'); +test_win_title($win, 'feh [1 of 3] - test/ok/png'); SendKeys('{RIG}'); -test_win_title($win, 'feh [2 of 3] - test/ok.jpg'); +test_win_title($win, 'feh [2 of 3] - test/ok/jpg'); SendKeys('n'); -test_win_title($win, 'feh [3 of 3] - test/ok.gif'); +test_win_title($win, 'feh [3 of 3] - test/ok/gif'); SendKeys('{SPA}'); -test_win_title($win, 'feh [1 of 3] - test/ok.png'); +test_win_title($win, 'feh [1 of 3] - test/ok/png'); SendKeys('{LEF}'); -test_win_title($win, 'feh [3 of 3] - test/ok.gif'); +test_win_title($win, 'feh [3 of 3] - test/ok/gif'); SendKeys('p'); -test_win_title($win, 'feh [2 of 3] - test/ok.jpg'); +test_win_title($win, 'feh [2 of 3] - test/ok/jpg'); SendKeys('{BAC}'); -test_win_title($win, 'feh [1 of 3] - test/ok.png'); +test_win_title($win, 'feh [1 of 3] - test/ok/png'); SendKeys('p'); -test_win_title($win, 'feh [3 of 3] - test/ok.gif'); +test_win_title($win, 'feh [3 of 3] - test/ok/gif'); SendKeys('{DEL}'); -test_win_title($win, 'feh [1 of 2] - test/ok.png'); +test_win_title($win, 'feh [1 of 2] - test/ok/png'); SendKeys('{DEL}'); -test_win_title($win, 'feh [1 of 1] - test/ok.jpg'); +test_win_title($win, 'feh [1 of 1] - test/ok/jpg'); SendKeys('{DEL}'); test_no_win("Removed all images from slideshow"); $win = feh_start('--title \'feh %m %u/%l %n\'', - 'test/ok.png test/ok.jpg test/ok.gif'); -test_win_title($win, 'feh slideshow 1/3 ok.png'); + 'test/ok/png test/ok/jpg test/ok/gif'); +test_win_title($win, 'feh slideshow 1/3 png'); SendKeys('{RIG}'); -test_win_title($win, 'feh slideshow 2/3 ok.jpg'); +test_win_title($win, 'feh slideshow 2/3 jpg'); feh_stop(); -feh_start('--cycle-once', 'test/ok.png test/ok.jpg'); +feh_start('--cycle-once', 'test/ok/png test/ok/jpg'); for (1 .. 2) { SendKeys('{RIG}'); } test_no_win("--cycle-once -> window closed"); feh_start('--cycle-once --slideshow-delay 0.5', - 'test/ok.png test/ok.jpg test/ok.gif'); + 'test/ok/png test/ok/jpg test/ok/gif'); sleep(1.5); test_no_win('cycle-once + slideshow-delay -> window closed'); $win = feh_start('--cycle-once --slideshow-delay -0.01', - 'test/ok.png test/ok.jpg test/ok.gif'); + 'test/ok/png test/ok/jpg test/ok/gif'); -test_win_title($win, 'feh [1 of 3] - test/ok.png [Paused]'); +test_win_title($win, 'feh [1 of 3] - test/ok/png [Paused]'); SendKeys('h'); test_no_win('cycle-once + negative delay + [h]'); -$win = feh_start(q{}, 'test/ok.png test/ok.gif test/ok.gif test/ok.jpg'); +$win = feh_start(q{}, 'test/ok/png test/ok/gif test/ok/gif test/ok/jpg'); for (1 .. 2) { SendKeys('{END}'); - test_win_title($win, 'feh [4 of 4] - test/ok.jpg'); + test_win_title($win, 'feh [4 of 4] - test/ok/jpg'); } for (1 .. 2) { SendKeys('{HOM}'); - test_win_title($win, 'feh [1 of 4] - test/ok.png'); + test_win_title($win, 'feh [1 of 4] - test/ok/png'); } SendKeys('{PGU}'); -test_win_title($win, 'feh [4 of 4] - test/ok.jpg'); +test_win_title($win, 'feh [4 of 4] - test/ok/jpg'); SendKeys('{PGD}'); -test_win_title($win, 'feh [1 of 4] - test/ok.png'); +test_win_title($win, 'feh [1 of 4] - test/ok/png'); SendKeys('{PGD}'); -test_win_title($win, 'feh [2 of 4] - test/ok.gif'); +test_win_title($win, 'feh [2 of 4] - test/ok/gif'); feh_stop(); -$win = feh_start('--slideshow-delay 1', 'test/ok.png test/ok.gif test/ok.jpg'); +$win = feh_start('--slideshow-delay 1', 'test/ok/png test/ok/gif test/ok/jpg'); sleep(1.7); -test_win_title($win, 'feh [3 of 3] - test/ok.jpg'); +test_win_title($win, 'feh [3 of 3] - test/ok/jpg'); SendKeys('h'); -test_win_title($win, 'feh [3 of 3] - test/ok.jpg [Paused]'); +test_win_title($win, 'feh [3 of 3] - test/ok/jpg [Paused]'); SendKeys('{RIG}'); -test_win_title($win, 'feh [1 of 3] - test/ok.png [Paused]'); +test_win_title($win, 'feh [1 of 3] - test/ok/png [Paused]'); SendKeys('h'); -test_win_title($win, 'feh [1 of 3] - test/ok.png'); +test_win_title($win, 'feh [1 of 3] - test/ok/png'); sleep(0.8); -test_win_title($win, 'feh [2 of 3] - test/ok.gif'); +test_win_title($win, 'feh [2 of 3] - test/ok/gif'); feh_stop(); -$win = feh_start(q{}, 'test/ok.png ' x 100); -test_win_title($win, 'feh [1 of 100] - test/ok.png'); +$win = feh_start(q{}, 'test/ok/png ' x 100); +test_win_title($win, 'feh [1 of 100] - test/ok/png'); SendKeys('{PGD}'); -test_win_title($win, 'feh [6 of 100] - test/ok.png'); +test_win_title($win, 'feh [6 of 100] - test/ok/png'); SendKeys('{PGD}'); -test_win_title($win, 'feh [11 of 100] - test/ok.png'); +test_win_title($win, 'feh [11 of 100] - test/ok/png'); SendKeys('{HOM PGU}'); -test_win_title($win, 'feh [96 of 100] - test/ok.png'); +test_win_title($win, 'feh [96 of 100] - test/ok/png'); feh_stop(); $win = feh_start('--thumbnails -H 300 -W 310 --thumb-title "%P [%l] %f"', - 'test/ok.png test/ok.gif test/ok.jpg'); + 'test/ok/png test/ok/gif test/ok/jpg'); test_win_title($win, 'feh [thumbnail mode]'); ($width, $height) = (GetWindowPos($win))[2,3]; is($width, 310, 'thumbnail win: Set correct width'); is($height, 300, 'thumbnail win: Set correct height'); MoveMouseAbs(30, 30); ClickMouseButton(M_BTN1); -($win) = WaitWindowViewable(qr{test/ok\.png$}); +($win) = WaitWindowViewable(qr{test/ok/png$}); ok($win, 'Thumbnail mode: Window opened'); -test_win_title($win, 'feh [3] test/ok.png'); +test_win_title($win, 'feh [3] test/ok/png'); SetInputFocus($win); SendKeys('x'); -ok(waitfor { not FindWindowLike(qr{^ok\.png$}) }, 'Thumbnail mode: closed'); +ok(waitfor { not FindWindowLike(qr{^ok/png$}) }, 'Thumbnail mode: closed'); MoveMouseAbs(90, 30); ClickMouseButton(M_BTN1); -($win) = WaitWindowViewable(qr{test/ok\.gif$}); +($win) = WaitWindowViewable(qr{test/ok/gif$}); ok($win, 'Thumbnail mode: Window opened'); -test_win_title($win, 'feh [3] test/ok.gif'); +test_win_title($win, 'feh [3] test/ok/gif'); MoveMouseAbs(150,30); ClickMouseButton(M_BTN1); -($win) = WaitWindowViewable(qr{test/ok\.jpg$}); +($win) = WaitWindowViewable(qr{test/ok/jpg$}); ok($win, 'Thumbnail mode: Other window opened'); -test_win_title($win, 'feh [3] test/ok.jpg'); +test_win_title($win, 'feh [3] test/ok/jpg'); feh_stop(); -feh_start('--multiwindow', 'test/ok.png test/ok.gif test/ok.jpg'); -ok(waitfor { FindWindowLike(qr{^feh - test/ok\.png$}) }, 'multiwindow 1/3'); -ok(waitfor { FindWindowLike(qr{^feh - test/ok\.gif$}) }, 'multiwindow 2/3'); -ok(waitfor { FindWindowLike(qr{^feh - test/ok\.jpg$}) }, 'multiwindow 3/3'); +feh_start('--multiwindow', 'test/ok/png test/ok/gif test/ok/jpg'); +ok(waitfor { FindWindowLike(qr{^feh - test/ok/png$}) }, 'multiwindow 1/3'); +ok(waitfor { FindWindowLike(qr{^feh - test/ok/gif$}) }, 'multiwindow 2/3'); +ok(waitfor { FindWindowLike(qr{^feh - test/ok/jpg$}) }, 'multiwindow 3/3'); -($win) = FindWindowLike(qr{^feh - test/ok\.gif$}); +($win) = FindWindowLike(qr{^feh - test/ok/gif$}); SetInputFocus($win); SendKeys('x'); -ok(waitfor { not FindWindowLike(qr{^feh - test/ok\.gif$}) }, 'win 1 closed'); -ok(FindWindowLike(qr{^feh - test/ok\.png$}), 'multiwindow 1/2'); -ok(FindWindowLike(qr{^feh - test/ok\.jpg$}), 'multiwindow 2/2'); +ok(waitfor { not FindWindowLike(qr{^feh - test/ok/gif$}) }, 'win 1 closed'); +ok(FindWindowLike(qr{^feh - test/ok/png$}), 'multiwindow 1/2'); +ok(FindWindowLike(qr{^feh - test/ok/jpg$}), 'multiwindow 2/2'); -($win) = FindWindowLike(qr{^feh - test/ok\.jpg$}); +($win) = FindWindowLike(qr{^feh - test/ok/jpg$}); SetInputFocus($win); SendKeys('x'); -ok(waitfor { not FindWindowLike(qr{^feh - test/ok\.jpg$}) }, 'win 2 closed'); +ok(waitfor { not FindWindowLike(qr{^feh - test/ok/jpg$}) }, 'win 2 closed'); -($win) = FindWindowLike(qr{^feh - test/ok\.png$}); +($win) = FindWindowLike(qr{^feh - test/ok/png$}); SetInputFocus($win); SendKeys('x'); test_no_win('all multiwindows closed'); -$win = feh_start('--start-at test/ok.jpg', 'test/ok.png test/ok.gif test/ok.jpg'); -test_win_title($win, 'feh [3 of 3] - test/ok.jpg'); +$win = feh_start('--start-at test/ok/jpg', 'test/ok/png test/ok/gif test/ok/jpg'); +test_win_title($win, 'feh [3 of 3] - test/ok/jpg'); SendKeys('{RIG}'); -test_win_title($win, 'feh [1 of 3] - test/ok.png'); +test_win_title($win, 'feh [1 of 3] - test/ok/png'); feh_stop(); -feh_start('--caption-path .captions', 'test/ok.png'); +feh_start('--caption-path .captions', 'test/ok/png'); SendKeys('cFoo Bar Quux Moep~'); feh_stop(); -ok(-d 'test/.captions', 'autocreated captions directory'); -is(slurp('test/.captions/ok.png.txt'), 'Foo Bar Quux Moep', +ok(-d 'test/ok/.captions', 'autocreated captions directory'); +is(slurp('test/ok/.captions/png.txt'), 'Foo Bar Quux Moep', 'Correct caption saved'); -feh_start('--caption-path .captions', 'test/ok.png'); +feh_start('--caption-path .captions', 'test/ok/png'); SendKeys('c'); SendKeys('{BKS}' x length('Foo Bar Quux Moep')); SendKeys('Foo Bar^(~)miep~'); feh_stop(); -is(slurp('test/.captions/ok.png.txt'), "Foo Bar\nmiep", +is(slurp('test/ok/.captions/png.txt'), "Foo Bar\nmiep", 'Caption with newline + correct backspace'); -unlink('test/.captions/ok.png.txt'); -rmdir('test/.captions'); +unlink('test/ok/.captions/png.txt'); +rmdir('test/ok/.captions'); $win = feh_start('--filelist test/filelist', - 'test/ok.png test/ok.gif test/ok.png test/ok.jpg'); + 'test/ok/png test/ok/gif test/ok/png test/ok/jpg'); SendKeys('{DEL}'); -test_win_title($win, "feh [1 of 3] - ${pwd}/test/ok.gif"); +test_win_title($win, "feh [1 of 3] - ${pwd}/test/ok/gif"); feh_stop(); is(slurp('test/filelist'), <<"EOF", 'Filelist saved'); -${pwd}/test/ok.gif -${pwd}/test/ok.png -${pwd}/test/ok.jpg +${pwd}/test/ok/gif +${pwd}/test/ok/png +${pwd}/test/ok/jpg EOF $win = feh_start('--filelist test/filelist', q{}); -test_win_title($win, "feh [1 of 3] - ${pwd}/test/ok.gif"); +test_win_title($win, "feh [1 of 3] - ${pwd}/test/ok/gif"); feh_stop(); unlink('test/filelist'); diff --git a/test/feh.t b/test/feh.t index 67fb2694fb9468af8095b7cbe47457c575175f69..e142e638c11556a055aa54ff25f8a83e4c58a36d 100644 --- a/test/feh.t +++ b/test/feh.t @@ -6,7 +6,7 @@ use Test::Command tests => 48; my $fehrc = "/tmp/.fehrc-$$"; my $feh = "src/feh --rcfile $fehrc"; -my $images = 'test/ok.* test/fail.*'; +my $images = 'test/ok/* test/fail/*'; my ($feh_name, $feh_version) = @ENV{'PACKAGE', 'VERSION'}; @@ -37,10 +37,10 @@ if (length($feh_name) == 0 or length($feh_version) == 0) { } my $re_warning = - qr{${feh_name} WARNING: test/fail\.... \- No Imlib2 loader for that file format\n}; -my $re_loadable = qr{test/ok\....}; -my $re_unloadable = qr{test/fail\....}; -my $re_list_action = qr{test/ok\.... 16x16 \(${feh_name}\)}; + qr{${feh_name} WARNING: test/fail/... \- No Imlib2 loader for that file format\n}; +my $re_loadable = qr{test/ok/...}; +my $re_unloadable = qr{test/fail/...}; +my $re_list_action = qr{test/ok/... 16x16 \(${feh_name}\)}; my $cmd = Test::Command->new(cmd => $feh); @@ -73,40 +73,40 @@ $cmd->stderr_is_eq(''); $cmd = Test::Command->new(cmd => "$feh --list $images"); $cmd->exit_is_num(0); -$cmd->stdout_is_file('test/list'); +$cmd->stdout_is_file('test/list/default'); $cmd->stderr_like($re_warning); for my $sort (qw/name filename width height pixels size format/) { $cmd = Test::Command->new(cmd => "$feh --list $images --sort $sort"); $cmd->exit_is_num(0); - $cmd->stdout_is_file("test/list_$sort"); + $cmd->stdout_is_file("test/list/$sort"); $cmd->stderr_like($re_warning); } $cmd = Test::Command->new(cmd => "$feh --list $images --sort format --reverse"); $cmd->exit_is_num(0); -$cmd->stdout_is_file('test/list_format_reverse'); +$cmd->stdout_is_file('test/list/format_reverse'); $cmd->stderr_like($re_warning); $cmd = Test::Command->new(cmd => "$feh --customlist '%f; %h; %l; %m; %n; %p; " . "%s; %t; %u; %w' $images"); $cmd->exit_is_num(0); -$cmd->stdout_is_file('test/customlist'); +$cmd->stdout_is_file('test/list/custom'); $cmd->stderr_like($re_warning); $cmd = Test::Command->new(cmd => "$feh --list --quiet $images"); $cmd->exit_is_num(0); -$cmd->stdout_is_file('test/list'); +$cmd->stdout_is_file('test/list/default'); $cmd->stderr_is_eq(''); $cmd = Test::Command->new(cmd => "$feh --quiet --list --action 'echo \"%f %wx%h (%P)\" >&2' $images"); $cmd->exit_is_num(0); -$cmd->stdout_is_file('test/list'); +$cmd->stdout_is_file('test/list/default'); $cmd->stderr_like($re_list_action); unlink($fehrc); diff --git a/test/list b/test/list deleted file mode 100644 index 036b0f46fe539b15564f6e060a3cad5b953b44b9..0000000000000000000000000000000000000000 --- a/test/list +++ /dev/null @@ -1,5 +0,0 @@ -NUM FORMAT WIDTH HEIGHT PIXELS SIZE(bytes) ALPHA FILENAME -1 gif 16 16 256 953 - test/ok.gif -2 jpeg 16 16 256 354 - test/ok.jpg -3 png 16 16 256 403 X test/ok.png -4 pnm 16 16 256 269 - test/ok.pnm diff --git a/test/list/custom b/test/list/custom new file mode 100644 index 0000000000000000000000000000000000000000..b5ddb324ffe26e29201b4caa617a9323a1a71f4f --- /dev/null +++ b/test/list/custom @@ -0,0 +1,4 @@ +test/ok/gif; 16; 4; list; gif; 256; 953; gif; 0; 16 +test/ok/jpg; 16; 4; list; jpg; 256; 354; jpeg; 0; 16 +test/ok/png; 16; 4; list; png; 256; 403; png; 0; 16 +test/ok/pnm; 16; 4; list; pnm; 256; 269; pnm; 0; 16 diff --git a/test/list/default b/test/list/default new file mode 100644 index 0000000000000000000000000000000000000000..d7b2c12b197ca2cad55b2b63116f33494d8a78e1 --- /dev/null +++ b/test/list/default @@ -0,0 +1,5 @@ +NUM FORMAT WIDTH HEIGHT PIXELS SIZE(bytes) ALPHA FILENAME +1 gif 16 16 256 953 - test/ok/gif +2 jpeg 16 16 256 354 - test/ok/jpg +3 png 16 16 256 403 X test/ok/png +4 pnm 16 16 256 269 - test/ok/pnm diff --git a/test/list/filename b/test/list/filename new file mode 120000 index 0000000000000000000000000000000000000000..331d858ce9b12fa6720414196a9dd6e0b6a0faaa --- /dev/null +++ b/test/list/filename @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/list/format b/test/list/format new file mode 120000 index 0000000000000000000000000000000000000000..331d858ce9b12fa6720414196a9dd6e0b6a0faaa --- /dev/null +++ b/test/list/format @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/list/format_reverse b/test/list/format_reverse new file mode 100644 index 0000000000000000000000000000000000000000..801b7328a075ae1b84f289ce2e76367eaf80cb7d --- /dev/null +++ b/test/list/format_reverse @@ -0,0 +1,5 @@ +NUM FORMAT WIDTH HEIGHT PIXELS SIZE(bytes) ALPHA FILENAME +1 pnm 16 16 256 269 - test/ok/pnm +2 png 16 16 256 403 X test/ok/png +3 jpeg 16 16 256 354 - test/ok/jpg +4 gif 16 16 256 953 - test/ok/gif diff --git a/test/list/height b/test/list/height new file mode 120000 index 0000000000000000000000000000000000000000..331d858ce9b12fa6720414196a9dd6e0b6a0faaa --- /dev/null +++ b/test/list/height @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/list/name b/test/list/name new file mode 120000 index 0000000000000000000000000000000000000000..331d858ce9b12fa6720414196a9dd6e0b6a0faaa --- /dev/null +++ b/test/list/name @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/list/pixels b/test/list/pixels new file mode 120000 index 0000000000000000000000000000000000000000..331d858ce9b12fa6720414196a9dd6e0b6a0faaa --- /dev/null +++ b/test/list/pixels @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/list/size b/test/list/size new file mode 100644 index 0000000000000000000000000000000000000000..9e1c3d034dc4dd4d665ee4984a37ab0e850df057 --- /dev/null +++ b/test/list/size @@ -0,0 +1,5 @@ +NUM FORMAT WIDTH HEIGHT PIXELS SIZE(bytes) ALPHA FILENAME +1 pnm 16 16 256 269 - test/ok/pnm +2 jpeg 16 16 256 354 - test/ok/jpg +3 png 16 16 256 403 X test/ok/png +4 gif 16 16 256 953 - test/ok/gif diff --git a/test/list/width b/test/list/width new file mode 120000 index 0000000000000000000000000000000000000000..331d858ce9b12fa6720414196a9dd6e0b6a0faaa --- /dev/null +++ b/test/list/width @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/list_filename b/test/list_filename deleted file mode 120000 index e48b39a3a69c76a838ccfaa7b6b7fd234575170d..0000000000000000000000000000000000000000 --- a/test/list_filename +++ /dev/null @@ -1 +0,0 @@ -list \ No newline at end of file diff --git a/test/list_format b/test/list_format deleted file mode 120000 index e48b39a3a69c76a838ccfaa7b6b7fd234575170d..0000000000000000000000000000000000000000 --- a/test/list_format +++ /dev/null @@ -1 +0,0 @@ -list \ No newline at end of file diff --git a/test/list_format_reverse b/test/list_format_reverse deleted file mode 100644 index 71d1067dcffd3bc6c77c06479da7c309e75768d4..0000000000000000000000000000000000000000 --- a/test/list_format_reverse +++ /dev/null @@ -1,5 +0,0 @@ -NUM FORMAT WIDTH HEIGHT PIXELS SIZE(bytes) ALPHA FILENAME -1 pnm 16 16 256 269 - test/ok.pnm -2 png 16 16 256 403 X test/ok.png -3 jpeg 16 16 256 354 - test/ok.jpg -4 gif 16 16 256 953 - test/ok.gif diff --git a/test/list_height b/test/list_height deleted file mode 120000 index e48b39a3a69c76a838ccfaa7b6b7fd234575170d..0000000000000000000000000000000000000000 --- a/test/list_height +++ /dev/null @@ -1 +0,0 @@ -list \ No newline at end of file diff --git a/test/list_name b/test/list_name deleted file mode 120000 index e48b39a3a69c76a838ccfaa7b6b7fd234575170d..0000000000000000000000000000000000000000 --- a/test/list_name +++ /dev/null @@ -1 +0,0 @@ -list \ No newline at end of file diff --git a/test/list_pixels b/test/list_pixels deleted file mode 120000 index e48b39a3a69c76a838ccfaa7b6b7fd234575170d..0000000000000000000000000000000000000000 --- a/test/list_pixels +++ /dev/null @@ -1 +0,0 @@ -list \ No newline at end of file diff --git a/test/list_size b/test/list_size deleted file mode 100644 index 62fa3ba3230714ef4f567f6cf92d9b48e0e3b1fb..0000000000000000000000000000000000000000 --- a/test/list_size +++ /dev/null @@ -1,5 +0,0 @@ -NUM FORMAT WIDTH HEIGHT PIXELS SIZE(bytes) ALPHA FILENAME -1 pnm 16 16 256 269 - test/ok.pnm -2 jpeg 16 16 256 354 - test/ok.jpg -3 png 16 16 256 403 X test/ok.png -4 gif 16 16 256 953 - test/ok.gif diff --git a/test/list_width b/test/list_width deleted file mode 120000 index e48b39a3a69c76a838ccfaa7b6b7fd234575170d..0000000000000000000000000000000000000000 --- a/test/list_width +++ /dev/null @@ -1 +0,0 @@ -list \ No newline at end of file diff --git a/test/ok.gif b/test/ok/gif similarity index 100% rename from test/ok.gif rename to test/ok/gif diff --git a/test/ok.jpg b/test/ok/jpg similarity index 100% rename from test/ok.jpg rename to test/ok/jpg diff --git a/test/ok.png b/test/ok/png similarity index 100% rename from test/ok.png rename to test/ok/png diff --git a/test/ok.pnm b/test/ok/pnm similarity index 100% rename from test/ok.pnm rename to test/ok/pnm diff --git a/test/run-bg b/test/run-bg index df5d6acceed615e65f220772a6620ba73869109b..ee4dee539bb3960147f019c9c68ee91ae7a42838 100755 --- a/test/run-bg +++ b/test/run-bg @@ -7,5 +7,8 @@ pid=${!} DISPLAY=:7 twm > /dev/null 2>&1 & DISPLAY=:7 prove -v test/feh-bg.i +ret=${?} kill ${pid} + +exit ${ret} diff --git a/test/run-interactive b/test/run-interactive index d6f3fc40d56e4a0c352430c96d75e15712f72828..01dc7733061bbf652139987852133266dc176a0f 100755 --- a/test/run-interactive +++ b/test/run-interactive @@ -4,5 +4,8 @@ Xnest -geometry 500x500 :7 > /dev/null 2>&1 & pid=${!} DISPLAY=:7 prove -v test/feh.i +ret=${?} kill ${pid} + +exit ${ret} diff --git a/test/warning-no-loader b/test/warning-no-loader index 0ab95a5ca1ee1c34f15e5826fd79a9dc509b081d..9a1ff9ec81eb7c3e7ac30b8288a898fed2d3cf48 100644 --- a/test/warning-no-loader +++ b/test/warning-no-loader @@ -1,4 +1,4 @@ -feh WARNING: test/fail.pnm - No Imlib2 loader for that file format -feh WARNING: test/fail.png - No Imlib2 loader for that file format -feh WARNING: test/fail.jpg - No Imlib2 loader for that file format -feh WARNING: test/fail.gif - No Imlib2 loader for that file format +feh WARNING: test/fail/pnm - No Imlib2 loader for that file format +feh WARNING: test/fail/png - No Imlib2 loader for that file format +feh WARNING: test/fail/jpg - No Imlib2 loader for that file format +feh WARNING: test/fail/gif - No Imlib2 loader for that file format