File: 028_unittests

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (34 lines) | stat: -rwxr-xr-x 834 bytes parent folder | download | duplicates (3)
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
33
34
#!/bin/bash

set -e 
$PREPARE_DEFAULT > /dev/null
$INCLUDE_FUNCS
cd $WC

log=$LOGDIR/028.units
if [[ "$opt_DEBUG" != "1" ]]
then
# This test will run in any case via ext-tests.
	$WARN "Cannot do unit tests without --enable-debug."
	exit 0
fi

for path in `pwd`/empty-file tree/a/1/file-z tree/../tree/b/2/./file-y ././/tree/././c/3/.././//2/.././../../dir-with-perms/../tree/c/./3/file-x 
do
	$BINdflt -d -D hlp__pathcopy st $path > $log 
	# There might be many paths build; take only the last (via tail).
	p=`grep finished < $log | tail -1 | cut -f6 -d" "`
	rl=`readlink -f $path`
	if [[ "$rl" != "$p" ]]
	then
	  $ERROR_NB "fsvs and readlink disagree:"
	  $ERROR_NB "   readlink: $rl"
	  $ERROR    "   fsvs:     $p"
	fi

	$INFO "Reduced to $p"
done # > $log 2>&1

$SUCCESS "Unit tests successful."

# vi: textwidth=0 formatoptions=