File: test-path-utils

package info (click to toggle)
ding-libs 0.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,092 kB
  • sloc: ansic: 31,844; makefile: 382; sh: 40
file content (30 lines) | stat: -rwxr-xr-x 387 bytes parent folder | download
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
#!/bin/sh

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM

cd $WORKDIR
cat <<EOF > tpu.c
#include <path_utils.h>

int main(void)
{
  bool p;

  if (!is_absolute_path("/tmp"))
    return 1;

  if (is_absolute_path("../tmp"))
    return 1;

  return 0;
}
EOF

gcc -o tpu tpu.c `pkg-config --cflags --libs path_utils`
echo "PASS: gcc"

./tpu
echo "PASS: run"