Skip to content

Commit

Permalink
Don't run creation date tests on Travis MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Aug 4, 2018
1 parent 9d5e694 commit 422640b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ if((DEFINED ENV{TRAVIS}) AND UNIX AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCXX)
include(cmake/CodeCoverage.cmake)
setup_target_for_coverage(coverage tests coverage)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
add_definitions(-DTRAVIS=1)
if("$ENV{TRAVIS_OS_NAME}" STREQUAL "osx")
add_definitions(-DTRAVIS_OS_OSX=1)
elseif("$ENV{TRAVIS_OS_NAME}" STREQUAL "linux")
add_definitions(-DTRAVIS_OS_LINUX=1)
endif()
endif()

add_subdirectory(lib)
Expand Down
2 changes: 2 additions & 0 deletions tests/src/functions-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void FunctionsTest::testParseMarkdownIssueLinks()
QCOMPARE(parseMarkdown("issue 123"), QString("issue 123"));
}

#if !defined(TRAVIS) || !defined(TRAVIS_OS_OSX)
void FunctionsTest::testSetFileCreationDate()
{
QString path = "tests/resources/pages/behoimi.org/results.json";
Expand All @@ -282,6 +283,7 @@ void FunctionsTest::testSetFileCreationDateUtf8()
QDateTime created = fileCreationDate(path);
QCOMPARE(created.toTime_t(), date.toTime_t());
}
#endif


void FunctionsTest::assertFixFilename(int platform, const QString &filename, const QString &path, const QString &expected)
Expand Down
6 changes: 4 additions & 2 deletions tests/src/functions-test.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ class FunctionsTest : public TestSuite
void testIsUrl();
void testParseMarkdownHeaders();
void testParseMarkdownIssueLinks();
void testSetFileCreationDate();
void testSetFileCreationDateUtf8();
#if !defined(TRAVIS) || !defined(TRAVIS_OS_OSX)
void testSetFileCreationDate();
void testSetFileCreationDateUtf8();
#endif

protected:
void assertFixFilename(int platform, const QString &filename, const QString &path, const QString &expected);
Expand Down

0 comments on commit 422640b

Please sign in to comment.