atom-1.0.13: An EDSL for embedded hard realtime applications.

Copyright(c) 2013 Tom Hawkins & Lee Pike
Safe HaskellNone
LanguageHaskell98

Language.Atom.Unit

Contents

Description

Unit testing, coverage, reporting & debugging for Atom

Synopsis

Types and Classes

data Test Source

Parameters for a test simulation

Constructors

Test 

Fields

name :: String

Name for test (used in log file, state name, and output)

cycles :: Int

Number of simulation cycles to run

testbench :: Atom ()

Atom specification to test

modules :: [FilePath]

Other C files to build in

includes :: [FilePath]

Other C headers to include

declCode :: String

C declarations and definitions inserted prior to the main function

initCode :: String

C code executed inside the main function, prior to loopCode

loopCode :: String

C code executed inside the loop running the test

endCode :: String

C code executed after that loop, but still in main

defaultTest :: Test Source

Default test parameters

Test Execution

runTests Source

Arguments

:: Int

Random seed

-> [IO Test]

List of tests to run

-> IO () 

Run a list of tests, output a report on test passes and coverage.

Printing Utilities

printStrLn :: String -> Atom () Source

Print a string in C using printf, appending a newline.

printIntegralE Source

Arguments

:: IntegralE a 
=> String

Prefix for printed value

-> E a

Integral value to print

-> Atom () 

Print an integral value in C using printf.

printFloatingE Source

Arguments

:: FloatingE a 
=> String

Prefix for printed value

-> E a

Floating point value to print

-> Atom () 

Print a floating point value in C using printf.

printProbe :: (String, UE) -> Atom () Source

Print the value of a probe to the console (along with its name).