; sample Cutter file
.start
.code
#include "project-specific-header.h"
.function int convert_to_units(
char* str );
.test
.expect ERR
.params NULL
.test
.expect 720000
.params "10in"
.stop
It generates this C code:
/*
*
Unit-test harness
*
*
Generated by Cutter, the C Unit Test Framework, v. 0.50
* on
Tue Dec 06 21:59:41 2005
*
* DO
NOT MODIFY. To change this file, edit simpleSample.cut
* and
rerun Cutter.
*
*
Cutter is available at no cost from http://cutter.pz.org
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int total_tests = 2;
static int testNumber;
static int failedTests;
#include
"project-specific-header.h"
extern int convert_to_units( char* str );
int main( int argc, char *argv[] )
{
printf(
" test %04u: %s: ", ++testNumber,
"int convert_to_units(
char* str ): " );
if
(( convert_to_units ( NULL )) == ERR )
printf(
"passed\n" );
else
{
printf(
"FAILED\n" );
failedTests++;
}
printf(
" test %04u: %s: ", ++testNumber,
"int convert_to_units(
char* str ): " );
if
(( convert_to_units ( "10in" ))
== 720000 )
printf(
"passed\n" );
else
{
printf(
"FAILED\n" );
failedTests++;
}
return(
failedTests );
}
.function
int cutter_main( int argc, const char *argv[] )
.rederr “stderr on disk”
.test
.expect EXIT_FAILURE
.params 1, NULL
Cutter scripts end with the .stop command. Anything after this command is ignored.
Comments in Cutter begin with a semicolon (;), which must be the first character on the line. Comments are line-oriented, so every line in a comment must begin with a semicolon.