aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoni <matzeton@googlemail.com>2016-07-29 00:37:58 +0200
committertoni <matzeton@googlemail.com>2016-07-29 00:37:58 +0200
commit2b1490ebfbff31d27789720ceb3eeadcc50f5ff5 (patch)
tree9c1adad1316a56e5b34811e8e0a3ebbb5ade892c
parentc1ba57fd4da5f14ecf583ee5381005f85b2bbed2 (diff)
travis buid/run tests
-rw-r--r--.travis.yml2
-rw-r--r--tests/semtest.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index dc2ea01..5310d45 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,4 +4,4 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get install -y debhelper libncurses5-dev libncursesw5-dev
-script: ./configure && make && dpkg-buildpackage -b -us -uc
+script: ./configure && make && make -C tests && make -C tests run && dpkg-buildpackage -b -us -uc
diff --git a/tests/semtest.c b/tests/semtest.c
index fdecf2d..f4c6f57 100644
--- a/tests/semtest.c
+++ b/tests/semtest.c
@@ -23,6 +23,8 @@ int main(int argc, char **argv) {
usleep(250);
LOG("child: sempost");
sem_post(mysem);
+ int tmp = 0;
+ assert ( sem_getvalue(mysem, &tmp) == 0 && tmp == 1 );
LOG("child: done");
usleep(250);
exit(0);
@@ -40,8 +42,8 @@ int main(int argc, char **argv) {
exit(1);
}
- int sval;
- assert ( sem_getvalue(mysem, &sval) == 0 );
+ int sval = 1;
+ assert ( sem_getvalue(mysem, &sval) == 0 && sval == 0 );
assert (sval == 0);
sem_unlink(TESTSEM);