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 8389470
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 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
4 changes: 4 additions & 0 deletions tests/src/functions-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,23 +264,27 @@ void FunctionsTest::testParseMarkdownIssueLinks()

void FunctionsTest::testSetFileCreationDate()
{
#if !defined(Q_OS_MACOS)
QString path = "tests/resources/pages/behoimi.org/results.json";
QDateTime date = QDateTime::currentDateTimeUtc();

setFileCreationDate(path, date);

QDateTime created = fileCreationDate(path);
QCOMPARE(created.toTime_t(), date.toTime_t());
#endif
}
void FunctionsTest::testSetFileCreationDateUtf8()
{
#if !defined(Q_OS_MACOS)
QString path = "tests/resources/你好.txt";
QDateTime date = QDateTime::currentDateTimeUtc();

setFileCreationDate(path, date);

QDateTime created = fileCreationDate(path);
QCOMPARE(created.toTime_t(), date.toTime_t());
#endif
}


Expand Down

0 comments on commit 8389470

Please sign in to comment.