File: make.sh

package info (click to toggle)
tlsh 4.12.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,952 kB
  • sloc: cpp: 9,132; python: 1,603; java: 1,214; sh: 703; javascript: 467; ansic: 54; makefile: 27; sed: 9
file content (104 lines) | stat: -rwxr-xr-x 1,847 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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh

####################################################
# process command line options
####################################################

OPTION=$1

CHECKSUM="-DTLSH_CHECKSUM_1B=1"
notest=0
VERBOSEOPTION=""

if test "$OPTION" = "-zerochecksum"
then
	OPTION=$2
	CHECKSUM="-DTLSH_CHECKSUM_NO_EVALUATION=1"
fi
if test "$OPTION" = "-nochecksum"
then
	OPTION=$2
	CHECKSUM="-DTLSH_CHECKSUM_0B=1"
fi
if test "$OPTION" = "-verbose"
then
	OPTION=$2
	VERBOSEOPTION="VERBOSE=1"
fi
if [ "$OPTION" = "-notest" ]; then
	notest=1
fi

####################################################

if [ "$OPTION" = "debug" ]; then
	mkdir -p build/debug
	cd build/debug
	cmake $CHECKSUM -DCMAKE_BUILD_TYPE=Debug ../..
elif [ "$OPTION" = "-shared" ]; then
	mkdir -p build/release
	cd build/release
	cmake $CHECKSUM -DTLSH_SHARED_LIBRARY=1 ../..
else
	mkdir -p build/release
	cd build/release
	cmake $CHECKSUM ../.. 
fi

makecversion=0
if [ "$OPTION" = "-c" ]; then
	makecversion=1
fi

make $VERBOSEOPTION

cd ../../bin
if test ! -f tlsh
then
	ln -s tlsh_unittest tlsh
fi
cd -

if test $notest = 0
then
	echo
	echo "==========="
	echo "Cmake Tests"
	echo "==========="
	make test
fi

cd ../..

if test $makecversion = 1
then
	echo
	echo "==========="
	echo "make c standalone version"
	echo "==========="
	cd src_c_standalone
	make
	cd ..
fi

if test $notest = 0
then
	echo
	echo "====================="
	echo "tests on example data"
	echo "====================="
	cd Testing
	./test.sh | grep -E "(^test|^passed|error|^Running|Scenario)"

	echo "====================="
	echo "tests tlsh_pattern"
	echo "====================="
	./test_pattern.sh | grep -E "(^test|^passed|error|^Running|Scenario)"

	echo "====================="
	echo "tests tlsh_parts"
	echo "====================="
	./test_parts.sh | grep -E "(^test|^passed|error|^Running|Scenario)"

	cd ..
fi