1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
Commit graph

28 commits

Author SHA1 Message Date
patrick96
286eac393c tests: Build and run all tests with make check
Simplifies the building and running of tests

Also exports the proper env variables so that the googletest output is
colored

ctest can use env variables for some of its options so we can for
example run
  CTEST_PROGRESS_OUTPUT=1 make check
to run ctest with the --progress flag

This also makes the travis test.sh script obsolete
2019-01-20 15:11:14 +01:00
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
38f551f884 test(parser): Add tests for parse_action_cmd 2018-11-16 18:12:26 -08:00
patrick96
e794fe0d01 fix(gtest): prefer target_link_libraries
From commit 880896c6f4814f4c7798355a652dc6167be2b75f in googletest cmake
test configuration fails with errors like

CMake Error: install(EXPORT "gtestConfigInternal" ...) includes target
  "gtest" which requires target "i3ipc++" that is not in the export set.

The issue was that link_libraries also affected the googletest internal
targets that came after it making the whole thing fail.

This could also have been solved by moving link_libraries after the
configuration of googletest but according to the cmake documentation [1]
target_link_libraries should be prefered over link_libraries anyways.

[1]: https://cmake.org/cmake/help/latest/command/link_libraries.html

Fixes #1393
2018-08-31 13:17:19 -07:00
patrick96
a3786be26a tests: Disable -Werror for tests
This way we can still run tests with some compiler warnings
2018-07-30 14:12:22 +02:00
patrick96
4b83468eb9 refactor(builder): Add failing test for ellipsis
Adds failing tests for the bug described in #1194
2018-07-22 14:02:15 -07:00
patrick96
cc9423e682 bar: Add geom_format_to_pixels tests 2018-05-10 00:05:18 +02:00
patrick96
553fde9499 fix(tests): Add forgotten scope test 2018-05-01 20:14:23 -07:00
patrick96
fce313f3ef tests: Fix clang build
Compiling gtest with clang fails with -Wmissing-field-initializers as
reported in [1]
[1]: https://github.com/google/googletest/issues/1521
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
fa99be63a0 tests: Don't include src dir
Since we now link source files instead of including them, this is not
necessary anymore
2018-04-10 00:56:51 +02:00
patrick96
eb6159767b tests: Remove log message 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
Michael Carlberg
d3b0670f30 fix(config): Perform tilde expansion on include-file #603 2017-06-02 18:34:49 +02:00
Michael Carlberg
43a17c3b36 refactor(cmake): Cleanup 2017-01-26 17:39:50 +01:00
Michael Carlberg
6ce1c9805e refactor(tests): Use new factory methods 2016-12-15 19:05:26 +01:00
Michael Carlberg
2d66dc9a57 fix: Disable tests requiring X connection 2016-11-21 00:07:34 +01:00
Michael Carlberg
c6d85b2b92 refactor: Optimize build 2016-11-20 23:04:31 +01:00
Michael Carlberg
b3df50082a fix(tests): Run unit tests on travis 2016-11-19 08:30:00 +01:00
Michael Carlberg
e7cb345cec wip: Separate source from definitions 2016-11-03 12:54:32 +01:00
Michael Carlberg
26c308cc19 feat(color_util): Utility functions for color handling 2016-10-31 01:25:19 +01:00
Michael Carlberg
efba06dc2d fix(xft): Allocate xft color by value
- Solves the issue with transparency using Xft.
- X11 fonts are still affected by the alpha issue.

Closes jaagr/lemonbuddy#119
2016-10-30 02:37:56 +01:00
Michael Carlberg
bc67e64e79 feat: Add math_util::percentage_to_value 2016-10-25 07:05:01 +02:00
Michael Carlberg
769a3debe7 refactor(tests): Drop CppUnit 2016-10-25 01:47:00 +02:00
Michael Carlberg
d23119e24e fix(build): Make project compile using gcc5/gcc6 2016-10-11 12:58:26 +02:00
Michael Carlberg
a9553ff850 refactor: Cleanup 2016-10-10 18:58:57 +02:00
Michael Carlberg
d359ab6057 refactor: Application rewrite 2016-10-10 14:52:57 +02:00