Skip to content

Make more modules runnable#5582

Merged
dlang-bot merged 5 commits intodlang:masterfrom
wilzbach:public-runnable
Jul 9, 2017
Merged

Make more modules runnable#5582
dlang-bot merged 5 commits intodlang:masterfrom
wilzbach:public-runnable

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Jul 9, 2017

As no one seems to push this, I went into another round and pushed the status quo one step forward.


Outstanding modules

Here's a list of all the modules that are sill missing - with a short explanation why it's currently blocked.

std.math: equalsDigit is private

> pmake std/math.publictests
generated/linux/release/64/publictests/std_math.d(90): Deprecation: std.math.equalsDigit is not visible from module std_math
generated/linux/release/64/publictests/std_math.d(90): Error: function std.math.equalsDigit is not accessible from module std_math
generated/linux/release/64/publictests/std_math.d(145): Deprecation: std.math.equalsDigit is not visible from module std_math
generated/linux/release/64/publictests/std_math.d(145): Error: function std.math.equalsDigit is not accessible from module std_math

std.stdio: testFilename is version(unittest)

> pmake std/stdio.publictests
std_stdio.o:__main.d:function _D9std_stdio14__unittestL2_1FZv: error: undefined reference to '_D3std5stdio12testFilenameFNfAyamZAya'
std_stdio.o:__main.d:function _D9std_stdio15__unittestL20_2FZv: error: undefined reference to '_D3std5stdio12testFilenameFNfAyamZAya'
std_stdio.o:__main.d:function _D9std_stdio15__unittestL37_3FZv: error: undefined reference to '_D3std5stdio12testFilenameFNfAyamZAya'
std_stdio.o:__main.d:function _D9std_stdio15__unittestL56_4FZv: error: undefined reference to '_D3std5stdio12testFilenameFNfAyamZAya'

stdx.allocator.building_blocks.qunatizer: roundUpToMultipleOf isn't public

> pmake std/experimental/allocator/building_blocks/quantizer.publictests
generated/linux/release/64/publictests/std_experimental_allocator_building_blocks_quantizer.d(14): Error: function std.experimental.allocator.common.roundUpToMultipleOf is not accessible from module std_experimental_allocator_building_blocks_quantizer
generated/linux/release/64/publictests/std_experimental_allocator_building_blocks_quantizer.d(12):        instantiated from here: Quantizer!(FreeTree!(GCAllocator), (n) => n.roundUpToMultipleOf(n <= 16384 ? 64 : 4096))

stdx.allocator.building_blocks.free_list (TBD)

> pmake std/experimental/allocator/building_blocks/free_list.publictests
std/experimental/allocator/building_blocks/free_list.d(124): Error: @safe function 'std.experimental.allocator.building_blocks.free_list.FreeList!(Mallocator, 18446744073709551614LU, 18446744073709551614LU, cast(Flag)false).FreeList.__unittestL118_1301' cannot call @system function 'std.experimental.allocator.building_blocks.free_list.FreeList!(Mallocator, 18446744073709551614LU, 18446744073709551614LU, cast(Flag)false).FreeList.min'
std/experimental/allocator/building_blocks/free_list.d(125): Error: @safe function 'std.experimental.allocator.building_blocks.free_list.FreeList!(Mallocator, 18446744073709551614LU, 18446744073709551614LU, cast(Flag)false).FreeList.__unittestL118_1301' cannot call @system function 'std.experimental.allocator.building_blocks.free_list.FreeList!(Mallocator, 18446744073709551614LU, 18446744073709551614LU, cast(Flag)false).FreeList.max'
std/experimental/allocator/building_blocks/free_list.d(244): Warning: statement is not reachable
std/experimental/allocator/building_blocks/free_list.d(252): Warning: statement is not reachable
generated/linux/release/64/publictests/std_experimental_allocator_building_blocks_free_list.d(9): Error: template instance std.experimental.allocator.building_blocks.free_list.FreeList!(Mallocator, 18446744073709551614LU, 18446744073709551614LU, cast(Flag)false) error instantiating

std.traits (TBD)

For std.traits one needs to apply this patch first:

diff --git a/std/traits.d b/std/traits.d
index d32a5e967..40afc91c0 100644
--- a/std/traits.d
+++ b/std/traits.d
@@ -2429,6 +2429,7 @@ template Fields(T)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
     struct S { int x; float y; }
     static assert(is(Fields!S == AliasSeq!(int, float)));
 }
@@ -2485,6 +2486,7 @@ template FieldNameTuple(T)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
     struct S { int x; float y; }
     static assert(FieldNameTuple!S == AliasSeq!("x", "y"));
     static assert(FieldNameTuple!int == AliasSeq!"");
@@ -2631,7 +2633,7 @@ private template hasRawAliasing(T...)
     enum hasRawAliasing = Impl!(RepresentationTypeTuple!T);
 }
 
-///
+//
 @safe unittest
 {
     // simple types
@@ -2727,7 +2729,7 @@ private template hasRawUnsharedAliasing(T...)
     enum hasRawUnsharedAliasing = Impl!(RepresentationTypeTuple!T);
 }
 
-///
+//
 @safe unittest
 {
     // simple types
@@ -3948,6 +3950,8 @@ template BaseTypeTuple(A)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
+
     interface I1 { }
     interface I2 { }
     interface I12 : I1, I2 { }
@@ -4001,6 +4005,8 @@ template BaseClassesTuple(T)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
+
     class C1 { }
     class C2 : C1 { }
     class C3 : C2 { }
@@ -4361,6 +4367,8 @@ template TemplateArgsOf(T : Base!Args, alias Base, Args...)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
+
     struct Foo(T, U) {}
     static assert(is(TemplateArgsOf!(Foo!(int, real)) == AliasSeq!(int, real)));
 }
@@ -7207,6 +7215,8 @@ template mostNegative(T)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
+
     foreach (T; AliasSeq!(bool, byte, short, int, long))
         static assert(mostNegative!T == T.min);
 
@@ -7273,6 +7283,7 @@ template mangledName(sth...)
 ///
 @safe unittest
 {
+    import std.meta : AliasSeq;
     alias TL = staticMap!(mangledName, int, const int, immutable int);
     static assert(TL == AliasSeq!("i", "xi", "yi"));
 }
@@ -7727,7 +7738,7 @@ template getSymbolsByUDA(alias symbol, alias attribute)
     enum Attr;
     struct A
     {
-        alias int INT;
+        alias INT = int;
         alias void function(INT) SomeFunction;
         @Attr int a;
         int b;
> pmake std/traits.publictests
generated/linux/release/64/publictests/std_traits.d(1700): Error: static assert  1LU == 2LU is false

Fixed

  • std.digest.hmac

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

std/uuid.d Outdated

private this(string input, size_t pos, Reason why = Reason.unknown, string msg = "",
///
this(string input, size_t pos, Reason why = Reason.unknown, string msg = "",
Copy link
Member

@CyberShadow CyberShadow Jul 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like user code is intended to throw this exception. I think that instead of making the constructor public, the unittest/example needs to be converted to a private unittest, and a new unittest/example take its place, i.e. one which invokes a public std.uuid method with some invalid data that causes an instance of this exception type to be thrown (with the example catching it).

@CyberShadow
Copy link
Member

As no one seems to push this,

Is there a list of actionable cleanup tasks someone can pick up? Now I know there's this and the dscanner exclusions, anything else?

@wilzbach
Copy link
Contributor Author

wilzbach commented Jul 9, 2017

It doesn't look like user code is intended to throw this exception. I think that instead of making the constructor public, the unittest/example needs to be converted to a private unittest, and a new unittest/example take its place

Fair enough. Fixed.

Is there a list of actionable cleanup tasks someone can pick up? Now I know there's this and the dscanner exclusions, anything else?

From Walter's last call to action:

(Filtered for the Phobos bits.)

Trivial ones

  • Make sure every function in Phobos has an example -> has_public_example DScanner check
  • make sure every function in Phobos has Params: and Returns: sections -> properly_documented_public_functions DScanner check
  • Improve code coverage
    • CodeCov provides an excellent overview
    • e.g. make -f std/ascii.test yields a std-ascii.lst with the coverage information

More tricky ones:

Hard ones:

My personal Phobos "maintenance" list

  • Add/improve DScanner checks -> more automation
  • Make more examples runnable
  • Reduce the amount of Ddoc examples in favor of testable, runnable examples
  • Reduce DScanner blacklist
  • Browse the documentation for visual glitches or add improvements (e.g. BOOKTABLE overviews)
  • Try to deprecate old & ugly bits in favor of new stuff like std.data.json
    ...

@CyberShadow
Copy link
Member

LGTM except for the outdated commit message:

Make std.uuid examples runnable by exposing UUIDParsingException.this

@CyberShadow
Copy link
Member

CyberShadow commented Jul 9, 2017

(Filtered for the Phobos bits.)

Great, this should be on the wiki somewhere.

BTW, the dlang.org front page's "Contribute" section should link to a wiki page which lists entry-level tasks such as these.

@wilzbach
Copy link
Contributor Author

wilzbach commented Jul 9, 2017

LGTM except for the outdated commit message:

Forgot about this. Sorry. Fixed.

@wilzbach
Copy link
Contributor Author

wilzbach commented Jul 9, 2017

Great, this should be on the wiki somewhere.

It already is, but just hard to find

https://wiki.dlang.org/Wish_list#Walter_and_Andrei.27s_Action_List

BTW, the dlang.org front page's "Contribute" section should link to a wiki page which lists entry-level tasks such as these.

Good idea - we should also rework these pages:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants