File: test.sh

package info (click to toggle)
kshutdown 6.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,992 kB
  • sloc: cpp: 8,349; sh: 477; makefile: 5
file content (57 lines) | stat: -rwxr-xr-x 804 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
#!/bin/bash

if [ ! -d "./test" ]; then
	echo "USAGE: ./tools/test.sh"
	exit 1
fi

function ks_clean()
{
	ks_info "Cleaning..."
	make clean
	rm -f .qmake.stash target_wrapper.sh test
}

function ks_info()
{
	echo
	echo "INFO: $1"
	echo
}

ks_info "Validating src/kshutdown.desktop..."

desktop-file-validate --warn-kde "src/kshutdown.desktop"

set -e

for dir in ./test/*; do
	if [ -d "$dir" ]; then
		ks_info "Testing \"$dir\" directory..."

		pushd "$dir"

		ks_info "Configuring..."
		qmake \
			"CONFIG += testcase" \
			"DEFINES += KS_PURE_QT" \
			"INCLUDEPATH += ../../src" \
			"QT += testlib widgets" \
			"TARGET = test" \
			"VPATH += ../../src" \
			-config debug

		ks_clean

		ks_info "Compiling..."
		make -j2

		ks_info "Running..."
		./test

		ks_clean
		rm -f Makefile

		popd
	fi
done