Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

Enable C++17 tests#2707

Merged
thewilsonator merged 2 commits intodlang:masterfrom
TurkeyMan:cpp17_tests
Jul 31, 2019
Merged

Enable C++17 tests#2707
thewilsonator merged 2 commits intodlang:masterfrom
TurkeyMan:cpp17_tests

Conversation

@TurkeyMan
Copy link
Contributor

@TurkeyMan TurkeyMan commented Jul 30, 2019

Enable C++17 unit tests (including string_view which hasn't had unit tests run before) for windows where the compiler supports it.
Fixed a bug in new when C++17 is enabled.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @TurkeyMan! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

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.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2707"

@TurkeyMan
Copy link
Contributor Author

I shunted the if's out of the makefile... what a hack!

@thewilsonator
Copy link
Contributor

Lol, nice!

TESTS=array allocator new string

TESTS= array allocator new string
_MSC_VER=$(file < ..\..\ver.txt)
Copy link
Member

Choose a reason for hiding this comment

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

I would be very surprised if this works with Digital Mars make.
AFAICT including a file only works with a line like this (from druntime/win64.mak):

$(mak\COPY)

This reads a single assignment from the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you expect doesn't work?
This does work... the tests all pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Look for -version=_MSC_VER_xxxx in the CI logs. That value is read from this line at your comment.

Copy link
Member

Choose a reason for hiding this comment

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

Surprising. $(file < MAK\COPY) is empty for me. _MSC_VER=$(..\..\ver.txt) would work.

I suspect the auto-tester is not using Digital Mars make here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran the same script locally... It works, and the tests invoke with all proper args... How are you running it?
auto-tester and appveyor both seem to work... My local machine too. I'm surprised...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like, check the CI logs. The msc ver and the cflags and dflags are supplied correctly. It also did build string_view, which is pulled the same way...

Copy link
Member

Choose a reason for hiding this comment

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

Your PR passes for me locally, too. I'm confused ;-)

@TurkeyMan
Copy link
Contributor Author

Why did that fail?!

$(TESTS):
"$(CC)" -c /Fo$@_cpp.obj test\stdcpp\src\$@.cpp /EHsc /MT
"$(DMD)" -of=$@.exe -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIMELIB) -main -unittest -version=_MSC_VER_$(_MSC_VER) -mscrtlib=libcmt test\stdcpp\src\$@_test.d $@_cpp.obj
"$(CC)" -c /Fo$@_cpp.obj test\stdcpp\src\$@.cpp /EHsc /MT $(ADD_CFLAGS)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this also works directly if there is a file with the name ADD_CFLAGS that has the settings, see https://github.com/DigitalMars/Compiler/blob/1dbd3e3381c8f7f7ab2e35214dcd63455ae38c29/dm/src/make/dmake.d#L1130.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't see any documentation to that effect in the scant docs.
That would be highly unusual though I think... I kinda like that way I've written it makes it terribly clear what mischief is at play.

@rainers
Copy link
Member

rainers commented Jul 30, 2019

Why did that fail?!

Looks like one of the spurious failures (systime timed out).

@TurkeyMan
Copy link
Contributor Author

What's going on with buildkite?

@wilzbach
Copy link
Contributor

see e.g. dlang/dmd#10244 (review)

@TurkeyMan
Copy link
Contributor Author

Okay, so this PR is good then?

@TurkeyMan
Copy link
Contributor Author

Wait.. it just switched from green to red... what's happening here? O_o

@thewilsonator
Copy link
Contributor

the concurrency tests have always been flaky

@TurkeyMan
Copy link
Contributor Author

So... am I supposed to do something now?

@thewilsonator
Copy link
Contributor

Ive restarted the tests, they might take a bit to come online.

@thewilsonator thewilsonator merged commit 1b8b215 into dlang:master Jul 31, 2019
@TurkeyMan TurkeyMan deleted the cpp17_tests branch July 31, 2019 05:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants