8 plan skip_all => "JSON::XS required for testing" if $@;
12 my $q = Test::Quvi->new;
14 plan skip_all => "TEST_SKIP rule"
15 if $q->test_skip("mem");
17 my $c = $q->get_config;
20 'valgrind required for testing, specify with --valgrind-path'
21 unless $c->{valgrind_path};
25 # invalid option, make an exception to redirect to /dev/null),
26 # gengetopt produced code checks and exits if this error occurs.
27 my ($r) = $q->run_with_valgrind('--invalid', '2>/dev/null');
28 is($r, 0x1, "exit status == 0x1");
31 ($r) = $q->run_with_valgrind('--version');
32 is($r, 0x0, "exit status == 0x0"); # 0x0 = QUVI_OK
35 ($r) = $q->run_with_valgrind('--help');
36 is($r, 0x0, "exit status == 0x0"); # 0x0 = QUVI_OK
39 ($r) = $q->run_with_valgrind('--support');
40 is($r, 0x0, "exit status == 0x0"); # 0x0 = QUVI_OK
44 $q->run_with_valgrind('http://vimeo.com/1485507', '--support -qr');
45 is($r, 0x0, "exit status == 0x0");
48 ($r) = $q->run_with_valgrind('http://vimeo.com/1485507', '-qr');
49 is($r, 0x0, "exit status == 0x0");
51 # fetch, parse, exec and exit
52 ($r) = $q->run_with_valgrind('http://vimeo.com/1485507',
53 '-qr --exec "echo %t ; echo %u"');
54 is($r, 0x0, "exit status == 0x0");
56 # (fetch, parse) x 2, exit
58 $q->run_with_valgrind(
59 'http://vimeo.com/1485507',
60 'http://megavideo.com/?v=HJVPVMTV',
63 is($r, 0x0, "exit status == 0x0");
65 # (fetch, parse) x 2, exit
66 # NOTE: first fails intentionally
68 $q->run_with_valgrind(
69 'http://ww.vimeo.com/1485507',
70 'http://megavideo.com/?v=HJVPVMTV',
73 is($r, 0x0, "exit status == 0x0");
75 # vim: set ts=2 sw=2 tw=72 expandtab: