github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jdfrens / ciat

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (3)
  • Downloads (13)
  • Wiki (6)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (4)
    • develop
    • gh-pages
    • master ✓
    • refactoring
  • Tags (13)
    • v0.4.10
    • v0.4.7
    • v0.4.1
    • v0.4.0
    • v0.3.4
    • v0.3.3
    • v0.3.2
    • v0.3.0
    • v0.2.0
    • v0.1.1
    • v0.1.0
    • v0.0.4
    • v0.0.3
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

a Ruby gem to assist in writing acceptance tests for compilers and interpreters — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

tweaking some code based on Caliper reports 
jdfrens (author)
Thu Dec 24 11:09:27 -0800 2009
commit  9f5ef40a6cc4c3c0d7fa3f6e9126abe1d0089c48
tree    26ef9e2b9ace9100b0ead3430be64fdb942006af
parent  4d7e2875288a5ac259144a753a376f1b84850bab
ciat /
name age
history
message
file .gitignore Loading commit data...
file History.txt
file License.txt
file README.rdoc
file Rakefile
file VERSION
directory acceptance/
file ciat.gemspec
directory lib/
directory spec/
README.rdoc

CIAT (Compiler and Interpreter Acceptance Tester)

DESCRIPTION:

CIAT (pronounced "dog") provides a system for writing high-level acceptance tests for compilers and interpreters. Each acceptance test is entered into a single file, and that file identifies the elements of a test.

SYNOPSIS:

Suppose you have a compiler written in Java that compiles a language named Hobbes. Your compiler targets the Parrot Virtual Machine. So you want to provide source code which is compiled with a Java program and that result is interpreted by Parrot.

Input File

Input files should be named with a .ciat extension and saved in a ciat folder.

A sample input file (simpleinteger5.ciat) for the scenario described above might look like this:

  Compiles a simple integer.
  ==== source
  5
  ==== compilation
  .sub main
    print 5
    print "\n"
  .end
  ==== execution
  5

This file specifies four elements: description, source, compilation, and execution. The description is always the first element, always unlabeled, and used prominently in the HTML report. All of the other elements are dependent on the processors that you use.

In this example, we’re using a "Java compiler" (a compiler written in Java) and a "Parrot executor". CIAT’s "Java compiler" runs your compiler over the source, and that output is compared to the compilation element. Then the "Parrot executor" is executed with the generated compilation, and that output is compared to the execution element.

If any processor fails, either due to an error while running or a failure during checking the output, the remaining processors are not executed.

Some processors will use optional elements in a test file. For example, the "Parrot executor" knows about command-line arguments:

  Compiles a simple integer and ignores the command-line arguments.
  ==== source
  5
  ==== compilation
  .sub main
    print 5
    print "\n"
  .end
  ==== command line
  89 pqp
  ==== execution
  5

When the "Parrot executor" is run on the compilation, it’ll also pass in 89 pqp as command-line arguments.

The Rakefile

This sample Rakefile will pull everything together:

  require 'ciat'
  require 'ciat/processors/java'
  require 'ciat/processors/parrot'

  def compiler
    classpath = Dir.glob('../lib/*.jar').join(':') + ":../bin"
    CIAT::Compilers::Java.new(classpath, 'org.norecess.hobbes.drivers.PIRCompiler')
  end

  def executor
    CIAT::Processors::Parrot.new
  end

  CIAT::RakeTask.new do |t|
    t.processors << compiler
    t.processors << executor
  end

This rakefile will find all of the .ciat files inside a ciat directory, each one representing a test. Each test will be executed, and the results are put into a folder named temp, including the HTML report report.html. All of these settings can be tweaked; see the documentation for CIAT::RakeTask for more information.

REQUIREMENTS:

  • Pronounce "CIAT" as "dog". (See this funny video.)
  • Must have diff executable.
  • You have to provide your own target-code processors (e.g., parrot for the Parrot Virtual Machine, spim for MIPS emulation, etc.)

INSTALL:

  • Install diff.
  • Install Ruby and Ruby Gems.
  • sudo gem sources -a http://gems.github.com (only needed once)
  • sudo gem install jdfrens-ciat

LICENSE:

(The MIT License)

Copyright © 2008 Jeremy D. Frens

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server