aboutsummaryrefslogtreecommitdiff
path: root/test/cgen_test/cgen_test.sh
blob: 0280e9d6da04b387be9750835c2aeed5f49bd873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

set -e
cd `dirname $0`/../..
ROOT=`pwd`

CC=${CC:-cc}
TMP=${ROOT}/build/tmp/test/cgen_test
INC=${ROOT}/include

${ROOT}/scripts/build.sh

mkdir -p ${TMP}
rm -rf ${TMP}/*

echo "generating test source for Debug" 1>&2
${ROOT}/build/Debug/test/cgen_test/cgen_test_d > ${TMP}/test_generated_d.c
cd ${TMP} && $CC test_generated_d.c -c -I${INC}

echo "generating test source for Release" 1>&2
${ROOT}/build/Release/test/cgen_test/cgen_test > ${TMP}/test_generated.c
cd ${TMP} && $CC test_generated.c -c  -Wall -O3 -I${INC}