Skip to content

Commit

Permalink
forgot to add these
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Feb 9, 2014
1 parent 42d81e3 commit 471cb2a
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.build
TestML-*
22 changes: 22 additions & 0 deletions .travis.yml
@@ -0,0 +1,22 @@
language: perl
perl:
- 5.18
- 5.16
- 5.14
- 5.12
- 5.10
- 5.8

install:
- cpanm --quiet --notest
Pegex
Devel::Cover::Report::Coveralls

script:
- PERL5OPT=-MDevel::Cover=-coverage,statement,branch,condition,path,subroutine
PERL5LIB=../testml-pm/lib
prove -lv t/
- cover

after_success:
- cover -report coveralls
80 changes: 80 additions & 0 deletions ReadMe.md
@@ -0,0 +1,80 @@
# NAME

TestML - A Generic Software Testing Meta Language

# SYNOPSIS

# file t/testml/encode.tml
%TestML 0.1.0

Title = 'Tests for AcmeEncode'
Plan = 3

*text.apply_rot13 == *rot13
*text.apply_md5 == *md5

=== Encode some poetry
--- text
There once was a fellow named Ingy,
Combining languages twas his Thingy.
--- rot13
Gurer bapr jnf n sryybj anzrq Vatl,
Pbzovavat ynathntrf gjnf uvf Guvatl.
--- md5: 7a1538ff9fc8edf8ea55d02d0b0658be

=== Encode a password
--- text: soopersekrit
--- md5: 64002c26dcc62c1d6d0f1cb908de1435

This TestML document defines 2 assertions, and defines 2 data blocks. The
first block has 3 data points, but the second one has only 2. Therefore the
rot13 assertion applies only to the first block, while the the md5 assertion
applies to both. This results in a total of 3 tests, which is specified in the
meta Plan statement in the document.

To run this test you would have a normal test file that looks like this:

use TestML;
use t::Bridge;

TestML->new(
testml => 'testml/encode.tml',
bridge => 't::Bridge',
)->run;

The apply\_\* functions are defined in the bridge class that is specified outside
this test (t/Bridge.pm).

# DESCRIPTION

TestML is a generic, programming language agnostic, meta language for writing
unit tests. The idea is that you can use the same test files in multiple
implementations of a given programming idea. Then you can be more certain that
your application written in, say, Python matches your Perl implementation.

In a nutshell you write a bunch of data tests that have inputs and expected
results. Using a simple syntax, you specify what functions the data must pass
through to produce the expected results. You use a bridge class to write the
data functions that pass the data through your application.

In Perl 5, TestML is the evolution of the [Test::Base](http://search.cpan.org/perldoc?Test::Base) module. It has a
superset of Test:Base's goals. The data markup syntax is currently exactly the
same as Test::Base.

# SEE ALSO

- [http://www.testml.org/](http://www.testml.org/)
- [irc://irc.freenode.net\#testml](irc://irc.freenode.net\#testml)

# AUTHOR

Ingy döt Net <ingy@cpan.org>

# COPYRIGHT AND LICENSE

Copyright (c) 2009-2013. Ingy döt Net.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html
30 changes: 30 additions & 0 deletions dist.ini
@@ -0,0 +1,30 @@
name = TestML
author = Ingy döt Net <ingy@cpan.org>
license = Perl_5
copyright_holder = Ingy döt Net
version = 0.0.9

[@Basic]
[OurPkgVersion]
[ReadmeFromPod]
filename = lib/TestML.pod

[@Git]
[GithubMeta]
user = ingydotnet
issues = 1

[Prereqs]
perl = v5.8.1
Pegex = 0.24

; XXX need to generate TestML shims:
; perl -Ilib -MTestML::Setup -e 'TestML::Setup->new->setup(shift)' t/testml.yaml
; perl -Ilib -MTestML::Setup -e 'TestML::Setup->new->setup(shift)' t/testml-lite.yaml

[PodSyntaxTests]

[PruneFiles]
filename = ReadMe.md
filename = dist.ini
filename = note

0 comments on commit 471cb2a

Please sign in to comment.