ci-tests.bash 1.78 KB
Newer Older
1 2
#!/bin/bash
set -e
Mart Lubbers's avatar
Mart Lubbers committed
3

4
#Update IDEEnvs
5
if [ -w "$CLEAN_HOME"/etc/IDEEnvs ]; then
Mart Lubbers's avatar
Mart Lubbers committed
6
	cp -v "$CLEAN_HOME"/etc/IDEEnvs{,.bak2}
7 8 9
	trap 'mv -v "$CLEAN_HOME"/etc/IDEEnvs{.bak2,}' EXIT
	sed -n -i.bak '/EnvironmentName:\tiTasks/q;p' "$CLEAN_HOME"/etc/IDEEnvs
	tail -n +3 Config/linux-x64/iTasks.env >> "$CLEAN_HOME"/etc/IDEEnvs
Mart Lubbers's avatar
Mart Lubbers committed
10
	sed -i.bak "s|{Application}/lib/iTasks|$(pwd)/Libraries|g" "$CLEAN_HOME"/etc/IDEEnvs
Mart Lubbers's avatar
Mart Lubbers committed
11 12
	sed -i.bak 's#EnvironmentLinker:\s\+/usr/bin/gcc::#& -lmysqlclient -lsqlite3 #g' "$CLEAN_HOME"/etc/IDEEnvs
	sed -i.bak 's|EnvironmentCompiler:\s\+lib/exe/cocl-itasks:|&-h 2048m|g' "$CLEAN_HOME"/etc/IDEEnvs
13
fi
Mart Lubbers's avatar
Mart Lubbers committed
14

15 16 17 18 19 20 21 22 23
#Create BasicAPIExamples
(
	cd Examples
	cp CreateBasicAPIExamples.prj{.default,}
	cpm CreateBasicAPIExamples.prj
	rm CreateBasicAPIExamples.prj
	./CreateBasicAPIExamples.exe > BasicAPIExamples.icl
)

24
#Try to compile all modules
25 26 27 28 29 30 31 32 33 34 35
if [ $(uname) = "Linux" ]; then
	errors="$(
		cd Examples
		find ../Libraries/ -name "*.dcl" -exec head -n 1 {} \; \
			|  sed 's/definition module //g' \
			|  xargs cpm project BasicAPIExamples.prj compile \
			|& grep -Po '(?<=Error \[).*(?=\.icl.*)' \
			| uniq)"
	echo "$errors" >&2
	[ -z "$errors" ]
fi
36

Mart Lubbers's avatar
Mart Lubbers committed
37
#Try to compile everything
38
find . -name "*.prj.default" | while read f; do
39
		cp "$f" "$(dirname $f)/$(basename -s .prj.default $f)".prj
40
	done
Mart Lubbers's avatar
Mart Lubbers committed
41 42 43 44
#Without generic fusion
find . -name "*.prj" -exec dirname {} \; | sort -u | xargs -I{} sh -c\
	"cd {}; cpm make"
#With generic fusion
Haye Böhm's avatar
Haye Böhm committed
45
find . -name "*.prj" -not -name "IncidoneCCC.prj" -not -name "examples.prj" -not -name "RemoteShareExamples.prj" -exec dirname {} \; | sort -u | xargs -I{} sh -c\
46
	"cd {}; sed -i.bak 's/GenericFusion:	False/GenericFusion: True/g' *.prj && cpm make"
Mart Lubbers's avatar
Mart Lubbers committed
47

48
#Run the unit tests
49
find Tests/Unit -name "*.prj.default" | sed "s/.prj.default//" | xargs -n 1 -I@ cleantest -f human --junit @-junit.xml -r @