Commit Graph

57 Commits

Author SHA1 Message Date
sam-lunt
d3e37918e5 CMake refactor (#1510)
* Clean up CMake logic

- removed logic to find CppUnit (no longer used)
- removed "dirs" variable used to pass include directories
- removed add_library function (no longer used)
- removed make_executable function
    * only used in 2 places (polybar and polybar-msg)
    * it was more general than needed, logic is simpler without it
- split polybar into static library and executable
    * this allows linking unit tests to the library

* rename library

* add coverage build

- Added a CMake build type "Coverage" that builds C and C++
  code with the "--coverage" flag (recognized by both GCC and Clang)
- removed "-Wno-missing-field-initializers" from test flags,
  since it didn't seem to be needed any more
- removed logic from tests/CMakeLists to disable "-Werror" and "-pedantic-errors"
  since there didn't seem to be any warnings during the build

* fix whitespace

* update travis

* remove O2 from defalt flags

* allow tests to be built by default make target

* disable Werror for debug builds
2018-11-21 18:46:33 +01:00
patrick96
d43a4a8d9d refactor(travis): Remove Debug build configurations
They're not really any different from the release builds and only
elongate the build process. Also now that we have a minimal build, we
would have more than five build configurations which would make travis
limit itself to five concurrent builds, letting the last build wait on
the others.

Also it's just unnecessary load on the travis servers
2018-06-18 11:49:31 +02:00
patrick96
747cdfe7f5 refactor(travis): Add minimal build configuration
Uses none of the optional dependencies. This ensures that polybar can
build without any of the supposedly optional dependencies. This would
have detected the cause of the xrm build failure before it was merged
2018-06-18 11:49:31 +02:00
patrick96
5d350dead8 refactor(travis): Use anchor for apt packages
This allows use to pick and choose apt packages for each of our build
configurations

This makes the definition of a new build configuration more verbose but
it gives us greater flexibility and it's also a preparation for a new
build configuration with minimal number of packages
2018-06-18 11:49:31 +02:00
NBonaparte
4dfa4079be feat(travis): switch to codecov for code coverage (#1165) 2018-04-16 20:03:34 +02:00
patrick96
6cee262225 travis: Move MAKEFLAGS to .travis.yml 2018-04-11 19:37:50 -07:00
patrick96
c900a9958d travis: Don't fetch as many git commits 2018-04-11 19:37:50 -07:00
patrick96
0394172cc3 travis: Enable ccache and apt caching
Will massively decrease build time
2018-04-11 19:37:50 -07:00
patrick96
a8234ddd4e travis: Don't install specific compilers
clang is already installed in travis' trusty environment

Should decrease build time quite a bit because we don't need to download
and compule libc++
2018-04-11 19:37:50 -07:00
patrick96
7b7498bde1 travis: Remove custom cmake
Travis provides cmake 3.9.2 ([1])

[1]:
https://docs.travis-ci.com/user/build-environment-updates/2017-12-12/
2018-04-11 19:37:50 -07:00
patrick96
3f9ce4bb99 tests: Only configure tests when asked for
This prevents the download of googletest for normal builds. Now when we
want to compile and run tests we need to specify -DBUILD_TESTS=ON
2018-04-10 00:56:51 +02:00
patrick96
0e5584920b tests: Use local gtest headers
This makes sure the headers and the compiled gtest library are
compatible
2018-04-10 00:56:51 +02:00
patrick96
cacd161ed7 travis: Send data to coveralls.io after tests
The PYTHONPATH env variable needed to be removed because it was messing
with pip and cpp-coveralls

Unfortunately adding the '-e build' to coveralls doesn't work to exclude
source files in the build directory, as it won't collect any data then.
If at some point, we have source files that are used by the tests
somewhere inside the build folder that isn't covered by the exclusion
rules, we'll need to add it here
2018-04-10 00:56:51 +02:00
patrick96
d768c49980 travis: Separate compiling and testing 2018-04-10 00:56:51 +02:00
patrick96
eed4d3ffc8 fix(tests): Compile gtest at configure time
Ubuntu (and thus travis CI) doesn't have the gtest library in its repos,
only the header files and according to [1], gtest should be compiled in
every project anyways

[1]: https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal
2018-04-10 00:56:51 +02:00
patrick96
c865add821 refactor(tests): Migrate to googletest
googletest (gtest) is more feature rich than the current implementation
which only provides expect() which is basically an assertion. It is also
quite intuitive to use, this can be seen in the rewrite of the
command_line test where EXPECT_THROW replaces a whole try-catch block.

I have also moved the source files the test depend on to be linked in
CMakeLists.txt instead of including them directly because include .cpp
files is bad.

The two x11 tests were removed because they were written two years ago
and a lot of the things they depend on, don't actually exist anymore in
polybar (I think we switched to xpp after those tests were written)

Tests are now compiled with the gcov lib which can be used to provide
test coverage in a second step
2018-04-10 00:56:51 +02:00
NBonaparte
83976a6c5b fix(travis): Add libpulse-dev 2018-01-20 12:37:41 -08:00
NBonaparte
014a9f4c31 fix(travis): Install xcb-util-cursor 2017-09-16 15:31:24 -07:00
Michael Carlberg
214b3ddca8 fix(ci): Deps cache 2017-01-25 15:21:58 +01:00
Michael Carlberg
6692b4a8da refactor(x11): Cleanup 2017-01-24 10:49:14 +01:00
Michael Carlberg
f5adb8ace7 fix(ci): Remove xcb-xrm from apt-get packages 2017-01-20 03:33:54 +01:00
Michael Carlberg
f85e7c8f40 fix(ci): Build xcb-xrm 2017-01-20 03:30:03 +01:00
Michael Carlberg
9e83c55a70 fix: Revert removal of xcb-util-image 2017-01-20 02:54:06 +01:00
Michael Carlberg
aea5e3c9ff fix(ci): Install libxcb-xrm-dev 2017-01-20 02:43:12 +01:00
Michael Carlberg
70bb6f61d4 fix(ci): Use default build type 2016-12-23 17:15:13 +01:00
Michael Carlberg
b692fb4a54 fix(ci): Remove debug prints 2016-12-15 21:01:38 +01:00
Michael Carlberg
7a70ab8942 fix(ci): Capture exported environment variables 2016-12-15 20:10:16 +01:00
Michael Carlberg
32fb7ad9bb fix(ci): Installpackages using the apt addon 2016-12-15 19:16:31 +01:00
Michael Carlberg
510fe7261b fix(ci): Parallel build 2016-11-19 22:01:14 +01:00
Michael Carlberg
489d429644 refactor(ci): Split into scripts 2016-11-19 12:23:02 +01:00
Michael Carlberg
7dedcf6526 fix(ci): Disable e-mail notifications 2016-11-19 08:31:06 +01:00
Michael Carlberg
b3df50082a fix(tests): Run unit tests on travis 2016-11-19 08:30:00 +01:00
Michael Carlberg
fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
Michael Carlberg
ccee2ba025 fix(travis): Install xcb-util-image 2016-11-04 20:57:22 +01:00
Michael Carlberg
072f836a58 fix(ci): Update build script 2016-10-29 06:58:04 +02:00
Michael Carlberg
ee92c30ff4 fix(ci): Update build script 2016-10-25 14:03:21 +02:00
Michael Carlberg
a2af30a494 fix(ci): Disable gcc and install libc++ packages 2016-10-25 13:02:49 +02:00
Michael Carlberg
e42eb87177 fix(ci): Build jsoncpp from source 2016-10-12 11:49:17 +02:00
Michael Carlberg
40a2c18970 fix(ci): Install i3-wm to build with i3 support 2016-10-12 11:36:59 +02:00
Michael Carlberg
a891f3e53b fix(ci): Do not use ccache 2016-10-12 04:30:03 +02:00
Michael Carlberg
1430e77989 fix(build): Sigc++ is no longer used 2016-10-12 04:16:43 +02:00
Michael Carlberg
dac5a3c804 fix(ci): Update build script 2016-10-11 17:35:58 +02:00
Michael Carlberg
3332e0f915 fix(ci): Add missing dependencies 2016-10-11 11:53:53 +02:00
Michael Carlberg
d359ab6057 refactor: Application rewrite 2016-10-10 14:52:57 +02:00
Michael Carlberg
d81790a70c fix(docs): Updated dependency list 2016-06-27 21:14:34 +02:00
Michael Carlberg
657a9e4a8a fix(ci): Updated dependency list 2016-06-27 21:05:11 +02:00
Michael Carlberg
6d54893834 fix(ci): Build project using both clang and gcc 2016-06-11 13:20:58 +02:00
Michael Carlberg
b15ad8b21c task(ci): Updated travis config 2016-06-11 12:34:56 +02:00
Michael Carlberg
e225201bee fix(ci): Irc notification template 2016-05-31 16:53:03 +02:00
Michael Carlberg
a85b445080 task(ci): Enable ccache 2016-05-31 16:36:20 +02:00