This regression test consists of a program with a function that calculates Celsius from a given Fahrenheit.
#define CONV (5.0/9.0)
extern int mytotal;
int celsius (int fahrenheit) {
int rval = (int) ((fahrenheit - 32) * CONV);
return rval;
}
void main (void) {
int some_degrees;
int some_celsius;
some_celsius = celsius(some_degrees);
}
debugbutton RegTest1 c="<bar.txt" i="letter_a"
define check_celsius(arg) {
if (some_celsius != arg) {
print "Failed!"
printf ("Failed!\n actual:%d\n expected:%d\n",
some_celsius, arg);
} else {
print "Pass";
printf ("Pass!\n actual:%d\n expected:%d\n",
some_celsius, arg);
}
}
b main
r
some_degrees = 45;
S
check_celsius(7);
Now, when you start up a MULTI Debugger on foo, MULTI runs the script foo.rc automatically. foo.rc creates a button (with name RegTest1 and built-in icon letter_a with the shape of "A") and also defines a macro. You can run the regression test by clicking the button. Notice that:
This file exists in the same directory as the executable and shares the same name as the executable, but with an .rc extension. This file is useful for commands that need to execute whenever the Debugger starts on a particular executable.