Coder Social home page Coder Social logo

test-sourcefiles's Introduction

NAME

Test::SourceFiles - A basic compilation checker

SYNOPSIS

use Test;
use Test::SourceFiles;

use-libs-ok;

done-testing

DESCRIPTION

Test::SourceFiles is a simple way to check the compilation of all files in your projects lib/ directory. I found myself rewriting this a couple of times so time to make a module.

The simple way is to call the use-libs-ok function which calls Test::use-ok on each module name returned from the collecting function, collect-sources. Alternately you can call collect-sources and do something fancy with it's Seq of Pair's where the key is a :: formatted name and the value is the IO::Path where it was found. For example:

say collect-sources.perl
# prints ("Test::SourceFiles" => IO::Path.new("lib/Test/SourceFiles.pm6", ...),).Seq

Both functions have the following options and defaults:

  • Str :$root-path = 'lib' - Where to search for source files

  • List :$extensions = list 'pm6' - Which file extensions to include

  • Bool :$verbose = False - Provide more detailed feedback on the search process

Use Case

I find this module particularly useful when I'm starting a project, a time where I'm creating a lot of files while stubbing functions and roles. This module weeds out syntax errors from this sketching stage, allowing for a smoother transition into the implementation stage of the development process. As a module matures and it's test suite fills in this module begins to become less useful and so can likely removed later in a module's life.

AUTHOR

Sam Gillespie

COPYRIGHT AND LICENSE

Copyright 2018

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

test-sourcefiles's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.