File: build-test

package info (click to toggle)
libomemo 0.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 300 kB
  • sloc: ansic: 3,170; sh: 45; makefile: 3
file content (67 lines) | stat: -rw-r--r-- 1,251 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
set -eu 

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
     CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" 
else
     CROSS_COMPILE=
fi


cd "$AUTOPKGTEST_TMP"

cat << EOF > test_crypto.c
#include <stdio.h>
#include <libomemo_crypto.h>

int
main (int argc, char** argv)
{
	omemo_default_crypto_init ();
}
EOF

${CROSS_COMPILE}gcc test_crypto.c -o test_crypto $(${CROSS_COMPILE}pkg-config --cflags --libs libomemo)
echo "build ok"
[ -x test_crypto ]
./test_crypto
echo "starts ok"

cat <<EOF > test_bundle.c
#include <stddef.h>
#include <libomemo.h>

int main (int argc, char** argv)
{
  omemo_bundle * bundle;
  return omemo_bundle_create (&bundle);
}
EOF

${CROSS_COMPILE}gcc test_bundle.c -o test_bundle $(pkg-config --cflags --libs libomemo)
echo "build bundle ok"
[ -x test_bundle ]
./test_bundle
echo "starts bundle ok"

cat <<EOF > test_storage.c
#include <stddef.h>
#include <libomemo_storage.h>

#define TEST_DB_PATH "test.sqlite"

int main (int argc, char** argv)
{
  int ret;

  ret = omemo_storage_user_device_id_save ("alice", 1111, TEST_DB_PATH);

  return ret;
}
EOF

${CROSS_COMPILE}gcc test_storage.c -o test_storage $(pkg-config --cflags --libs libomemo)
echo "build storage ok"
[ -x test_storage ]
./test_storage
echo "starts storage ok"