Skip to content

Commit eec969b

Browse files
Timon Karnezosjasonmp85
authored andcommitted
Merge (and squash) citusdata#23. @cwelton added Travis CI integration.
1 parent 3b4db5a commit eec969b

File tree

4 files changed

+54
-53
lines changed

4 files changed

+54
-53
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
*.o
33
*.so
44
*.out
5+
*.diff
6+
regress/binary.dat
7+
regress/failures

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: c
2+
3+
env:
4+
- PGVERSION=9.1
5+
- PGVERSION=9.2
6+
- PGVERSION=9.3
7+
8+
before_script:
9+
- export PATH=/usr/lib/postgresql/$PGVERSION/bin:$PATH # Add our chosen PG version to the path
10+
- sudo /etc/init.d/postgresql stop # Stop whichever version of PG that travis started
11+
- sudo /etc/init.d/postgresql start $PGVERSION # Start the version of PG that we want to test
12+
- sudo apt-get install postgresql-server-dev-$PGVERSION # Required for PGXS
13+
- sudo apt-get install postgresql-common # Required for extension support files
14+
- createdb hll_regress # Create the test database
15+
16+
script:
17+
- make && sudo make install
18+
- psql -c "create extension hll" hll_regress
19+
- make -C regress
20+

README.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build Status](https://travis-ci.org/aggregateknowledge/postgresql-hll.svg?branch=master)](https://travis-ci.org/aggregateknowledge/postgresql-hll)
2+
13
Overview
24
========
35

regress/Makefile

Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,69 +19,45 @@
1919
# ../testdata/foo.csv - (optional data file for \copy from pstdin)
2020
# foo.out - actual output
2121

22-
SQL = \
23-
add_agg.sql \
24-
auto_sparse.sql \
25-
explicit_thresh.sql \
26-
nosparse.sql \
27-
agg_oob.sql \
28-
cast_shape.sql \
29-
scalar_oob.sql \
30-
typmod.sql \
31-
typmod_insert.sql \
32-
hash.sql \
33-
hash_any.sql \
34-
murmur_bigint.sql \
35-
murmur_bytea.sql \
36-
equal.sql \
37-
notequal.sql \
38-
union_op.sql\
39-
card_op.sql \
40-
meta_func.sql \
41-
transaction.sql \
42-
storedproc.sql \
43-
cumulative_add_cardinality_correction.sql \
44-
cumulative_add_comprehensive_promotion.sql \
45-
cumulative_add_sparse_edge.sql \
46-
cumulative_add_sparse_random.sql \
47-
cumulative_add_sparse_step.sql \
48-
cumulative_union_comprehensive.sql \
49-
cumulative_union_explicit_explicit.sql \
50-
cumulative_union_explicit_promotion.sql \
51-
cumulative_union_probabilistic_probabilistic.sql \
52-
cumulative_union_sparse_full_representation.sql \
53-
cumulative_union_sparse_promotion.sql \
54-
cumulative_union_sparse_sparse.sql \
55-
copy_binary.sql \
56-
$(NULL)
22+
PSQL = psql
23+
TEST_DB = hll_regress
5724

58-
TEST_DB = hll_regress
25+
SQL = $(wildcard *.sql)
26+
OUT := $(SQL:%.sql=%.out)
5927

60-
NOT = \
61-
$(NULL)
62-
63-
OUT := $(SQL:%.sql=%.out)
64-
65-
# Print NULL values explicitly.
66-
PSQLOPTS = -X --echo-all -P null=NULL
67-
68-
# Disable NOTICE log messages
69-
export PGOPTIONS := --client-min-messages=warning
28+
PSQLOPTS = -X --echo-all -P null=NULL # Print NULL values explicitly.
29+
PGOPTIONS = --client-min-messages=warning # Output WARNINGS
7030

7131
all: $(OUT)
32+
@find . -maxdepth 1 -name '*.diff' -print -quit > failures
33+
@if test -s failures; then \
34+
echo ERROR: `ls -1 *.diff | wc -l` / `ls -1 *.sql | wc -l` tests failed; \
35+
echo; \
36+
cat *.diff; \
37+
exit 1; \
38+
else \
39+
rm failures; \
40+
echo `ls -1 *.out | wc -l` / `ls -1 *.sql | wc -l` tests passed; \
41+
fi
7242

7343
clean:
74-
rm -f $(OUT)
75-
rm -f binary.dat
44+
rm -f binary.dat *.out *.diff
7645

7746
# If a matching testdata file exists use it as standard input.
7847
# Otherwise the test doesn't need data on stdin.
7948
#
8049
%.out: %.sql %.ref
81-
@echo $*
50+
@echo -n $*
8251
@if test -f ../testdata/$*.csv; then \
83-
cat ../testdata/$*.csv | \
84-
psql $(PSQLOPTS) $(TEST_DB) -f $*.sql &> $*.out && diff -u $*.ref $*.out; \
52+
PGOPTIONS=$(PGOPTIONS) $(PSQL) $(PSQLOPTS) $(TEST_DB) -f $*.sql < ../testdata/$*.csv > $*.out 2>&1; \
53+
else \
54+
PGOPTIONS=$(PGOPTIONS) $(PSQL) $(PSQLOPTS) $(TEST_DB) -f $*.sql > $*.out 2>&1; \
55+
fi
56+
@diff -u $*.ref $*.out >> $*.diff || status=1
57+
@if test -s $*.diff; then \
58+
echo " .. FAIL"; \
8559
else \
86-
psql $(PSQLOPTS) $(TEST_DB) -f $*.sql &> $*.out && diff -u $*.ref $*.out; \
87-
fi
60+
echo " .. PASS"; \
61+
rm -f $*.diff; \
62+
fi
63+

0 commit comments

Comments
 (0)