Skip to content

Commit

Permalink
Starting travis rework
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro authored and hyades committed Jan 5, 2015
1 parent 288a5eb commit f4a3102
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 73 deletions.
15 changes: 15 additions & 0 deletions .travis-after.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#! /bin/bash -ex
#
# This script runs after everything has finished. It should be used to upload
# any build assets, logs and coverage information.

case $TEST in
system )
COVERALL_ARGS="-n -r $HOME/gst-switch-coverage"
;;
esac

coveralls $COVERALL_ARGS || {
printf "Coveralls failed!\n"
exit -1
}
73 changes: 11 additions & 62 deletions .travis-run.sh
Original file line number Diff line number Diff line change
@@ -1,67 +1,16 @@
#! /bin/bash -ex

./autogen.sh --prefix=/usr || {
printf "Failed to do autogen!!!\n"
exit -1
}
make clean
make || {
printf "make of gst-switch failed!!!\n"
exit -1
}
sudo make install || {
printf "make install of gst-switch failed!!!\n"
exit -1
}

cd python-api

case $TEST in

python-api )
case $TYPE in
unittest )
make unittests || {
printf "Unittests failed!\n"
exit -1
}
coveralls || {
printf "Coveralls failed!\n"
exit -1
}
;;
integration )
make integration || {
printf "Integration tests failed!\n"
exit -1
}
coveralls || {
printf "Coveralls failed!\n"
exit -1
}
;;
esac
cd python-api
make $TYPE
;;
system )
make check
make test
;;
* )
echo "Unknown TEST='$TEST'"
exit -1
;;
module )
case $TYPE in
python )
make test || {
printf "Tests failed!\n"
exit -1
}
coveralls || {
printf "Coveralls failed!\n"
exit -1
}
;;
c )
make test || {
printf "Tests failed!\n"
exit -1
}
coveralls -n -r ../tools
esac
esac || {
printf "Failed!\n!\n"
exit -1
}
esac
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#vim :
language:
- c

Expand All @@ -6,10 +7,13 @@ compiler:

env:
matrix:
- TEST=python-api TYPE=style
- TEST=python-api TYPE=unittest
- TEST=python-api TYPE=integration
- TEST=module TYPE=python
- TEST=module TYPE=c

- TEST=system TYPE=style
- TEST=system TYPE=unittest
- TEST=system TYPE=integration

install:
- wget -q -O- https://raw.githubusercontent.com/mithro/travis-trusty/master/setup.sh | bash
Expand All @@ -19,6 +23,10 @@ install:
script:
- /trusty/run.py $PWD/.travis-run.sh

after_script:
- chmod +x .travis-after.sh
- ./.travis-after.sh

notifications:
email:
- gst-switch-spam@googlegroups.com
Expand Down
21 changes: 12 additions & 9 deletions python-api/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: lint unittests pytest integration test clean all
.PHONY: lint pep8 style-check unittests integration performance test clean

lint: export PYTHONWARNINGS := ignore
lint: export PYTHONPATH := ${PYTHONPATH}:${PWD}
Expand All @@ -13,12 +13,6 @@ lint:
pylint --rcfile=.pylintrc_integrationtests tests/integrationtests/*.py
@echo "Code style is okay!!"

unittests:
@rm -rf reports
@mkdir -p reports/coverage/unittests
py.test --cov gstswitch tests/unittests/ --pep8 -v -s
@make clean

pep8:
pep8 gstswitch
@echo "gstswitch is pep8 clean!!"
Expand All @@ -27,6 +21,15 @@ pep8:
pep8 tests/integrationtests
@echo "integration tests are pep8 clean!!"

style-check: pep8 lint

unittests:
@rm -rf reports
@mkdir -p reports/coverage/unittests
py.test --cov gstswitch tests/unittests/ --pep8 -v -s
@make clean


integration:
@rm -f ../tools/*.c.gcov
@rm -f ../tools/*.gcda
Expand All @@ -42,6 +45,8 @@ performance:
py.test tests/performancetests/*.py -v -s
make clean

test: unittests integration clean

clean:
rm -rf .cache
rm -rf reports
Expand All @@ -53,5 +58,3 @@ clean:
rm -f *.sh
rm -f .coverage


test: lint unittests integration clean
Binary file not shown.

0 comments on commit f4a3102

Please sign in to comment.