Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (C) 2016 Branden Archer <b.m.archer4@gmail.com>
# Copyright (C) 2016 Joshua D. Boyd <jdboyd@jdboyd.net>
# Copyright (C) 2016 Nicola Spanti <dev@nicola-spanti.info>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -35,6 +36,7 @@ addons:
apt:
packages:
- texinfo
- vera++

matrix:
exclude:
Expand All @@ -45,11 +47,12 @@ matrix:
env: USE_CMAKE=YES

script:
- if [ ${TRAVIS_OS_NAME} = 'linux' ]; then vera++ --error -R F001 -R F002 -P max-filename-length=40 -R L004 -P max-line-length=90 -R L005 -P max-consecutive-empty-lines=2 -R L006 -P max-file-length=1000 -R T001 -R T009 $(find src \( -name '*.h' -o -name '*.c' \)); fi
- mkdir build
- cd build
- if [ $USE_CMAKE == "YES" ] ; then cmake ../ ; fi
- if [ $USE_CMAKE == "NO" ] ; then pushd ../ ; autoreconf -i ; popd; fi
- if [ $USE_CMAKE == "NO" ] ; then ../configure ; fi
- if [ $USE_CMAKE == 'YES' ] ; then cmake .. ; fi
- if [ $USE_CMAKE == 'NO' ] ; then pushd .. ; autoreconf -i ; popd; fi
- if [ $USE_CMAKE == 'NO' ] ; then ../configure ; fi
- make
- if [ $USE_CMAKE == "YES" ] ; then CTEST_OUTPUT_ON_FAILURE=1 make test ; fi
- if [ $USE_CMAKE == "NO" ] ; then make check ; fi
- if [ $USE_CMAKE == 'YES' ] ; then CTEST_OUTPUT_ON_FAILURE=1 make test ; fi
- if [ $USE_CMAKE == 'NO' ] ; then make check ; fi
3 changes: 2 additions & 1 deletion src/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ void _tcase_add_test(TCase * tc, TFun fn, const char *name, int _signal,
tf->loop_start = start;
tf->loop_end = end;
tf->signal = _signal; /* 0 means no signal expected */
tf->allowed_exit_value = (WEXITSTATUS_MASK & allowed_exit_value); /* 0 is default successful exit */
tf->allowed_exit_value =
(WEXITSTATUS_MASK & allowed_exit_value); /* 0 is default successful exit */
tf->name = name;
check_list_add_end(tc->tflst, tf);
}
Expand Down
20 changes: 11 additions & 9 deletions src/check_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@ void xml_lfun(SRunner * sr CK_ATTRIBUTE_UNUSED, FILE * file,
switch (evt)
{
case CLINITLOG_SR:
fprintf(file, "<?xml version=\"1.0\"?>\n");
fprintf(file,
"<?xml-stylesheet type=\"text/xsl\" href=\"http://check.sourceforge.net/xml/check_unittest.xslt\"?>\n");
fprintf(file,
"<testsuites xmlns=\"http://check.sourceforge.net/ns\">\n");
fprintf(file, " <datetime>%s</datetime>\n", t);
"<?xml version=\"1.0\"?>\n"
"<?xml-stylesheet type=\"text/xsl\" "
"href=\"http://check.sourceforge.net/xml/check_unittest.xslt\"?>\n"
"<testsuites xmlns=\"http://check.sourceforge.net/ns\">\n"
" <datetime>%s</datetime>\n", t);
break;
case CLENDLOG_SR:
{
Expand All @@ -304,17 +304,19 @@ void xml_lfun(SRunner * sr CK_ATTRIBUTE_UNUSED, FILE * file,
/* calculate time the test were running */
clock_gettime(check_get_clockid(), &ts_end);
duration = (unsigned long)DIFF_IN_USEC(ts_start, ts_end);
fprintf(file, " <duration>%lu.%06lu</duration>\n",
fprintf(file,
" <duration>%lu.%06lu</duration>\n"
"</testsuites>\n",
duration / US_PER_SEC, duration % US_PER_SEC);
fprintf(file, "</testsuites>\n");
}
break;
case CLSTART_SR:
break;
case CLSTART_S:
s = (Suite *)obj;
fprintf(file, " <suite>\n");
fprintf(file, " <title>");
fprintf(file,
" <suite>\n"
" <title>");
fprint_xml_esc(file, s->name);
fprintf(file, "</title>\n");
break;
Expand Down
2 changes: 1 addition & 1 deletion src/check_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef HAVE_PTHREAD
#define pthread_mutex_lock(arg)
#define pthread_mutex_unlock(arg)
#define pthread_cleanup_push(f,a) {
#define pthread_cleanup_push(f, a) {
#define pthread_cleanup_pop(e) }
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/check_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static TestResult *tcase_run_tfun_fork(SRunner * sr, TCase * tc, TF * tfun,
alarm_received = 0;

if(timer_create(check_get_clockid(),
NULL /* fire SIGALRM if timer expires */ ,
NULL /* fire SIGALRM if timer expires */,
&timerid) == 0)
{
/* Set the timer to fire once */
Expand Down