Commit 25c16bd45b4e60ea40cb2a8144b24dab1f7ca5ca

Authored by Georg GH. Hopp
2 parents e71b83d7 cad7e8e7

Merge branch '#1/enhancement/Build_with_CI' into 'master'

closes #1

#1/enhancement/build with ci

This fixes some problems with the tests as well as it integrates a first CI control file.

See merge request !1
  1 +stages:
  2 + - build
  3 + - test
  4 + - deploy
  5 +
  6 +before_script:
  7 + - ./bootstrap
  8 + - ./configure --enable-gcov
  9 +
  10 +build:
  11 + stage: build
  12 + script:
  13 + - make
  14 +
  15 +coverage:dev:
  16 + stage: test
  17 + except:
  18 + - tags
  19 + script:
  20 + - make coverage-html
  21 + - ssh ci_upload@192.168.20.60 install -d trbase
  22 + - >
  23 + rsync -vaurl --delete tests/coverage/*/
  24 + ci_upload@192.168.20.60:~/trbase/coverage_${CI_BUILD_ID}
  25 + - >
  26 + ssh ci_upload@192.168.20.60
  27 + ln -sf trbase/coverage_${CI_BUILD_ID} trbase/coverage_latest
  28 +
  29 +coverage:tag:
  30 + stage: test
  31 + only:
  32 + - tags
  33 + script:
  34 + - make coverage-html
  35 + - ssh ci_upload@192.168.20.60 install -d trbase
  36 + - rsync -vaurl --delete tests/coverage ci_upload@192.168.20.60:~/trbase/
  37 + - ssh ci_upload@192.168.20.60 ln -sf trbase/coverage trbase/coverage_latest
  38 +
  39 +dist:
  40 + stage: deploy
  41 + only:
  42 + - tags
  43 + script:
  44 + - make dist
  45 + - ssh ci_upload@192.168.20.60 install -d trbase/artifacts
  46 + - scp libtrbase-*.tar.gz ci_upload@192.168.20.60:~/trbase/artifacts
@@ -3,14 +3,14 @@ @@ -3,14 +3,14 @@
3 3
4 AC_PREREQ([2.68]) 4 AC_PREREQ([2.68])
5 AC_INIT([libtrbase], 5 AC_INIT([libtrbase],
6 - [1.0.1], 6 + [1.0.2],
7 [Georg Hopp <georg@steffers.org>]) 7 [Georg Hopp <georg@steffers.org>])
8 LT_INIT 8 LT_INIT
9 AM_INIT_AUTOMAKE 9 AM_INIT_AUTOMAKE
10 #AM_INIT_AUTOMAKE([subdir-objects]) 10 #AM_INIT_AUTOMAKE([subdir-objects])
11 AM_SILENT_RULES([yes]) 11 AM_SILENT_RULES([yes])
12 -AC_COPYRIGHT([Copyright © 2013 Georg Hopp])  
13 -AC_REVISION([1.0.1]) 12 +AC_COPYRIGHT([Copyright © 2016 Georg Hopp])
  13 +AC_REVISION([1.0.2])
14 AC_CONFIG_SRCDIR([src/interface.c]) 14 AC_CONFIG_SRCDIR([src/interface.c])
15 AC_CONFIG_HEADERS([config.h]) 15 AC_CONFIG_HEADERS([config.h])
16 AC_CONFIG_MACRO_DIR([m4]) 16 AC_CONFIG_MACRO_DIR([m4])
@@ -21,6 +21,9 @@ AC_TDD_GCOV @@ -21,6 +21,9 @@ AC_TDD_GCOV
21 m4_include([m4/memopt.m4]) 21 m4_include([m4/memopt.m4])
22 AC_MEM_OPT 22 AC_MEM_OPT
23 23
  24 +m4_include([m4/chkamd.m4])
  25 +AC_CHK_AMD
  26 +
24 # Checks for programs. 27 # Checks for programs.
25 AC_PROG_CXX 28 AC_PROG_CXX
26 AC_PROG_CC 29 AC_PROG_CC
  1 +AC_DEFUN([AC_CHK_AMD],
  2 +[
  3 + AM_CONDITIONAL(IS_AMD, test "AuthenticAMD" = "$(uname -i)")
  4 +])
  5 +
  6 +# vim: set ft=m4 ts=2 sw=2:
@@ -31,7 +31,7 @@ AC_DEFUN([AC_TDD_GCOV], @@ -31,7 +31,7 @@ AC_DEFUN([AC_TDD_GCOV],
31 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) 31 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
32 fi 32 fi
33 33
34 - lcov_version_list="1.6 1.7 1.8 1.9 1.10" 34 + lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11"
35 AC_CHECK_PROG(LCOV, lcov, lcov) 35 AC_CHECK_PROG(LCOV, lcov, lcov)
36 AC_CHECK_PROG(GENHTML, genhtml, genhtml) 36 AC_CHECK_PROG(GENHTML, genhtml, genhtml)
37 37
1 ACLOCAL_AMFLAGS = -I m4 1 ACLOCAL_AMFLAGS = -I m4
2 AUTOMAKE_OPTIONS = subdir-objects 2 AUTOMAKE_OPTIONS = subdir-objects
3 3
  4 +if IS_AMD
  5 +else
4 TESTS_ENVIRONMENT = valgrind \ 6 TESTS_ENVIRONMENT = valgrind \
5 --error-exitcode=123 \ 7 --error-exitcode=123 \
6 --leak-check=full \ 8 --leak-check=full \
7 --suppressions=./suppress/external.supp \ 9 --suppressions=./suppress/external.supp \
8 --quiet 10 --quiet
  11 +endif
9 TESTS = classTest 12 TESTS = classTest
10 check_PROGRAMS = classTest 13 check_PROGRAMS = classTest
11 14
@@ -43,7 +46,7 @@ coverage-html: clean clean-coverage check @@ -43,7 +46,7 @@ coverage-html: clean clean-coverage check
43 $(LCOV) -d $(top_srcdir) \ 46 $(LCOV) -d $(top_srcdir) \
44 -a ./coverage.base -a ./coverage.run \ 47 -a ./coverage.base -a ./coverage.run \
45 -o coverage.info 48 -o coverage.info
46 - LANG=C $(GENHTML) --prefix $(top_srcdir) \ 49 + LANG=C $(GENHTML) --prefix $(PWD) \
47 --output-directory $(cov_dir) \ 50 --output-directory $(cov_dir) \
48 --title "$(PACKAGE_NAME) $(PACKAGE_VERSION)" \ 51 --title "$(PACKAGE_NAME) $(PACKAGE_VERSION)" \
49 --legend --branch-coverage --show-details coverage.run 52 --legend --branch-coverage --show-details coverage.run
@@ -51,15 +54,15 @@ coverage-html: clean clean-coverage check @@ -51,15 +54,15 @@ coverage-html: clean clean-coverage check
51 clean-coverage: clean-gcda clean-gcno 54 clean-coverage: clean-gcda clean-gcno
52 $(LCOV) -d $(top_srcdir) -z 55 $(LCOV) -d $(top_srcdir) -z
53 -rm -rf coverage.info coverage.base coverage.run $(cov_dir) 56 -rm -rf coverage.info coverage.base coverage.run $(cov_dir)
54 - 57 +
55 clean-gcda: 58 clean-gcda:
56 @echo Removing old coverage results 59 @echo Removing old coverage results
57 -find $(top_srcdir) -name '*.gcda' -print | xargs -r rm 60 -find $(top_srcdir) -name '*.gcda' -print | xargs -r rm
58 - 61 +
59 clean-gcno: 62 clean-gcno:
60 @echo Removing old coverage results 63 @echo Removing old coverage results
61 -find $(top_srcdir) -name '*.gcno' -print | xargs -r rm 64 -find $(top_srcdir) -name '*.gcno' -print | xargs -r rm
62 - 65 +
63 clean-local: clean-coverage 66 clean-local: clean-coverage
64 67
65 endif # HAVE_GCOV 68 endif # HAVE_GCOV
@@ -67,6 +67,6 @@ mockClone(void * _this, void * _base) @@ -67,6 +67,6 @@ mockClone(void * _this, void * _base)
67 } 67 }
68 68
69 TR_INIT_IFACE(TR_Class, mockCtor, mockDtor, mockClone); 69 TR_INIT_IFACE(TR_Class, mockCtor, mockDtor, mockClone);
70 -TR_CREATE_CLASS(MockClass, NULL, TR_IF(TR_Class)); 70 +TR_CREATE_CLASS(MockClass, NULL, NULL, TR_IF(TR_Class));
71 71
72 // vim: set et ts=4 sw=4: 72 // vim: set et ts=4 sw=4:
@@ -36,6 +36,7 @@ void _reset(); @@ -36,6 +36,7 @@ void _reset();
36 TR_CLASS(MockClass) { 36 TR_CLASS(MockClass) {
37 int value; 37 int value;
38 }; 38 };
  39 +TR_CLASSVARS_DECL(MockClass) {};
39 40
40 /** 41 /**
41 * ~~~ method declarations ~~~~~~~~ 42 * ~~~ method declarations ~~~~~~~~
@@ -89,7 +89,7 @@ main(int argc, char * argv[]) @@ -89,7 +89,7 @@ main(int argc, char * argv[])
89 if (_setUp && NULL != tearDown) { 89 if (_setUp && NULL != tearDown) {
90 int _tearDown = tearDown(); 90 int _tearDown = tearDown();
91 91
92 - if ((! TEST_OK == _tearDown) && TEST_OK == result) { 92 + if ((!(TEST_OK == _tearDown)) && TEST_OK == result) {
93 result = _tearDown; 93 result = _tearDown;
94 } 94 }
95 } 95 }
Please register or login to post a comment