David Westbrook (davidrw) Combining Devel::Cover and Template-Toolkit for coverage stats on templates. Evaluate direct unit tests.

Slides:



Advertisements
Similar presentations
(c) Creative Commons Attribution-ShareAlike License- Jason Purdy CGI::Application Raleigh.PM :: February 21 st, 2005 Jason Purdy
Advertisements

Document Title Document Subtitle. Page 2 Divider 1 if Needed Subtitle if any.
Final and Abstract Classes
eClassifier: Tool for Taxonomies
Aero Snap/Aero Peek/Aero Shake And Windows Flip 3D
House Styles Chapter 3. Contents This presentation covers the following: – Why organisations need a consistent house style. – Master documents, style.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Main Title Here Additional copy here, additional copy here, additional copy here, additional copy here, additional copy here. ADD YOUR WEB ADDRESS HERE.
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
18 Copyright © Oracle Corporation, All rights reserved. Transporting Data Between Databases.
Evaluation of a Scalable P2P Lookup Protocol for Internet Applications
A Blackboard Building Block™ Crash Course for Web Developers
Title Would Go Here Subtitle added here Header for these bullets First bullet point Second Bullet Third Bullet Fourth Bullet Fifth bullet Sixth point.
Software Engineering 1 Provisional Revision Plan.
Common Page Design. Graphics and Tables Uses: Objects Numbers Concepts Words.
 Keyboards, LCDs most widely used input/output devices of the 8051  Contents to be covered:  keyboard fundamentals  key press and key detection mechanisms.
Java Programming, 3e Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
How To Apply Quality Management
Import Data From Excel File into Database. Contents 1.Understanding Excel structure 2.Understanding jxl.jar library 3.Problem: Import student information.
LOGO pptcn PowerTemplate Add your company slogan.
BTEC Unit 06 – Lesson 08 Principals of Software Design Mr C Johnston ICT Teacher
Factory Method A Creational Design Pattern. Factory Method Key Features  Defines an interface for creating objects without needing to know each object’s.
CS 614: Theory and Construction of Compilers Lecture 18 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Insert Nonprofit Logo Project Name Discovery Presentation.
L o g o PowerPoint Template. Company Logo Contents 1. Click to add Title 2. Click to add Title 3. Click to add Title 4. Click to add Title 5. Click to.
CONTENTS Add your title welcome to use these powerpoint templates, New Content design, 10 years experience Add your title welcome to use.
Project Overview May Stage 1 – July 2014 Project Scoping Stakeholder review & feedback DSR HRIAG Selection of SSA’s Industry needs.
Import Data From Excel File into Database. Contents 1.Understanding Excel structure 2.Understanding jxl.jar library 3.Problem: Import student information.
This is contents are a. Enter your text he re. This is Your-title This is your contents area. Enter your text.
Test Title Test Content.
Project Management Testing & Acceptance
Presentation Title.
Presentation Title.
How To Apply Quality Management
Creating a Web Page.
Get Help-Gmail help number
Presentation Title Here
Click to edit subtitle style
Example 13 Wendy Balmer Indiana U
NDA Coaching in Chandigarh
Blackboard PowerPoint Template
Template for Microsoft PowerPoint
Template for Microsoft PowerPoint
Click to edit subtitle style
PRESENTATION TITLE – 32 pts
This is the presentation title
Template staged diagramm / Staged plan
Energy Bar Association 2017 Forum Subtitle
This is the presentation title
Title of the Presentation
Group 1 Group 1 Group 1 Group 1 word word word word word word word word word word word word word word word word word word word word word word word.
СИСТЕМТ ТЭГШИТГЭЛ.
PowerPoint Template.
Title to go here Subtitle to go here.
YOUR TITLE HERE SUBTITLE HERE.
ANIMATION TEMPLATE FRANKIE CHEN 2015.
Presentation Title Your information.
Your Presentation Title Goes Here
Template for Microsoft PowerPoint
Sunset background PPT template
Click to add master title
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
Presentation transcript:

David Westbrook (davidrw) Combining Devel::Cover and Template-Toolkit for coverage stats on templates. Evaluate direct unit tests of templates! Devel::Cover::TT davidrw

[% title %][% ' - ' _ subtitle IF subtitle %] ~~~~ [% PROCESS show_rows IF verbose && rows.size > 0 %] ~~~~ [% BLOCK show_rows %] [% FOREACH row = rows -%] [% row.x %] / [% row.y %] = [% row.y == 0 ? 'N/A' : ( row.x / row.y ) %] [% END -%] [% END %] Initial Coverage Example { title => 'Test1', verbose => 0, rows => [ { x => 1, y => 2, }, { x => 2, y => 4, }, ], }; davidrw

Concepts & Methodology Approach BEFORE Cache file contents: Template::Document->new(.... ); To read from cache: $foo = require $cachefile AFTER Cache file contents: package path::to:tmpl::example_tmpl.pm; sub getDocument { Template::Document->new(.... ); } 1; To read from cache: eval { use path::to:tmpl::example_tmpl; $foo = path::to:tmpl::example_tmpl->getDocument(); } Interface use Devel::Cover::TT qw{ -silent 1 -ignore. }; # Devel::Cover::TT::* Provider, Document  Key Concepts Coverage of TT templates Unit tests on TT templates  Issues Coverage of.ttc, not tmpl itself Uncoverable TT-generated code  TODO Gather Feedback! Review & test TT hooks, overloads, subclassing Ensure robustness over hacks davidrw

Analysis & Improved Coverage! { title => 'Test2', subtitle => 'second test', verbose => 1, rows => [ { x => 1, y => 2, }, { x => 3, y => 0, }, { x => 2, y => 4, }, ], }; && rows.size > davidrw