mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #855 from heinrich5991/pr_ddnet_tests_travis_linux
Run tests on Travis on Linux
This commit is contained in:
commit
f5e1ba7638
|
@ -8,13 +8,17 @@ addons:
|
|||
apt:
|
||||
packages:
|
||||
- libfreetype6-dev
|
||||
- libgtest-dev
|
||||
- libsdl2-dev
|
||||
script:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install sdl2; fi
|
||||
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then mkdir gtest_build; cmake -E chdir gtest_build cmake /usr/src/gtest; cmake --build gtest_build; fi
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -Werror=dev ..
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -Werror=dev ..; fi
|
||||
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then cmake -Werror=dev -DGTEST_LIBRARY=../gtest_build/libgtest.a -DGTEST_MAIN_LIBRARY=../gtest_build/libgtest_main.a ..; fi
|
||||
- make everything
|
||||
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then make run_tests; fi
|
||||
env:
|
||||
global:
|
||||
- CFLAGS="-Wdeclaration-after-statement -Werror"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class StripPathAndExtension : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
void testEq(const char *pInput, const char *pOutput)
|
||||
void Test(const char *pInput, const char *pOutput)
|
||||
{
|
||||
char aBuf[32];
|
||||
IStorage::StripPathAndExtension(pInput, aBuf, sizeof(aBuf));
|
||||
|
@ -14,22 +14,27 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
TEST_F(StripPathAndExtension, WorksOnBareFilename) {
|
||||
testEq("abc", "abc");
|
||||
TEST_F(StripPathAndExtension, WorksOnBareFilename)
|
||||
{
|
||||
Test("abc", "abc");
|
||||
}
|
||||
|
||||
TEST_F(StripPathAndExtension, NormalPath) {
|
||||
testEq("/usr/share/teeworlds/data/mapres/grass_main.png", "grass_main");
|
||||
TEST_F(StripPathAndExtension, NormalPath)
|
||||
{
|
||||
Test("/usr/share/teeworlds/data/mapres/grass_main.png", "grass_main");
|
||||
}
|
||||
|
||||
TEST_F(StripPathAndExtension, NormalFile) {
|
||||
testEq("winter_main.png", "winter_main");
|
||||
TEST_F(StripPathAndExtension, NormalFile)
|
||||
{
|
||||
Test("winter_main.png", "winter_main");
|
||||
}
|
||||
|
||||
TEST_F(StripPathAndExtension, DotInFolder) {
|
||||
testEq("C:\\a.b\\c", "c");
|
||||
TEST_F(StripPathAndExtension, DotInFolder)
|
||||
{
|
||||
Test("C:\\a.b\\c", "c");
|
||||
}
|
||||
|
||||
TEST_F(StripPathAndExtension, DoubleDot) {
|
||||
testEq("file.name.png", "file.name");
|
||||
TEST_F(StripPathAndExtension, DoubleDot)
|
||||
{
|
||||
Test("file.name.png", "file.name");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue