Commit cf0c8b2a authored by Dominique Dumont's avatar Dominique Dumont

New upstream version 2017.10

parent 5018e076
......@@ -20,6 +20,10 @@
N: ab5tract
E: john.haltiwanger@gmail.com
N: Adrian White
U: snarkyboojum
E: snarkyboojum@gmail.com
N: Ahmad M. Zawawi
U: azawawi
E: ahmad.zawawi@gmail.com
......@@ -728,9 +732,6 @@ E: smash@cpan.org
N: smls
E: smls75@gmail.com
N: snarkyboojum
E: snarkyboojum@gmail.com
N: Solomon Foster
U: colomon
E: colomon@gmail.com
......
......@@ -18,8 +18,10 @@ my $lclang = lc $lang;
my $uclang = uc $lang;
my $win = $^O eq 'MSWin32';
my $slash = $win ? '\\' : '/';
# We don't use ExtUtils::Command in Configure.pl, but it is used in the Makefile
# Try `use`ing it here so users know if they need to install this module
# (not included with *every* Perl installation)
use ExtUtils::Command;
MAIN: {
if (-r 'config.default') {
unshift @ARGV, shellwords(slurp('config.default'));
......@@ -37,7 +39,7 @@ MAIN: {
'backends=s', 'no-clean!',
'with-nqp=s', 'gen-nqp:s',
'gen-moar:s', 'moar-option=s@',
'git-protocol=s',
'git-protocol=s', 'ignore-errors',
'make-install!', 'makefile-timing!',
'git-depth=s', 'git-reference=s',
) or do {
......@@ -50,7 +52,9 @@ MAIN: {
print_help();
exit(0);
}
if ($options{'ignore-errors'}) {
print "===WARNING!===\nErrors are being ignored.\nIn the case of any errors the script may behave unexpectedly.\n";
}
unless (defined $options{prefix}) {
my $default = defined($options{sysroot}) ? '/usr' : File::Spec->catdir(getcwd, 'install');
print "ATTENTION: no --prefix supplied, building and installing to $default\n";
......@@ -324,7 +328,7 @@ MAIN: {
"Or, use '--prefix=' to explicitly specify the path where the NQP$want_executables",
"executable$s2 can be found that are use to build $lang.";
}
sorry(@errors) if @errors;
sorry($options{'ignore-errors'}, @errors) if @errors;
my $l = uc substr($default_backend, 0, 1);
print $MAKEFILE qq[\nt/*/*.t t/*.t t/*/*/*.t: all\n\t\$(${l}_HARNESS5_WITH_FUDGE) --verbosity=1 \$\@\n];
......@@ -405,6 +409,7 @@ General Options:
Folders 'nqp' and 'MoarVM' with corresponding git repos should be in for_perl6 folder
--makefile-timing Enable timing of individual makefile commands
--no-clean Skip cleanup before installation
--ignore-errors Ignore errors (such as the version of NQP)
Please note that the --gen-moar and --gen-nqp options are there for convenience
only and will actually immediately - at Configure time - compile and install
......
......@@ -10,7 +10,7 @@
(Perl is installed by default already). To enable parallel testing you
also need the CPAN module Test::Harness in version 3.16 or newer; you
can control the number of parallel jobs with the "TEST_JOBS" environment
variable.
variable. If TEST_JOBS is not specified, 6 jobs will be used.
Building and invoking Rakudo
If you're wanting the bleeding-edge version of the Rakudo Perl 6
......@@ -33,7 +33,7 @@
$ perl Configure.pl --gen-moar --gen-nqp --backends=moar # Moar only
or:
$ perl Configure.pl --gen-nqp --backends=jvm # needs JDK 1.7 installed
$ perl Configure.pl --gen-nqp --backends=jvm # needs JDK 1.8 installed
then:
$ make
......
......@@ -113,6 +113,8 @@ docs/announce/2017.05.md
docs/announce/2017.06.md
docs/announce/2017.07.md
docs/announce/2017.08.md
docs/announce/2017.09.md
docs/announce/2017.10.md
docs/architecture.html
docs/architecture.svg
docs/ChangeLog
......@@ -129,10 +131,12 @@ docs/ops.markdown
docs/release_guide_automated.md
docs/release_guide.pod
docs/ROADMAP
docs/roast-spectest.data-versioning.md
docs/running.pod
docs/S11-Modules-proposal.pod
docs/spectest-progress.csv
docs/val.pod6
docs/windows.md
dynext/IGNORE
gen/jvm/.gitignore
gen/moar/.gitignore
......@@ -230,10 +234,7 @@ src/core/Grammar.pm
src/core/Hash.pm
src/core/hash_slice.pm
src/core/HyperConfiguration.pm
src/core/HyperIterable.pm
src/core/HyperIterator.pm
src/core/HyperSeq.pm
src/core/HyperWorkBuffer.pm
src/core/Instant.pm
src/core/Int.pm
src/core/IO/ArgFiles.pm
......@@ -263,6 +264,7 @@ src/core/JVM/KeyReducer.pm
src/core/Kernel.pm
src/core/Label.pm
src/core/List.pm
src/core/Lock/Async.pm
src/core/Lock.pm
src/core/Macro.pm
src/core/Main.pm
......@@ -297,8 +299,16 @@ src/core/Proc.pm
src/core/Promise.pm
src/core/PseudoStash.pm
src/core/QuantHash.pm
src/core/RaceSeq.pm
src/core/Rakudo/Internals/HyperIteratorBatcher.pm
src/core/Rakudo/Internals/HyperPipeline.pm
src/core/Rakudo/Internals/HyperRaceSharedImpl.pm
src/core/Rakudo/Internals/HyperToIterator.pm
src/core/Rakudo/Internals/HyperWorkBatch.pm
src/core/Rakudo/Internals/HyperWorkStage.pm
src/core/Rakudo/Internals/JSON.pm
src/core/Rakudo/Internals.pm
src/core/Rakudo/Internals/RaceToIterator.pm
src/core/Rakudo/Iterator.pm
src/core/Rakudo/Metaops.pm
src/core/Rakudo/QuantHash.pm
......@@ -314,6 +324,7 @@ src/core/Scalar.pm
src/core/Scheduler.pm
src/core/Semaphore.pm
src/core/Seq.pm
src/core/Sequence.pm
src/core/set_addition.pm
src/core/set_difference.pm
src/core/set_elem.pm
......@@ -469,11 +480,15 @@ t/02-rakudo/05-range-in-range.t
t/02-rakudo/06-is.t
t/02-rakudo/07-io-cathandle.t
t/02-rakudo/08-inline-native-arith.t
t/02-rakudo/08-repeat.t
t/02-rakudo/08-slangs.t
t/02-rakudo/09-thread-id-after-await.t
t/02-rakudo/10-nqp-ops.t
t/02-rakudo/11-deprecated.t
t/02-rakudo/dump.t
t/02-rakudo/repl.t
t/02-rakudo/test-packages/CustomOps.pm6
t/02-rakudo/v6.d-tests/01-deprecations.t
t/03-jvm/01-interop.t
t/03-jvm/Foo.java
t/04-nativecall/01-argless.c
......@@ -518,8 +533,12 @@ t/04-nativecall/20-concurrent.c
t/04-nativecall/20-concurrent.t
t/04-nativecall/21-callback-other-thread.c
t/04-nativecall/21-callback-other-thread.t
t/04-nativecall/22-method.c
t/04-nativecall/22-method.t
t/04-nativecall/CompileTestLib.pm
t/05-messages/01-errors.t
t/05-messages/02-errors.t
t/05-messages/10-warnings.t
t/06-tap-harness/01-desc-backslashes.t
t/06-tap-harness/02-skip-all.t
t/06-tap-harness/test-files/01-desc-backslashes--1.TAP-TEST
......@@ -555,7 +574,7 @@ tools/build/NQP_REVISION
tools/build/upgrade-repository.pl
tools/commit-stats.pl
tools/contributors.pl6
tools/create-release-announcement.pl
tools/create-release-announcement.pl6
tools/CREDITS.pl6
tools/install-dist.pl
tools/lib/NQP/Configure.pm
......@@ -566,6 +585,7 @@ tools/release-dates.pl
tools/update-passing-test-data.pl
tools/update-tai-utc.pl
tools/util/perlcritic.conf
t/packages/Test/Helpers.pm6
t/spec/fudge
t/spec/fudgeall
t/spec/fudgeandrun
......@@ -1703,6 +1723,7 @@ t/spec/S32-io/io-spec-win.t
t/spec/S32-io/move.t
t/spec/S32-io/native-descriptor.t
t/spec/S32-io/note.t
t/spec/S32-io/open.t
t/spec/S32-io/other.t
t/spec/S32-io/pipe.t
t/spec/S32-io/pi.txt
......@@ -1858,8 +1879,10 @@ t/spec/t/06-todo.out_impl-1
t/spec/t/07-register_function.in
t/spec/t/07-register_function.out_impl-1
t/spectest.data
t/spectest.data.6.c
t/spec/test_summary
t/spec/t/fudge.t
t/spec/TODO
t/spec/t/README
t/spec/VERSION
VERSION
......@@ -21,7 +21,7 @@ text file.
## Building and Installing Rakudo
[![Build Status](https://travis-ci.org/rakudo/rakudo.svg?branch=nom)](https://travis-ci.org/rakudo/rakudo) [![Build status](https://ci.appveyor.com/api/projects/status/github/rakudo/rakudo?svg=true)](https://ci.appveyor.com/project/moritz/rakudo/branch/nom)
[![Build Status](https://travis-ci.org/rakudo/rakudo.svg?branch=nom)](https://travis-ci.org/rakudo/rakudo) [![Build status](https://ci.appveyor.com/api/projects/status/github/rakudo/rakudo?svg=true)](https://ci.appveyor.com/project/rakudo/rakudo/branch/nom)
See the INSTALL.txt file for detailed prerequisites and build and
installation instructions.
......@@ -52,7 +52,7 @@ https://github.com/MoarVM/MoarVM manually and install them individually.
### Configuring Rakudo to run on the JVM
Note that to run Rakudo on JVM, JDK 1.7 must be installed. To automatically
Note that to run Rakudo on JVM, JDK 1.8 must be installed. To automatically
download, build, and install a fresh NQP, run:
perl Configure.pl --gen-nqp --backends=jvm
......
......@@ -35,8 +35,7 @@ environment:
# - RAKUDO_OPTIONS: --backends=jvm --gen-nqp=master
# Allow failures from certain build configuration
matrix:
fast_finish: true
#matrix:
# allow_failures:
# - platform: x64
# RAKUDO_OPTIONS: --backends=jvm --gen-nqp
......
This diff is collapsed.
# Announce: Rakudo Perl 6 compiler, Release #115 (2017.09)
On behalf of the Rakudo development team, I’m very happy to announce the
September 2017 release of Rakudo Perl 6 #115. Rakudo is an implementation of
Perl 6 on the Moar Virtual Machine[^1].
This release implements the 6.c version of the Perl 6 specifications.
It includes bugfixes and optimizations on top of
the 2015.12 release of Rakudo.
Upcoming releases in 2017 will include new functionality that is not
part of the 6.c specification, available with a lexically scoped
pragma. Our goal is to ensure that anything that is tested as part of the
6.c specification will continue to work unchanged. There may be incremental
spec releases this year as well.
The tarball for this release is available from <http://rakudo.org/downloads/rakudo/>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] — it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<http://rakudo.org/downloads/star/>.
The changes in this release are outlined below:
New in 2017.09:
+ Fixes:
+ Fixed NativeCall signature check for unsupported native types [4077842c]
+ Fixed .made called on a Match on which .make was never called [5db5b1db]
+ Fixed flattening of a typed hash [6cec6b72]
+ Fixed iterator on pairs with Mu's [a5014fd0]
+ Fixed Supply.batch with non-int elems and elems == 1 [98f9fffe][7d1ece80]
+ Improved error message on nameless postfix `.::` [5969f21e]
+ Fixed ::("GLOBAL") [1f6a782c]
+ Refined merging of one() junctions [79604a88]
+ Fixed error message with leaking variable name in FailGoal [ed4f6cc9]
+ Implemented missing Instant.Instant [51709e01]
+ Fixed thread safety issues with signal introspection [1f411693]
+ Fixed thread safety issues in the `signal` sub [13b6a33c]
+ Fixed thread safety of "foo{$x}bar" [59454b03]
+ Made Bool.enums consistent with Enumeration.enums [e7a58806]
+ Fixed doubled path issue in IO::Notification.watch-path [2362dfd6]
+ Disabled interactive REPL for non-TTY input [b6a60236]
+ Fix ignoremark and casechange operations of graphemes which begin with
Unicode Prepend characters [7f526c1e]
+ Suppress line number in X::Package::Stubbed [edac1d68][7ba9b7cd]
+ Fixed race condition in Channel awaiter [b30ac08a]
+ Fixed NYI compilation of NativeCall sigs with optional params [1818de98]
+ Fixed missing deconts in nqp::eqaddr() tests [880b33e2]
+ Fixed Enumeration:D === Enumeration:D [8d938461]
+ Fixed non-blocking await when holding locks [f26d1e24]
+ Fixed non-blocking await-all to respect Slip [a137c0de]
+ Additions:
+ Added support for Str operations with Junctions [753c9a5e][7cd153f4]
[95a70ca3][0b19baf0][d2f31bb7][e18291e2][8b5d283c]
+ Added support for Unicode 10 [64dd94c2]
+ Added complete Unicode Collation Algorithm implementation [9b42484a]
[5f335065][ec18efa0]
+ .collate/coll/unicmp operators are no longer experimental
(Note: $*COLLATION dynamic variable is still experimental) [5f335065]
+ Added Thread.is-initial-thread method [59a2056a]
+ Added output buffering for non-TTYs [44680029][4b02b8aa]
+ Made temp and let on a Failure throw it [80a3255b]
+ Made sure that open files are properly closed on exit [3c9cfdba]
[97853564][347da8e5][dd8d0d89]
+ Implement pred() and succ() for the Enumeration role [2645a1e9]
[8d442a52][8df53f34][43e41ec6][55aa7f28][f925c648][69dae1f3][2ad51a0f]
+ Added isa method to SubsetHOW [0704cd97]
+ Build system:
+ Made t/harness* use 6 TEST_JOBS by default [8019c15b]
+ Added --ignore-errors option to Configure.pl [0bc1c877][1da075f9]
+ Fixed `make test` without `make install` first [fb0b3eb5]
+ Made Configure.pl refuse to work without ExtUtils::Command [3f4a9ffa]
+ Fixed non-installed gdb/valgrind runners [4e3f0fca]
+ Efficiency:
+ Knuth-Morris-Pratt string search has been implemented for string
indexing operations (needles between 2 and 8192 in length) [593fa5f8]
+ 1.5-2x speedup of most string operations involving strands [5ebbc5ba]
+ 2.5x speedup for eq() for comparing two flat strings (1.7-2x for others)
+ 9x speedup when indexing with a needle one grapheme in length [8a215876]
+ Made `Any ~ Str` and `Str ~ Any` about 25% faster [815faa35]
+ Made index and eqat operations 2x faster [5ebbc5ba]
+ Made all(@a), none(@a), one(@a) about 9x faster [51c3d86c]
+ Various improvements to BUILDPLAN and BUILDALLPLAN [7da0c215][0ca5ffa4]
[760530a5][80e069a4][2574f883][b706b843][963b28d1][532f7092]
+ Made object creation 25% faster in some cases [62fd5093]
+ Internal:
+ Simplified setting up auto-threading [8a0f6ac1]
+ Streamlined Junction .defined, .Bool, .ACCEPTS [e8137b45]
+ Added --no-merge option to t/harness5 to pass through STDERR [4af1d95c]
[84b40cf5]
+ Various improvements to INTERPOLATE [215a5fa7][ea57cbec][c6aacafd]
[47439e69][4c25df74][fc632cd8]
+ Some minor cleanup on R:I.FirstNThenSinkAll [9dbc3c50]
+ Fixed --ll-exception to give full thread backtrace [0877278e]
+ Various heap analyzer API changes [bfee5a1e]
+ Streamlined exit / END phaser handling [1adacc72]
+ Made junction optimizer only look at candidates [4de858a5]
+ Assortment of low-level improvements [cbce6721][8a215876]
[9b42484a][a4ce97ca]
The following people contributed to this release:
Elizabeth Mattijsen, Aleks-Daniel Jakimenko-Aleksejev, Pawel Murias,
Will "Coke" Coleda, Samantha McVey, Jonathan Worthington, Moritz Lenz,
Steve Mynott, Wenzel P. P. Peppmeyer, Nick Logan, Daniel Green, Zak B. Elep,
Stefan Seifert, Philippe Bruhat (BooK), Timo Paulssen, Altai-man,
Christian Bartolomäus, Cuong Manh Le, Brian S. Julin, Claudio Ramirez,
Juan Julián Merelo Guervós, Christopher Bottoms, rafaelschipiura,
Lance Wicks, Jeremy Studer, Adrian White, David Warring, Leon Timmermans,
andreoss, Andrew Ruder, Douglas L. Schrag, Peter Stuifzand, John Harrison,
Salve J. Nilsen, Zoffix Znet
If you would like to contribute or find out more information, visit
<http://perl6.org>, <http://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
Additionally, we invite you to make a donation to The Perl Foundation
to sponsor Perl 6 development: <https://donate.perlfoundation.org/>
(put “Perl 6 Core Development Fund” in the ‘Purpose’ text field)
The next release of Rakudo (#116), is tentatively scheduled for 2017-10-21.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback – get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, Perl 6 introductory
documentation, and other software that can be used with the Rakudo
compiler to enhance its utility.
This diff is collapsed.
......@@ -22,9 +22,7 @@ Note that we are trying very hard to ensure there are no backward
compatibility issues post Christmas. As such, we may end up delaying
some releases to ensure any compatibility issues are resolved.
2017-09-16 Rakudo #115 (AlexDaniel)
2017-10-21 Rakudo #116
2017-11-18 Rakudo #117
2017-11-18 Rakudo #117 (AlexDaniel + Releasable)
2017-12-16 Rakudo #118
2018-01-20 Rakudo #119
2018-02-17 Rakudo #120
......@@ -74,6 +72,11 @@ the release announcement).
=item *
B<Bump often>, especially the day before the release. Otherwise issues
with MoarVM/NQP might go unnoticed for too long.
=item *
Create a draft release announcement in docs/announce/YYYY.MM.md in
markdown format. You can often use the previous release’s file as a
starting point, updating the release number, version information, name,
......@@ -82,13 +85,13 @@ etc. as appropriate.
git add docs/announce/YYYY.MM.md
git commit docs
There is a helper script C<tools/create-release-announcement.pl> that
There is a helper script C<tools/create-release-announcement.pl6> that
will create a basic release announcement for you based on the state
of the repository and the current date. Feel free to use it to
save yourself some time, but please look over its output if you decide
to use it:
./perl6 tools/create-release-announcement.pl > docs/announce/YYYY.MM.md
./perl6 tools/create-release-announcement.pl6 > docs/announce/YYYY.MM.md
=item *
......@@ -446,6 +449,8 @@ Previous releases were bundled as part of monthly Parrot releases.
2017-06-17 Rakudo #112 "2017.06" (Zoffix + NeuralAnomaly)
2017-07-15 Rakudo #113 "2017.07" (Zoffix + NeuralAnomaly)
2017-08-21 Rakudo #114 "2017.08" (AlexDaniel + Releasable)
2017-09-18 Rakudo #115 "2017.09" (AlexDaniel + Releasable)
2017-10-26 Rakudo #116 "2017.10" (AlexDaniel + Releasable)
=head1 COPYRIGHT
......
The files `t/spectest.data*` specify the list of files to use to test a
specific roast version. The version to test is obtained from the VERSION
file in roast checkout (`t/spec/VERSION`).
The default file is `t/spectest.data` and it's used if roast version could not
be obtained, if the `spectest.data` file for the requested version doesn't
exist or isn't readable, or if the version matches string `propo` (e.g. `6.d.proposal`).
Otherwise, the version is used as a suffix, separated with a dot:
VERSION file contains "6.c" => tests read from t/spectest.data.6.c
The master roast branch would typically contain a proposal version (`6.d.proposal`).
Once that language version is released and a new branch with it is published, the
VERSION file will be changed (`6.d`) and a new spectest.data file will be created
(`t/spectest.data.6.d`).
# Building on windows
## VM
Let's assume we're starting out with no hardware:
Get virtual box for your platform here:
https://www.virtualbox.org/wiki/Downloads
Get a windows 10 evaluation copy from here:
https://developer.microsoft.com/en-us/windows/downloads/virtual-machines
## Prereqs
The evaluation copy comes with a copy of Visual Studio.
### Strawberry Perl
Install Strawberry Perl from:
https://strawberryperl.com/
### Visual Studio
Run the VS installer; modify the existing install, and select "Desktop
Development with C++"; This will make the command line tools available
in the "Developer Command Prompt for VS 2017"
### Git
Install git from:
https://git-scm.com/download/win
## Rakudo
Clone rakudo; in the VS command prompt:
C:\Users\user git clone https://github.com/rakudo/rakudo.git
Configure rakudo:
C:\Users\user cd rakudo
C:\Users\user perl Configure.pl --backends=moar --gen-moar --moar-option="--cc=cl" --moar-option="--ld=link" --moar-option="--make=nmake"
This will git clone nqp & MoarVM, then build MoarVM, nqp.
To build rakudo itself (and install it into a local ./install directory):
You might want to "copy config.status config.bat" to save this config, so
you can later run "config" to perform the config step.
You may wish to use "--gen-moar=master" or "--gen-nqp=master" to get the
latest version of those repositories.
Build rakudo (for Strawberry/gcc) :
C:\Users\user gmake install
Build rakudo (for ActiveState/VS) :
C:\Users\user nmake install
## Test
Now you can run (using the appropriate make command) the
builtin rakudo tests:
C:\Users\user nmake test
Or the spectest suite (note that this will use git to download the
test suite)
C:\Users\user nmake spectest
This diff is collapsed.
......@@ -56,6 +56,25 @@ our class Pointer is repr('CPointer') {
my role TypedPointer[::TValue] {
method of() { TValue }
method deref(::?CLASS:D \ptr:) { self ?? nativecast(TValue, ptr) !! fail("Can't dereference a Null Pointer"); }
method add(Int $off) returns Pointer {
die "Can't do arithmetic with a void pointer"
if TValue.isa(void);
nqp::box_i(self.Int + nqp::nativecallsizeof(TValue) * $off, self.WHAT);
}
method succ {
self.add(1);
}
method pred {
self.add(-1);
}
method AT-POS(Int $pos) {
nqp::nativecallcast(
TValue,
nqp::istype(TValue, Int) ?? Int
!! nqp::istype(TValue, Num) ?? Num !! TValue,
nqp::box_i(nqp::unbox_i(nqp::decont(self)) + nqp::nativecallsizeof(TValue) * $pos, Pointer)
)
}
}
method ^parameterize(Mu:U \p, Mu:U \t) {
die "A typed pointer can only hold:\n" ~
......
......@@ -39,6 +39,8 @@ my int $done_testing_has_been_run = 0;
_init_vars();
sub _init_io {
nqp::setbuffersizefh(nqp::getstdout(), 0);
nqp::setbuffersizefh(nqp::getstderr(), 0);
$output = $PROCESS::OUT;
$failure_output = $PROCESS::ERR;
$todo_output = $PROCESS::OUT;
......@@ -84,6 +86,9 @@ multi sub plan (Cool:D :skip-all($reason)!) {
# It is also the default if nobody calls plan at all
multi sub plan($number_of_tests) is export {
_init_io() unless $output;
my str $str-message;
if $number_of_tests ~~ ::Whatever {
$no_plan = 1;
}
......@@ -91,7 +96,7 @@ multi sub plan($number_of_tests) is export {
$num_of_tests_planned = $number_of_tests;
$no_plan = 0;
$output.say: $indents ~ '1..' ~ $number_of_tests;
$str-message ~= $indents ~ '1..' ~ $number_of_tests;
}
# Get two successive timestamps to say how long it takes to read the
# clock, and to let the first test timing work just like the rest.
......@@ -100,10 +105,11 @@ multi sub plan($number_of_tests) is export {
# lot slower than the non portable nqp::time_n.
$time_before = nqp::time_n;
$time_after = nqp::time_n;
$output.say: $indents
~ '# between two timestamps '
~ ceiling(($time_after-$time_before)*1_000_000) ~ ' microseconds'
$str-message ~= "\n$indents# between two timestamps " ~ ceiling(($time_after-$time_before)*1_000_000) ~ ' microseconds'
if nqp::iseq_i($perl6_test_times,1);
$output.say: $str-message;
# Take one more reading to serve as the begin time of the first test
$time_before = nqp::time_n;
}
......@@ -170,8 +176,8 @@ multi sub is(Mu $got, Mu:D $expected, $desc = '') is export {
eq $expected.Str.subst(/\s/, '', :g)
{
# only white space differs, so better show it to the user
_diag "expected: {$expected.perl}\n"
~ " got: {$got.perl}";
_diag "expected: $expected.perl()\n"
~ " got: $got.perl()";
}
else {
_diag "expected: '$expected'\n"
......@@ -224,7 +230,7 @@ multi sub isnt(Mu $got, Mu:D $expected, $desc = '') is export {
$ok or ($die_on_fail and die-on-fail) or $ok;
}
multi sub cmp-ok(Mu $got, $op, Mu $expected, $desc = '') is export {
multi sub cmp-ok(Mu $got is raw, $op, Mu $expected is raw, $desc = '') is export {
$time_after = nqp::time_n;
$got.defined; # Hack to deal with Failures
my $ok;
......@@ -242,9 +248,11 @@ multi sub cmp-ok(Mu $got, $op, Mu $expected, $desc = '') is export {
if $matcher {
$ok = proclaim($matcher($got,$expected), $desc);
if !$ok {
_diag "expected: '{$expected // $expected.^name}'\n"
~ " matcher: '{$matcher.?name || $matcher.^name}'\n"
~ " got: '$got'";
my $expected-desc = (try $expected.perl) // $expected.gist;
my $got-desc = (try $got .perl) // $got .gist;
_diag "expected: $expected-desc\n"
~ " matcher: '" ~ ($matcher.?name || $matcher.^name) ~ "'\n"
~ " got: $got-desc";
}
}
else {
......@@ -429,7 +437,6 @@ sub _diag(Mu $message, :$force-stderr) {
my $str-message = nqp::join(
"\n$indents# ", nqp::split("\n", "$indents# $message")
);
$str-message .= subst(rx/^^ "$indents#" \s+ $$/, '', :g);
$out.say: $str-message;
$time_before = nqp::time_n;
}
......@@ -619,7 +626,7 @@ sub throws-like($code, $ex_type, $reason?, *%matcher) is export {
default {
pass $msg;
my $type_ok = $_ ~~ $ex_type;
ok $type_ok , "right exception type ({$ex_type.^name})";
ok $type_ok , "right exception type ($ex_type.^name())";
if $type_ok {
for %matcher.kv -> $k, $v {
my $got is default(Nil) = $_."$k"();
......@@ -631,14 +638,14 @@ sub throws-like($code, $ex_type, $reason?, *%matcher) is export {
}
}
} else {
_diag "Expected: {$ex_type.^name}\n"
~ "Got: {$_.^name}\n"
_diag "Expected: $ex_type.^name()\n"
~ "Got: $_.^name()\n"
~ "Exception message: $_.message()";
skip 'wrong exception type', %matcher.elems;
}