4 use File::Temp qw/ tempdir tmpnam /;
6 use Test::WWW::Mechanize;
8 my $dir = tempdir(); # CLEANUP => 1 );
12 # Check exit status here
13 system("cd $dir; catalyst.pl TestApp");
15 # Fix paths / nl work on win32
16 chdir("$dir/TestApp/");
19 # Ok, this is lame.. Also, check +x permissions?
24 lib/TestApp/Controller/Root.pm
30 root/static/images/catalyst_logo.png
31 root/static/images/btn_120x50_built.png
32 root/static/images/btn_120x50_built_shadow.png
33 root/static/images/btn_120x50_powered.png
34 root/static/images/btn_120x50_powered_shadow.png
35 root/static/images/btn_88x31_built.png
36 root/static/images/btn_88x31_built_shadow.png
37 root/static/images/btn_88x31_powered.png
38 root/static/images/btn_88x31_powered_shadow.png
42 script/testapp_fastcgi.pl
43 script/testapp_server.pl
44 script/testapp_test.pl
45 script/testapp_create.pl
48 plan 'tests' => scalar @files + 4;
50 foreach my $fn (@files) {
51 ok -r $fn, "Have $fn in generated app";
55 my $makefile_status = `$^X Makefile.PL`;
56 ok $makefile_status, "Makefile ran okay";
57 ok -e "Makefile", "Makefile exists";
58 my $newapp_test_status = `prove -l t/`;
59 ok $newapp_test_status, "Tests ran okay";
60 #is $newapp_test_status, ;
62 ## Moosey server tests - kmx++
63 my $server_path = File::Spec->catfile('script', 'testapp_server.pl');
64 my $childpid = fork();
66 my $port = 3333; # or call some random generator
67 my $tmpfile = tmpnam(); # do not redirect to /dev/null as it will not work on Win32
70 system("$^X $server_path -p $port > $tmpfile 2>&1");
74 sleep 10; #wait for catalyst application to start
75 my $mech = Test::WWW::Mechanize->new;
76 $mech->get_ok( "http://localhost:" . $port );
78 kill 'KILL', $childpid;