File: test_watch.sh

package info (click to toggle)
f3d 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 23,504 kB
  • sloc: cpp: 99,106; python: 758; sh: 342; xml: 223; java: 101; javascript: 95; makefile: 25
file content (32 lines) | stat: -rwxr-xr-x 543 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

# Test the watch feature by opening a file
# rewriting it and checking the the file has been
# automatically reloaded

set -euo pipefail
f3d_cmd=$1
data_dir=$2
tmp_dir=$3

hires_data=$data_dir/cow.vtp
lowres_data=$data_dir/cowlow.vtp
reloaded_data=$tmp_dir/cow.vtp

cp $hires_data $reloaded_data

log=$tmp_dir/output.log
$f3d_cmd --watch --verbose $reloaded_data > $log &
pid=$!

function cleanup()
{
  kill -SIGTERM $pid
}
trap "cleanup" EXIT

sleep 3
cp $lowres_data $reloaded_data
sleep 3

grep -q "Number of points: 634" $log