File: touch.t

package info (click to toggle)
speedy-cgi-perl 2.22-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,128 kB
  • ctags: 890
  • sloc: ansic: 4,487; sh: 1,105; perl: 945; makefile: 89
file content (16 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Do a touch on a script file while it is running.  It should finish
# running OK, but the next run should have a different pid.
#
print "1..1\n";

my $scr = 't/scripts/touch';

my($pid1,$pid2) = split(/\n/, `$ENV{SPEEDY} $scr $scr`);
my($pid3) = split(/\n/, `$ENV{SPEEDY} $scr`);

#print STDERR "1=$pid1 2=$pid2 3=$pid3\n";

my $ok = $pid1 && $pid2 && $pid3 && $pid1 == $pid3 && $pid1 != $pid2;

print $ok ? "ok\n" : "not ok\n";