Skip to content

Commit

Permalink
CI test for update as Raku community module
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Dec 2, 2024
1 parent cbc5ed9 commit b80d509
Show file tree
Hide file tree
Showing 35 changed files with 371 additions and 157 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linux

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- ubuntu-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
26 changes: 26 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: MacOS

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- macos-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
11 changes: 0 additions & 11 deletions .github/workflows/test.yaml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Windows

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- windows-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Revision history for Test::Stream

{{$NEXT}}
- Initial version as a Raku Community Module
45 changes: 27 additions & 18 deletions META6.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
{
"name": "Test::Stream",
"auth": "zef:raku-community-modules",
"author": "Dave Rolsky",
"build-depends": [
],
"depends": [
],
"description": "Stream test events",
"version": "0.0.3",
"license": "Artistic-2.0",
"name": "Test::Predicates",
"perl": "6.*",
"auth": "zef:raku-community-modules",
"depends": [],
"provides": {
"Test::Predicates": "lib/Test/Predicates.pm6",
"Test::Predicator": "lib/Test/Predicator.pm6",
"Test::Stream::Diagnostic": "lib/Test/Stream/Diagnostic.pm6",
"Test::Stream::Event": "lib/Test/Stream/Event.pm6",
"Test::Stream::EventSource": "lib/Test/Stream/EventSource.pm6",
"Test::Stream::Formatter::TAP12": "lib/Test/Stream/Formatter/TAP12.pm6",
"Test::Stream::Hub": "lib/Test/Stream/Hub.pm6",
"Test::Stream::Listener": "lib/Test/Stream/Listener.pm6",
"Test::Stream::Recorder": "lib/Test/Stream/Recorder.pm6",
"Test::Stream::Suite": "lib/Test/Stream/Suite.pm6",
"Test::Stream::Types": "lib/Test/Stream/Types.pm6",
"Test::Stream::Util": "lib/Test/Stream/Util.pm6"
"Test::Predicates": "lib/Test/Predicates.rakumod",
"Test::Predicator": "lib/Test/Predicator.rakumod",
"Test::Stream::Diagnostic": "lib/Test/Stream/Diagnostic.rakumod",
"Test::Stream::Event": "lib/Test/Stream/Event.rakumod",
"Test::Stream::EventSource": "lib/Test/Stream/EventSource.rakumod",
"Test::Stream::Formatter::TAP12": "lib/Test/Stream/Formatter/TAP12.rakumod",
"Test::Stream::Hub": "lib/Test/Stream/Hub.rakumod",
"Test::Stream::Listener": "lib/Test/Stream/Listener.rakumod",
"Test::Stream::Recorder": "lib/Test/Stream/Recorder.rakumod",
"Test::Stream::Suite": "lib/Test/Stream/Suite.rakumod",
"Test::Stream::Types": "lib/Test/Stream/Types.rakumod",
"Test::Stream::Util": "lib/Test/Stream/Util.rakumod"
},
"license": "Artistic-2.0",
"resources": [
],
"source-url": "https://github.com/raku-community-modules/Test-Stream.git",
"author": "Dave Rolsky <autarch@urth.org>"
"tags": [
],
"test-depends": [
],
"version": "0.0.3"
}
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
# Test::Stream [![Tests on source](https://github.com/raku-community-modules/Test-Stream/actions/workflows/test.yaml/badge.svg)](https://github.com/raku-community-modules/Test-Stream/actions/workflows/test.yaml)
[![Actions Status](https://github.com/raku-community-modules/Test-Stream/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/Test-Stream/actions) [![Actions Status](https://github.com/raku-community-modules/Test-Stream/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/Test-Stream/actions) [![Actions Status](https://github.com/raku-community-modules/Test-Stream/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/Test-Stream/actions)

This is a prototype of an event-based test framework. The goal is to produce
an underlying set of modules that can be shared by all Test modules in the
Raku ecosystem. Building this on top of an abstract test event system makes
integrating different modules much easier. It also makes testing your test
modules *much* easier, and allows for output formats besides TAP.
NAME
====

Please note that the namespaces are likely to change in the future, so please
do not rely on this code yet.
Test::Stream - Stream test events

# LICENSE
SYNOPSIS
========

```raku
use Test::Stream;
```

DESCRIPTION
===========

This is a prototype of an event-based test framework. The goal is to produce an underlying set of modules that can be shared by all Test modules in the Raku ecosystem. Building this on top of an abstract test event system makes integrating different modules much easier. It also makes testing your test modules *much* easier, and allows for output formats besides TAP.

AUTHOR
======

Dave Rolsky

COPYRIGHT AND LICENSE
=====================

Copyright 2016 Dave Rolsky

Copyright 2020 - 2024 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

This module is licensed under the [Artistic License](LICENSE)
11 changes: 11 additions & 0 deletions dist.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name = Test::Stream

[ReadmeFromPod]
filename = doc/Test-Stream.rakudoc

[UploadToZef]

[Badges]
provider = github-actions/linux.yml
provider = github-actions/macos.yml
provider = github-actions/windows.yml
37 changes: 37 additions & 0 deletions doc/Test-Stream.rakudoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
=begin pod

=head1 NAME

Test::Stream - Stream test events

=head1 SYNOPSIS

=begin code :lang<raku>

use Test::Stream;

=end code

=head1 DESCRIPTION

This is a prototype of an event-based test framework. The goal is to produce
an underlying set of modules that can be shared by all Test modules in the
Raku ecosystem. Building this on top of an abstract test event system makes
integrating different modules much easier. It also makes testing your test
modules *much* easier, and allows for output formats besides TAP.

=head1 AUTHOR

Dave Rolsky

=head1 COPYRIGHT AND LICENSE

Copyright 2016 Dave Rolsky

Copyright 2020 - 2024 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

=end pod

# vim: expandtab shiftwidth=4
40 changes: 20 additions & 20 deletions lib/Test/Predicates.pm6 → lib/Test/Predicates.rakumod
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use v6;

unit module Test::Predicates;

use Test::Stream::Formatter::TAP12;
Expand All @@ -15,105 +13,105 @@ sub plan (|c) is export {
sub pass (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().pass(|c);
instance().pass(|c);
}

sub flunk (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().flunk(|c);
instance().flunk(|c);
}

sub ok (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().ok(|c);
instance().ok(|c);
}

sub is (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().is(|c);
instance().is(|c);
}

sub isnt (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().isnt(|c);
instance().isnt(|c);
}

sub cmp-ok (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().cmp-ok(|c);
instance().cmp-ok(|c);
}

sub isa-ok (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().isa-ok(|c);
instance().isa-ok(|c);
}

sub does-ok (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().does-ok(|c);
instance().does-ok(|c);
}

sub can-ok (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().can-ok(|c);
instance().can-ok(|c);
}

sub like (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().like(|c);
instance().like(|c);
}

sub unlike (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().unlike(|c);
instance().unlike(|c);
}

sub is-deeply (|c --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().is-deeply(|c);
instance().is-deeply(|c);
}

sub lives-ok (&block, $name? --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().lives-ok( &block, $name );
instance().lives-ok( &block, $name );
}

sub dies-ok (&block, $name? --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().dies-ok( &block, $name );
instance().dies-ok( &block, $name );
}

multi sub throws-like (&block, Mu:U $type, $name? --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().throws-like( &block, $type, $name );
instance().throws-like( &block, $type, $name );
}

multi sub throws-like (&block, Regex:D $regex, $name? --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().throws-like( &block, $regex, $name );
instance().throws-like( &block, $regex, $name );
}

# We need to repeat the signature from Test::Predicator here so that the
# compiler knows how to parse { } blocks passed to these subs.
sub subtest (Str:D $reason, &block --> Bool:D) is export {
instance().hub.set-context;
LEAVE { instance().hub.release-context }
return instance().subtest( $reason, &block );
instance().subtest( $reason, &block );
}

sub todo (Str:D $reason, &block) is export {
Expand Down Expand Up @@ -174,7 +172,7 @@ sub instance {
unless $hub.has-listeners;
$instance = Test::Predicator.new( hub => $hub );
}
return $instance;
$instance
}

END {
Expand All @@ -189,3 +187,5 @@ END {
our sub clear-instance-violently-for-test-stream-tests {
$instance = (Test::Predicator);
}

# vim: expandtab shiftwidth=4
Loading

0 comments on commit b80d509

Please sign in to comment.