Skip to content

Commit

Permalink
Fix OS X build, make Eyescale#38 test more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eilemann authored and Stefan Eilemann committed Jan 22, 2014
1 parent e4c8d2b commit f347b3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CMake/GitExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function(GIT_EXTERNAL DIR REPO TAG)
get_filename_component(GIT_EXTERNAL_DIR "${DIR}/.." ABSOLUTE)

if(NOT EXISTS "${DIR}")
message("git clone ${REPO} ${DIR}")
message(STATUS "git clone ${REPO} ${DIR}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone "${REPO}" "${DIR}"
RESULT_VARIABLE nok ERROR_VARIABLE error
Expand All @@ -39,7 +39,7 @@ function(GIT_EXTERNAL DIR REPO TAG)
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${DIR}")
if(nok)
message(WARNING "Update of ${DIR} failed: ${error}\n")
message(STATUS "Update of ${DIR} failed:\n ${error}")
endif()

execute_process(
Expand Down
9 changes: 5 additions & 4 deletions tests/issue38.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class Writer : public lunchbox::Thread
: runtime( 0.f )
{}

void start( co::ConnectionPtr connection )
void startSend( co::ConnectionPtr connection )
{
connection_ = connection;
TEST( lunchbox::Thread::start( ));
TEST( start( ));
}

void run() override
Expand Down Expand Up @@ -89,7 +89,7 @@ int main( int argc, char **argv )
TEST( reader );

set.addConnection( reader );
threads[i].start( writers[i] );
threads[i].startSend( writers[i] );
}

co::Buffer buffer;
Expand All @@ -109,11 +109,12 @@ int main( int argc, char **argv )
}

const float runtime = threads[0].runtime;
const float delta = runtime / 10.f;
for( size_t i = 0; i < NCONNECTIONS; ++i )
{
threads[i].join();
writers[i]->close();
TESTINFO( std::abs( threads[i].runtime - runtime ) < 10.f ,
TESTINFO( std::abs( threads[i].runtime - runtime ) < delta ,
threads[i].runtime << " != " << runtime );
}

Expand Down

0 comments on commit f347b3f

Please sign in to comment.