Skip to content

Commit 569c01e

Browse files
committed
PHPC-80: Create distcheck target
1 parent b633150 commit 569c01e

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

Makefile.frag

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,18 @@ help:
2525
@echo -e "\t$$ make composer"
2626
@echo -e "\t - Installs test dependencies using composer"
2727

28+
@echo ""
29+
@echo -e "\t$$ make distcheck"
30+
@echo -e "\t - Builds the archive, runs the virtual tests"
2831
@echo ""
2932
@echo -e "\t$$ make release"
30-
@echo -e "\t - Runs the tests and creates the pecl archive on success"
33+
@echo -e "\t - Packages the archive, runs the tests locally and virtual"
34+
35+
@echo ""
36+
@echo -e "\t$$ make package"
37+
@echo -e "\t - Creates the pecl archive to use for provisioning"
38+
@echo -e "\t$$ make test-virtual"
39+
@echo -e "\t - Provisions some VMs, installs the pecl archive and executes the tests"
3140

3241

3342
mv-coverage:
@@ -77,6 +86,12 @@ list-servers:
7786
test-bootstrap:
7887
php scripts/start-servers.php
7988

89+
distcheck: package test-virtual
90+
91+
test-virtual: package
92+
sh ./scripts/run-tests-on.sh precise32
93+
sh ./scripts/run-tests-on.sh precise64
94+
8095
testunit: composer
8196
@command -v phpunit >/dev/null 2>&1; \
8297
if test $$? -eq 0; then \
@@ -103,7 +118,7 @@ testclean:
103118

104119
mongodbdep:
105120

106-
release: test package
121+
release: test distcheck
107122
@echo "Please run:"
108123
@echo " " git add RELEASE-$(MONGODB_VERSION)
109124
@echo " " git commit -m \"Add $(MONGODB_VERSION) release notes\"

scripts/run-tests-on.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
VMNAME=$1
4+
5+
vagrant status $VMNAME | grep -q "$VMNAME.*running"
6+
if test $? -eq 0; then
7+
vagrant provision $VMNAME > .$VMNAME
8+
else
9+
vagrant up $VMNAME > .$VMNAME
10+
fi
11+
12+
cat .tests | grep -q -E "FAIL|WARN"
13+
if test $? -eq 0; then
14+
echo "$VMNAME FAILED"
15+
cat .tests
16+
exit 2
17+
else
18+
echo "$VMNAME OK"
19+
fi
20+

scripts/ubuntu/phongo.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apt-get install -y php-pear php5-dbg gdb
22
apt-get install -y libssl-dev libsasl2-dev libpcre3-dev pkg-config
33

4-
ls -1 /phongo/mongodb*.tgz | sort -n -r | xargs sudo pecl install -f
4+
ls -1 /phongo/mongodb*.tgz | sort -n -r | xargs sudo pecl install -f 2>&1 > /phongo/.build
55
php -m | grep -q mongodb || echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
6-
pecl run-tests -q -p mongodb
6+
pecl run-tests -q -p mongodb 2>&1 > /phongo/.tests

0 commit comments

Comments
 (0)