Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #14 from jmdavis/time.
Browse files Browse the repository at this point in the history
Move test disable from makefile to inside core.time
  • Loading branch information
braddr committed Apr 30, 2011
2 parents 58ce3e7 + 16194be commit c546d5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion posix.mak
Expand Up @@ -520,7 +520,7 @@ unittest : $(addprefix $(OBJDIR)/,$(SRC_D_MODULES)) $(DRUNTIME) $(OBJDIR)/emptym
@echo done

ifeq ($(OS),freebsd)
DISABLED_TESTS = core/time
DISABLED_TESTS =
else
DISABLED_TESTS =
endif
Expand Down
20 changes: 6 additions & 14 deletions src/core/time.d
Expand Up @@ -12,15 +12,10 @@
are a few functions that also allow "nsecs", but very little actually
has precision greater than hnsecs.
Copyright: Copyright Jonathan M Davis 2010 - 2010.
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
Copyright: Copyright 2010 - 2011
License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Jonathan M Davis and Kato Shoichi
+/

/+ Copyright Jonathan M Davis 2010 - 2010.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
Source: $(PHOBOSSRC std/_datetime.d)
+/
module core.time;

Expand All @@ -40,7 +35,6 @@ import core.sys.posix.sys.time;

//This probably should be moved somewhere else in druntime which
//is OSX-specific.
//It's also totally untested, since I don't a have a Mac.
version(OSX)
{

Expand Down Expand Up @@ -1534,11 +1528,9 @@ struct TickDuration
//test from!"nsecs"().
unittest
{
//Skipping tests on Windows until properly robust tests
//can be devised and tested on a Windows box.
//The differences in ticksPerSec on Windows makes testing
//exact values a bit precarious.
version(Posix)
//Skipping tests everywhere except for Linux until properly robust tests
//can be devised.
version(linux)
{
auto t = TickDuration.from!"nsecs"(1_000_000_000);
assert(t.nsecs == 1_000_000_000);
Expand Down

0 comments on commit c546d5b

Please sign in to comment.