File: unit-tests

package info (click to toggle)
cmph 2.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,748 kB
  • sloc: ansic: 10,582; cpp: 2,429; makefile: 151; sh: 111; python: 48; xml: 5
file content (38 lines) | stat: -rwxr-xr-x 982 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
35
36
37
38
#!/bin/sh
# Make sure that the unit tests compile and run

set -e

# This test requires a specific header
gcc -l cmph -I src -o cmph_benchmark_test tests/cmph_benchmark_test.c && ./cmph_benchmark_test && rm cmph_benchmark_test

# These tests requires the config.h generated from the config.h.in and a key file
cat << __EOF__ > keys.txt
aaaaaaaaaa
bbbbbbbbbb
cccccccccc
dddddddddd
eeeeeeeeee
ffffffffff
gggggggggg
hhhhhhhhhh
iiiiiiiiii
jjjjjjjjjj
__EOF__

# Generating the keys.txt.mph file
cmph -g keys.txt

for file in mphf packed_mphf ; do
    gcc $(dpkg-buildflags --get CFLAGS) $(dpkg-buildflags --get LDFLAGS) -I ./ -o ${file} tests/${file}_tests.c -l cmph \
        && ./${file} keys.txt \
        && rm ${file} ;
done
rm keys.txt keys.txt.mph


for file in compressed_rank compressed_seq graph select ; do
    gcc $(dpkg-buildflags --get CFLAGS) $(dpkg-buildflags --get LDFLAGS)  -o ${file} tests/${file}_tests.c -l cmph \
        && ./${file} \
        && rm ${file} ;
done