Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26cb18f

Browse files
committed
run cmocka-based tests in Travis CI
1 parent20eb98d commit26cb18f

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

‎Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,9 @@ isolationcheck: | submake-isolation
7575
--temp-config=$(top_srcdir)/$(subdir)/conf.add\
7676
--outputdir=./isolation_output\
7777
$(ISOLATIONCHECKS)
78-
partitioning_tests:
78+
79+
python_tests:
7980
$(MAKE) -C tests/python partitioning_tests
81+
82+
cmocka_tests:
83+
$(MAKE) -C tests/cmocka check

‎tests/cmocka/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ PG_CONFIG = pg_config
22
TOP_SRC_DIR = ../../src
33

44
CC = gcc
5-
CFLAGS = -I$(TOP_SRC_DIR) -I$(shell$(PG_CONFIG) --includedir-server)
5+
CFLAGS+= -I$(TOP_SRC_DIR) -I$(shell$(PG_CONFIG) --includedir-server)
66
CFLAGS += -I$(CURDIR)/../../src/include
77
CFLAGS +=$(shell$(PG_CONFIG) --cflags_sl)
88
CFLAGS +=$(shell$(PG_CONFIG) --cflags)
9+
CFLAGS +=$(CFLAGS_SL)
910
LDFLAGS = -lcmocka
1011
TEST_BIN = rangeset_tests
1112

‎tests/cmocka/cmocka-1.1.1.tar.xz

83.6 KB
Binary file not shown.

‎travis/pg-travis-test.sh

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,49 @@ PGPORT=55435 PGUSER=$USER PG_CONFIG=$config_path make installcheck USE_PGXS=1 ||
8888
# show diff if it exists
8989
iftest -f regression.diffs;then cat regression.diffs;fi
9090

91+
9192
set +u
9293

93-
# createavirtual environment and activate it
94+
# create virtual environment and activate it
9495
virtualenv /tmp/envs/pg_pathman
9596
source /tmp/envs/pg_pathman/bin/activate
9697

9798
# install pip packages
9899
pip3 install$pip_packages
99100

100101
# run python tests
101-
make USE_PGXS=1 PG_CONFIG=$config_path partitioning_tests|| status=$?
102+
make USE_PGXS=1 PG_CONFIG=$config_path python_tests|| status=$?
103+
104+
# deactivate virtual environment
105+
deactivate
102106

103107
set -u
104108

105109

110+
# install cmake for cmocka
111+
sudo apt-get -y install -qq cmake
112+
113+
# build & install cmocka
114+
CMOCKA_VER=1.1.1
115+
cd tests/cmocka
116+
tar xf cmocka-$CMOCKA_VER.tar.xz
117+
cd cmocka-$CMOCKA_VER
118+
mkdir build&&cd build
119+
cmake ..
120+
make&& sudo make install
121+
cd ../../../..
122+
123+
# export path to libcmocka.so
124+
LD_LIBRARY_PATH=/usr/local/lib
125+
export LD_LIBRARY_PATH
126+
127+
# run cmocka tests (using CFLAGS_SL for gcov)
128+
make USE_PGXS=1 PG_CONFIG=$config_path CFLAGS_SL="$($config_path --cflags_sl) -coverage" cmocka_tests|| status=$?
129+
130+
# remove useless gcov files
131+
rm -f tests/cmocka/*.gcno
132+
rm -f tests/cmocka/*.gcda
133+
106134
#generate *.gcov files
107135
gcov src/*.c src/compat/*.c src/include/*.h src/include/compat/*.h
108136

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp