Commit Graph

171 Commits

Author SHA1 Message Date
Ted Lyngmo
9855552f64 Add sf::Shape::getGeometricCenter()
This adds

    virtual Vector2f getGeometricCenter() const = 0;

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
2023-05-15 16:13:39 -06:00
Chris Thrasher
f6dfc04938 Switch to Catch2 2023-05-13 12:38:11 -06:00
Chris Thrasher
b14d0b47e6 Fix broken sf::swap overloads 2023-05-13 12:20:44 -06:00
Chris Thrasher
98a59d62c7 Upgrade to CMake 3.22 2023-05-13 12:09:09 -06:00
Chris Thrasher
27249d42ed Add sf::WindowBase::set{Min|Max}imumSize()
Co-authored-by: Shane Whitmire <dogunbound5@gmail.com>
Co-authored-by: michael.david.howard@outlook.com <michael.david.howard@outlook.com>
2023-05-12 14:36:06 -06:00
Chris Thrasher
fb1cfdc48d Add misc-const-correctness clang-tidy check 2023-05-04 16:22:03 -06:00
Chris Thrasher
29863b14a5 Remove default sf::Sprite constructor 2023-05-03 13:33:42 -06:00
Chris Thrasher
1c5c8ad700 Add tests for sf::sleep 2023-04-28 15:01:11 -06:00
vittorioromeo
cbfa9cbb65 Reorder includes hierarchically 2023-04-25 17:25:33 +02:00
alireza
5480bf8a93
Fixed move semantics for sf::Cursor and added test for it 2023-04-22 18:29:05 +02:00
Jan Wojciechowski
692fe84331 Fix condition for trailing bytes count in UTF-8 decoder. Test added to check if a replacement characters is added to output. 2023-04-19 23:52:38 +02:00
vittorioromeo
c6226258db Improve test utility header compilation speed 2023-04-13 16:33:49 +02:00
Chris Thrasher
82b9821a8a Add clang-tidy bugprone-* checks 2023-04-12 19:53:36 -06:00
Chris Thrasher
cafaa1c153 Add clang-tidy performance-* checks 2023-04-10 10:08:13 -06:00
binary1248
ea4c448a85 Add support for installing and using the Mesa 3D library for OpenGL rendering. 2023-04-06 11:15:56 -06:00
Chris Thrasher
f371a99b39 Implement sf::String in terms of std::u32string 2023-04-04 15:47:34 -06:00
binary1248
7004db1cd9 Added sf::RenderWindow, sf::Shader and sf::Window tests. 2023-04-04 10:27:21 +02:00
Chris Thrasher
ebe4b3c437 Add tests for sf::String 2023-04-03 21:23:43 -06:00
Jonny
741fe219da
Use built-in CMake support for iOS
* Use built-in iOS support for cmake and expand tests to cover more configurations
* Adjust CI builds
* Update examples version

---------

Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
2023-04-03 23:36:33 +02:00
Chris Thrasher
92e5a1e4e6 Implement move semantics for sf::Cursor 2023-04-03 01:02:26 -06:00
binary1248
5048c4d801 Added sf::Texture tests. 2023-03-30 22:24:40 +02:00
Jim-Marsden
a8bc8cf889 Added move constructor, and move assignment operator. 2023-03-29 23:48:05 +02:00
Chris Thrasher
2d2f684786 Fix clang-tidy-16 errors 2023-03-28 19:54:06 -06:00
binary1248
acba3e6165 Replaced xvfb-run with manually starting Xvfb and running fluxbox to emulate a window manager and combined test and coverage steps into a single step. 2023-03-27 19:46:07 -06:00
Chris Thrasher
0b62543942 Don't automatically run tests after build
The runtests target must be used on Windows for the sake of code
coverage. However we can't use that target on all other platforms
because on some non-Windows platforms like Android, the tests don't
even get configured. If you try to build a target that doesn't exist
you get a hard failure. Using CTest is better because it will still
return zero even if no tests are found as is the case on Android.
2023-03-14 20:23:17 -06:00
Chris Thrasher
b6c54ac589 Use unity builds to speed up clang-tidy runtime 2023-03-14 10:08:23 -06:00
Lukas Dürrenberger
90f05ac4e8 Switch to using Documentation IP ranges in tests
Documentation IP ranges are define in RFC 5737 and are 'safe' address
for documentation purposes
2023-03-09 16:40:01 -07:00
binary1248
f4e0c4b4c0 Make moving Shapes, swapping Textures and swapping VertexBuffers noexcept. 2023-03-07 16:32:35 -07:00
Chris Thrasher
41aa062272 Add modernize-use-auto clang-tidy check 2023-02-15 09:42:50 -07:00
Chris Thrasher
2a2ddee221 Disable unreliable tests 2023-02-15 09:39:11 -07:00
Chris Thrasher
9d0b2ba592 Add tests for sf::Cursor 2023-02-14 07:34:07 -07:00
Chris Thrasher
cdf8ab38fb Add tests for sf::VertexBuffer 2023-02-13 11:47:53 -07:00
Chris Thrasher
2af65286b7 Add tests for sf::WindowBase 2023-02-08 00:22:42 -07:00
Jim-Marsden
976bbda911 Drawable Test 2023-01-24 16:27:11 -07:00
Chris Thrasher
dd83189fae Enable move semantics for SoundFile types
Funny how the addition of a forward declaration resulted in
accidentally disabling move semantics for two types. We ought to
be careful that build time improvements don't have runtime
performance impacts.
2023-01-22 15:50:53 -07:00
Norm Evangelista
6ef8e487cc Added readability-qualified-auto, -redundant-access-specifiers
Fixed clang-format escapes

Fixed OSX clang-tidy issues

Collapsed extraneous lines

Fixed clang-format escape
2023-01-19 15:53:40 -07:00
Chris Thrasher
84f56d0936 Add option for skipping tests that require an attached display 2023-01-18 16:06:00 -07:00
Chris Thrasher
b128fcd3df Add tests for sf::Texture 2023-01-18 16:06:00 -07:00
Chris Thrasher
b2e918bafc Simplify how test runner command is created 2023-01-18 16:06:00 -07:00
Chris Thrasher
badb388507 Remove unnecessary casts 2023-01-11 15:30:22 -07:00
Chris Thrasher
098f6927d2 Prevent using a temporary sf::SoundBuffer with sf::Sound 2023-01-06 15:46:22 -07:00
Chris Thrasher
0c2f7da9f9 Prevent using a temporary sf::Texture with sf::Sprite 2023-01-06 15:46:22 -07:00
Chris Thrasher
3f4bb1ae12 Prevent constructing sf::Text with a temporary sf::Font
By deleting this constructor overload, it fails to compile if
you pass a temporary font to this parameter slot. That includes
code like

  sf::Text text("", sf::Font());

but more importantly it prohibits code like this

  sf::Font getFont()
  {
    sf::Font font;
    // load a font...
    return font;
  }

  sf::Text text("", getFont());

The same idea can be applied to setFont() to prevent setting fonts
from a temporary.

Credit to Jonny for the idea

Co-authored-by: JonnyPtn <jonathan.r.paton@googlemail.com>
2023-01-06 10:21:00 -07:00
Chris Thrasher
718195bf25 Mark move operators as noexcept 2023-01-04 09:49:20 -07:00
Jim-Marsden
34b6323929 Changed to namespace 2023-01-01 14:31:26 -07:00
Jim-Marsden
7884efc49e Replaced Header Guards with Pragma Once 2022-12-27 20:08:11 +01:00
Chris Thrasher
e8fa5d7d31
Add CI job for Clang on Windows 2022-12-14 15:26:08 -07:00
Chris Thrasher
3b6db4d18c Enforce variable case 2022-12-12 16:10:03 -07:00
Chris Thrasher
4807c779a7 Apply warnings to install test
Because the install test project can't access SFML CMake functions,
these warnings are only applied when building the install tests as
a part of SFML.
2022-11-29 00:47:32 -07:00
jim
1d4db22d62 Added move constructor/operator 2022-11-19 19:52:45 -07:00