stdout stderr
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 382
TrouSerS 0.2.9.1
TrouSerS is a Trusted Computing Group Software Stack (TCG TSS) implementation. more>>
TrouSerS is a Trusted Computing Group Software Stack in short TCG TSS implementation.
TrouSerS complies with the TCG Software Stack Specification Version 1.1.
Enhancements:
- Set stdout to be unbuffered when debug is on so that stderr and stdout are interleaved correctly.
- Fixed bugs in PcrExtend: 3 fields of the PCR event struct
- were not being set by trousers before sending the event to
- the TCS.
- Added error returns when setting attributes of an already
- created TPM key object.
- bugfix: spi_tpm.c, removed refs to the ID keys migration
- policy in CollateIdentityRequest.
- bugfix: clntside.c, line 175: sd is not always >= 0
- bugfix: spi_tpm.c, line 1951: uninitialized pubBlob
- bugfix: spi_tpm.c, line 2541: passing NULL to argument 2 of memcpy
- bugfix: tcspbg.c, line 1847: leaving function internal_TCSGetCap with a pointer to freed memory
- bugfix: tcskcm.c, line 939: uninitialized pubKey.key
- bugfix: biosem.c, line 210: uninitialized bytes_read
<<lessTrouSerS complies with the TCG Software Stack Specification Version 1.1.
Enhancements:
- Set stdout to be unbuffered when debug is on so that stderr and stdout are interleaved correctly.
- Fixed bugs in PcrExtend: 3 fields of the PCR event struct
- were not being set by trousers before sending the event to
- the TCS.
- Added error returns when setting attributes of an already
- created TPM key object.
- bugfix: spi_tpm.c, removed refs to the ID keys migration
- policy in CollateIdentityRequest.
- bugfix: clntside.c, line 175: sd is not always >= 0
- bugfix: spi_tpm.c, line 1951: uninitialized pubBlob
- bugfix: spi_tpm.c, line 2541: passing NULL to argument 2 of memcpy
- bugfix: tcspbg.c, line 1847: leaving function internal_TCSGetCap with a pointer to freed memory
- bugfix: tcskcm.c, line 939: uninitialized pubKey.key
- bugfix: biosem.c, line 210: uninitialized bytes_read
Download (1.3MB)
Added: 2007-07-20 License: Common Public License Price:
828 downloads
Net:IPMessenger::ToStdoutEventHandler 0.06
Net:IPMessenger::ToStdoutEventHandler is a Perl module for event handler for standard output. more>>
Net:IPMessenger::ToStdoutEventHandler is a Perl module for event handler for standard output.
SYNOPSIS
use Net::IPMessenger::ToStdoutEventHandler;
...
$ipmsg->add_event_handler( new Net::IPMessenger::ToStdoutEventHandler );
IP Messenger receive event handler for standard output.
METHODS
output
output($user->nickname . " joined.");
This actually converts encodings and output to STDOUT.
debug
Outputs debug receive message.
BR_ENTRY
Outputs "someone joined." message.
BR_EXIT
Outputs "someone left." message.
SENDMSG
Outputs "youve got message from someone." message.
<<lessSYNOPSIS
use Net::IPMessenger::ToStdoutEventHandler;
...
$ipmsg->add_event_handler( new Net::IPMessenger::ToStdoutEventHandler );
IP Messenger receive event handler for standard output.
METHODS
output
output($user->nickname . " joined.");
This actually converts encodings and output to STDOUT.
debug
Outputs debug receive message.
BR_ENTRY
Outputs "someone joined." message.
BR_EXIT
Outputs "someone left." message.
SENDMSG
Outputs "youve got message from someone." message.
Download (0.012MB)
Added: 2007-01-25 License: Perl Artistic License Price:
1006 downloads
Sys::OutPut 2.1
Sys::OutPut is a Perl module to help make output easier. more>>
Sys::OutPut is a Perl module to help make output easier.
SYNOPSIS
usage Sys::OutPut;
talk $fmtstr [, @args];
out $fmtstr [, @args];
put $fmtstr [, @args];
err $fmtstr [, @args];
debug $fmtstr [, @args];
$Sys::OutPut::quiet = $::quiet;
$Sys::OutPut::debug = $::debug;
These subroutines will make generating output to STDOUT and STDERR easier.
All of the routines treat the $fmtstr argument as a printf format string, with @args as the format string arguments.
The talk routine generates output to STDERR only if the variable $Sys::OutPut::quiet is non-null and non-zero.
The out routine generates output to STDOUT, with a newline appended to , if it is not already terminated with one.
The put routine generates output to STDOUT, without any additional trailing newline.
The err routine generates output to STDERR, with a newline appended if needed.
The debug routine generates output to STDERR only if the variable
$Sys::OutPut::debug is non-null and non-zero, which is also returned as the result.
This allows for convenient usages such as in the following example:
sub foo {
...
return if debug "Stopping now.";
...
next if debug "Skipping further processing";
...
}
If not defined by the user, the $Sys::OutPut::quiet and $Sys::OutPut::debug variables are initialized from their corresponding main variables $::quiet and $::debug, respectively, unless they are already defined.
<<lessSYNOPSIS
usage Sys::OutPut;
talk $fmtstr [, @args];
out $fmtstr [, @args];
put $fmtstr [, @args];
err $fmtstr [, @args];
debug $fmtstr [, @args];
$Sys::OutPut::quiet = $::quiet;
$Sys::OutPut::debug = $::debug;
These subroutines will make generating output to STDOUT and STDERR easier.
All of the routines treat the $fmtstr argument as a printf format string, with @args as the format string arguments.
The talk routine generates output to STDERR only if the variable $Sys::OutPut::quiet is non-null and non-zero.
The out routine generates output to STDOUT, with a newline appended to , if it is not already terminated with one.
The put routine generates output to STDOUT, without any additional trailing newline.
The err routine generates output to STDERR, with a newline appended if needed.
The debug routine generates output to STDERR only if the variable
$Sys::OutPut::debug is non-null and non-zero, which is also returned as the result.
This allows for convenient usages such as in the following example:
sub foo {
...
return if debug "Stopping now.";
...
next if debug "Skipping further processing";
...
}
If not defined by the user, the $Sys::OutPut::quiet and $Sys::OutPut::debug variables are initialized from their corresponding main variables $::quiet and $::debug, respectively, unless they are already defined.
Download (0.010MB)
Added: 2006-11-02 License: Perl Artistic License Price:
1087 downloads
System Configuration Collector Server 1.5.14
System Configuration Collector Server generates summaries of scc-data sent by clients. more>>
System Configuration Collector Server generates summaries of scc-data sent by clients. System Configuration Collector Server offers a Web interface that supports searching the snapshots and the logbooks of the systems. It also supports comparing (parts of) the snapshots of systems.
Enhancements:
- This release uses CSS directives to indicate different colors when comparing data from systems.
- It handles the case of an empty log.html when sort is implemented by busybox.
- stdout and stderr are recorded from client runs in the log file when started by scc-pull.
- A puppylinux package has been added.
- style.css has been updated to show variable data in scc snapshots.
<<lessEnhancements:
- This release uses CSS directives to indicate different colors when comparing data from systems.
- It handles the case of an empty log.html when sort is implemented by busybox.
- stdout and stderr are recorded from client runs in the log file when started by scc-pull.
- A puppylinux package has been added.
- style.css has been updated to show variable data in scc snapshots.
Download (0.12MB)
Added: 2007-06-18 License: GPL (GNU General Public License) Price:
861 downloads
ipsort
ipsort script sorts a STDIN of IP addresses to STDOUT. more>>
ipsort script sorts a STDIN of IP addresses to STDOUT. It sorts by the first octet, then by the second, the third and the fourth.
Usage: Takes Standard in or a file or list of files. So ipsort < file1 > < file2 > or cat < file > | ipsort
Its quite clever and looks for an IP address on each line, rejecting if it doesnt find one
Options:
-c or --commas Separate the list by space-separated commas, rather than one IP per line.
-u or --unique Uniquely sort the list as well, to avoid duplicate IPs.
-s or --string Use this string to separate the IPs. Eg. -s :
-m or --multiple Search for multiple IP addresses per line.
-h or --help Display this usage message.
<<lessUsage: Takes Standard in or a file or list of files. So ipsort < file1 > < file2 > or cat < file > | ipsort
Its quite clever and looks for an IP address on each line, rejecting if it doesnt find one
Options:
-c or --commas Separate the list by space-separated commas, rather than one IP per line.
-u or --unique Uniquely sort the list as well, to avoid duplicate IPs.
-s or --string Use this string to separate the IPs. Eg. -s :
-m or --multiple Search for multiple IP addresses per line.
-h or --help Display this usage message.
Download (MB)
Added: 2007-04-05 License: GPL (GNU General Public License) Price:
934 downloads
Arbitrary Command Output Colourer 0.7.1
acoc is a regular-expression based colour formatter for programs that display output on the command-line. more>>
acoc is a regular-expression based colour formatter for programs that display output on the command-line. It works as a wrapper around the target program, executing it and capturing the stdout stream. Optionally, stderr can be redirected to stdout, so that it, too, can be manipulated. acoc then applies matching rules to patterns in the output and applies colours to those matches.
Ever wondered why the output of your favourite UNIX/Linux commands is still displayed in black-and-white after all these years?
Ever had to search back through your scroll-buffer in search of gcc errors and salient information to tell you what went wrong with your programs execution?
acoc is a regular expression based colour formatter for programs that display output on the command-line. It works as a wrapper around the target program, executing it and capturing the stdout stream. Optionally, stderr can be redirected to stdout, so that it, too, can be manipulated.
acoc then applies matching rules to patterns in the output and applies colour sets to those matches. A picture is worth a thousand words, so look at the sample screenshots in the next section.
Configuration
The configuration files used by the program are /usr/local/etc/acoc.conf, /etc/acoc.conf and ~/acoc.conf. One or more of these must exist. A sample /etc/acoc.conf is supplied with some example matching rules.
Blank lines and those that begin with a # are ignored.
A program configuration stanza is introduced as follows:
[program_spec]
The square brackets are mandatory literal characters. Alternatively, the @ symbol may be used, to allow [ and ] to retain their usual semantics in program specs comprising a regular expression:
@program_spec@
program_spec is defined as one or more instances of the following component, separated by a comma:
invocation[/flags]
where invocation consists of the programs name (not including its directory path component) plus any initial arguments.
Alternatively, invocation may be a regular expression, which can be used to match multiple programs and/or command-line arguments in arbitrary order. Regular expressions are automatically anchored to the beginning of the command line.
flags, if present, is separated from invocation by a slash and consists of one or more of the following characters:
a
continue to attempt to find matching patterns after the first match has been found. By default, acoc will stop processing a line and display it after the first match has been found.
e
redirect the target programs stderr to stdout, allowing it, too, to be matched by rules
p
allocate a pseudo-terminal in which to run the target program
Some programs, such as ls(1), behave differently when their stdout is not connected to a tty. Use of this option will fool the target program into believing it is outputting to a tty, rather than a pipe to acoc.
Use of this flag requires Masahiro Tomitas Ruby/TPty library to be installed. Otherwise, the flag is silently ignored.
Note that the pseudo-terminal communication enabled by this flag is one-way only, from the target program to acoc. It is thus not possible to use acoc in combination with interactive programs, such as the interactive Ruby interpreter (irb).
t
apply colour formatting even if stdout is not a tty. By default, formatting is not applied if the output stream is not attached to a terminal.
Heres an example of a line that introduces a configuration stanza:
[rpm/ae,rpmbuild/ae]
which says to apply the following rules to the rpm and rpmbuild commands, attempt to apply all matching rules, and also apply those rules to the programs stderr stream.
Another example:
[ls/p]
This says to allocate a pseudo-terminal to ls(1), fooling it into believing that its output is being sent to a regular terminal instead of a pipe to acoc.
With this flag, the effect will be this:
$ ls
file1 file2 file3 file4 file5 file6
Without it, ls will detect that its stdout is connected to a pipe and behave accordingly:
$ ls
file1
file2
file3
file4
file5
file6
A third example:
[diff/t,rcsdiff/t,cvs diff/t,p4 diff/t]
This says that the rules that follow should be applied to all invocations of diff(1) and rcsdiff(1), as well as those invocations of cvs(1) and p4 that are followed by the argument diff.
Additionally, colouring should be applied even when stdout is not connected to a tty, so that the colours still show up when the output is displayed in a pager such as more(1) or less(1).
Yet another example:
/ps -.*(e.*f|f.*e)/
In this example, the ps(1) command will be matched, as long as the e and f options are both passed in either order.
An alternative way to write the above spec is:
@ps -.*[ef].*[ef]@
There are two things to note in this alternative:
1. @ has been used to delimit the spec, because [ and ] are required for the character lists in the regular expression.
2. While this form is less specific (in that it allows matches against duplicated command line options), it makes for considerably shorter specs if one wishes to test for the inclusion of a set of more than 2 or 3 command line flags. In the original form, one must manually list all of the possible permutations, which is equal to x! (factorial). For 3 command line flags, this is 6 permutations; for 4, it is 24, etc.
Heres one more example:
[tcpdump/r]
If this were placed in ~/.acoc.conf, it would remove any matching rules that had been installed for the diff command by either /etc/acoc.conf or /usr/local/etc/acoc.conf.
After defining the program name and operational flags, matching rules can be defined. These take the following form:
/regex/[flags] colour_spec
where regex is a Ruby-compatible regular expression. The delimiting / characters can be any character, as long as that character is not present in the regular expression itself. flags, if present, consists of one or more characters from the following list:
g
find every match on the line, not just the first. When using this flag, regex should not include parentheses.
colour_spec is defined as a comma-separated list of one or more colour_groups, which are defined as a plus-separated (+) list of one or more of the following:
* black
* blink
* blue
* bold
* clear
* concealed
* cyan
* dark
* green
* italic
* magenta
* negative
* on_black
* on_blue
* on_cyan
* on_green
* on_magenta
* on_red
* on_white
* on_yellow
* rapid_blink
* red
* reset
* strikethrough
* underline
* underscore
* white
* yellow
Examples of a colour_group are white+bold, black+on_white, etc. A complete colour_spec might look like this:
red+bold,white,yellow+bold,black+on_green
Except when using the g flag, each component of the regex that you wish to colour should be placed in parentheses. Text outside parentheses will be used for matching, but will not be coloured.
For example, examine the following:
/^(d+)foos*(w+)/
This will match a line that starts with more or one digits, followed by the string foo and any amount of white space, followed by one or more word characters. However, only the initial group of digits and the group of word characters will be coloured. The string foo and the white space that follows it will be used for matching, but will not be coloured.
Separated from the regex by white space is the colour_spec. Usually, you will include in this as many colours (separated by commas) as you have parenthesised expressions in the regex. However, its also permissible to have fewer. If, for example, you have three parenthesised expressions in the regex, but only two colours listed in the colour_spec, then the second colour will be used for colouring both the second and third matches.
If you have more colours listed in the colour_spec than there are parenthesised expressions in the regex, the surplus colours are ignored.
When using the g flag to perform a global match on the line, you may list as many colours as you want. The same rules apply here. If there are more matches than colours, the remaining matches will be coloured using the last colour listed. Surplus colours are ignored.
<<lessEver wondered why the output of your favourite UNIX/Linux commands is still displayed in black-and-white after all these years?
Ever had to search back through your scroll-buffer in search of gcc errors and salient information to tell you what went wrong with your programs execution?
acoc is a regular expression based colour formatter for programs that display output on the command-line. It works as a wrapper around the target program, executing it and capturing the stdout stream. Optionally, stderr can be redirected to stdout, so that it, too, can be manipulated.
acoc then applies matching rules to patterns in the output and applies colour sets to those matches. A picture is worth a thousand words, so look at the sample screenshots in the next section.
Configuration
The configuration files used by the program are /usr/local/etc/acoc.conf, /etc/acoc.conf and ~/acoc.conf. One or more of these must exist. A sample /etc/acoc.conf is supplied with some example matching rules.
Blank lines and those that begin with a # are ignored.
A program configuration stanza is introduced as follows:
[program_spec]
The square brackets are mandatory literal characters. Alternatively, the @ symbol may be used, to allow [ and ] to retain their usual semantics in program specs comprising a regular expression:
@program_spec@
program_spec is defined as one or more instances of the following component, separated by a comma:
invocation[/flags]
where invocation consists of the programs name (not including its directory path component) plus any initial arguments.
Alternatively, invocation may be a regular expression, which can be used to match multiple programs and/or command-line arguments in arbitrary order. Regular expressions are automatically anchored to the beginning of the command line.
flags, if present, is separated from invocation by a slash and consists of one or more of the following characters:
a
continue to attempt to find matching patterns after the first match has been found. By default, acoc will stop processing a line and display it after the first match has been found.
e
redirect the target programs stderr to stdout, allowing it, too, to be matched by rules
p
allocate a pseudo-terminal in which to run the target program
Some programs, such as ls(1), behave differently when their stdout is not connected to a tty. Use of this option will fool the target program into believing it is outputting to a tty, rather than a pipe to acoc.
Use of this flag requires Masahiro Tomitas Ruby/TPty library to be installed. Otherwise, the flag is silently ignored.
Note that the pseudo-terminal communication enabled by this flag is one-way only, from the target program to acoc. It is thus not possible to use acoc in combination with interactive programs, such as the interactive Ruby interpreter (irb).
t
apply colour formatting even if stdout is not a tty. By default, formatting is not applied if the output stream is not attached to a terminal.
Heres an example of a line that introduces a configuration stanza:
[rpm/ae,rpmbuild/ae]
which says to apply the following rules to the rpm and rpmbuild commands, attempt to apply all matching rules, and also apply those rules to the programs stderr stream.
Another example:
[ls/p]
This says to allocate a pseudo-terminal to ls(1), fooling it into believing that its output is being sent to a regular terminal instead of a pipe to acoc.
With this flag, the effect will be this:
$ ls
file1 file2 file3 file4 file5 file6
Without it, ls will detect that its stdout is connected to a pipe and behave accordingly:
$ ls
file1
file2
file3
file4
file5
file6
A third example:
[diff/t,rcsdiff/t,cvs diff/t,p4 diff/t]
This says that the rules that follow should be applied to all invocations of diff(1) and rcsdiff(1), as well as those invocations of cvs(1) and p4 that are followed by the argument diff.
Additionally, colouring should be applied even when stdout is not connected to a tty, so that the colours still show up when the output is displayed in a pager such as more(1) or less(1).
Yet another example:
/ps -.*(e.*f|f.*e)/
In this example, the ps(1) command will be matched, as long as the e and f options are both passed in either order.
An alternative way to write the above spec is:
@ps -.*[ef].*[ef]@
There are two things to note in this alternative:
1. @ has been used to delimit the spec, because [ and ] are required for the character lists in the regular expression.
2. While this form is less specific (in that it allows matches against duplicated command line options), it makes for considerably shorter specs if one wishes to test for the inclusion of a set of more than 2 or 3 command line flags. In the original form, one must manually list all of the possible permutations, which is equal to x! (factorial). For 3 command line flags, this is 6 permutations; for 4, it is 24, etc.
Heres one more example:
[tcpdump/r]
If this were placed in ~/.acoc.conf, it would remove any matching rules that had been installed for the diff command by either /etc/acoc.conf or /usr/local/etc/acoc.conf.
After defining the program name and operational flags, matching rules can be defined. These take the following form:
/regex/[flags] colour_spec
where regex is a Ruby-compatible regular expression. The delimiting / characters can be any character, as long as that character is not present in the regular expression itself. flags, if present, consists of one or more characters from the following list:
g
find every match on the line, not just the first. When using this flag, regex should not include parentheses.
colour_spec is defined as a comma-separated list of one or more colour_groups, which are defined as a plus-separated (+) list of one or more of the following:
* black
* blink
* blue
* bold
* clear
* concealed
* cyan
* dark
* green
* italic
* magenta
* negative
* on_black
* on_blue
* on_cyan
* on_green
* on_magenta
* on_red
* on_white
* on_yellow
* rapid_blink
* red
* reset
* strikethrough
* underline
* underscore
* white
* yellow
Examples of a colour_group are white+bold, black+on_white, etc. A complete colour_spec might look like this:
red+bold,white,yellow+bold,black+on_green
Except when using the g flag, each component of the regex that you wish to colour should be placed in parentheses. Text outside parentheses will be used for matching, but will not be coloured.
For example, examine the following:
/^(d+)foos*(w+)/
This will match a line that starts with more or one digits, followed by the string foo and any amount of white space, followed by one or more word characters. However, only the initial group of digits and the group of word characters will be coloured. The string foo and the white space that follows it will be used for matching, but will not be coloured.
Separated from the regex by white space is the colour_spec. Usually, you will include in this as many colours (separated by commas) as you have parenthesised expressions in the regex. However, its also permissible to have fewer. If, for example, you have three parenthesised expressions in the regex, but only two colours listed in the colour_spec, then the second colour will be used for colouring both the second and third matches.
If you have more colours listed in the colour_spec than there are parenthesised expressions in the regex, the surplus colours are ignored.
When using the g flag to perform a global match on the line, you may list as many colours as you want. The same rules apply here. If there are more matches than colours, the remaining matches will be coloured using the last colour listed. Surplus colours are ignored.
Download (0.04MB)
Added: 2005-04-11 License: GPL (GNU General Public License) Price:
1656 downloads
Rational PIC Assembler 2.0
Rational PIC Assembler is a mid-range PIC assembler with Intel style syntax. more>>
Rational PIC Assembler is an assembler for the mid-range microcontrollers from Microchip. The project uses Intel style mnemonics and target-first operand ordering. Designed to feel comfortable to PC assembly programmers.
This assembler generates code compatible with Microchips midline microcontrollers but is incompatible with their assembler. It should feel familiar to any PC assembly programmer. The instruction mnemonics and operand order are Intel style ( i.e. right, as opposed to wrong ).
Command Line Syntax
pic-asm [ -c ] [ -l filename ] [ -o filename ] input_file
-c -- console mode
an assembly source is accepted from stdin. binary code is
output on stdout. errors are output to stderr
-l filename -- specify listing file
-o filename -- specify object file
Input
The input is a sequence of line each of which contains one or more of the following fields
label instruction operands ; comment
The label and comment are optional. The operands required depend on the instruction.
The assembler is case sensitive, even for instructions.
Constants
Hex values can be specified with C-style 0x[:xdigit:]+. Binary values can be specified with 0b[01]+. Decimal values require no prefix as decimal is the default base.
Character constants are specified by enclosing a single character or escaped character within single quotes. String constants are specified by enclosing zero or more characters and escaped characters within double quotes. String constants generate one character constant for each character in the string. There is no trailing zero stored. For example:
db "Hello worldn", 0, a, b, r, n, t
Labels
A label is a sequence of alphanumeric characters ( including underbar ) that starts a line. Labels do not have colons. Labels local to the last nonlocal label can be defined by prefixing the name with a dot. For instance
; example from example-1.asm
foo call .1
.1 jmp .2
.2 jmp .1
bar call .1
.1 jmp .2
.2 jmp .1
In this example, the labels defined are foo, foo.1, foo.2, bar, bar.1, and bar.2. The first call branches to foo.1. The second call branches to bar.1. The labels local to foo can not be referenced before foo has been declared nor after bar has been declared.
Directives
Data can be declared. The declarator takes the place of the instruction and is followed by one or more expressions separated by commas. Each expression corresponds to one word in the output code regardless of the declarator type.
db - each operand is AND-ed with 0xff before being stored
dw - full 14 bit word definition
dt - each operand is AND-ed with 0xff and OR-ed with 0x3400 ( the return-with-value opcode ). This allows generation of case tables. You can add the accumulator ( w ) to the offset of the table. The processor will branch to the location in the table and return with an eight bit result
For instance:
db 1,2,3
dw 0x3fff, 0x3ff * 16 + 15, -1
dt 0b001, 0b010, 0b100
Equates are a named sequence of tokens. They can be defined with equ. For instance:
led_1 equ 0x100 | 1
led_2 equ 0x100 | 2
combo equ ( led_1 ) | ( led_2 )
The org position can be changed with org. For instance
org 0x10o
Enhancements:
- This release adds support for sophisticated macros, include files, conditional compilation, and compatibility with Microchip headers.
<<lessThis assembler generates code compatible with Microchips midline microcontrollers but is incompatible with their assembler. It should feel familiar to any PC assembly programmer. The instruction mnemonics and operand order are Intel style ( i.e. right, as opposed to wrong ).
Command Line Syntax
pic-asm [ -c ] [ -l filename ] [ -o filename ] input_file
-c -- console mode
an assembly source is accepted from stdin. binary code is
output on stdout. errors are output to stderr
-l filename -- specify listing file
-o filename -- specify object file
Input
The input is a sequence of line each of which contains one or more of the following fields
label instruction operands ; comment
The label and comment are optional. The operands required depend on the instruction.
The assembler is case sensitive, even for instructions.
Constants
Hex values can be specified with C-style 0x[:xdigit:]+. Binary values can be specified with 0b[01]+. Decimal values require no prefix as decimal is the default base.
Character constants are specified by enclosing a single character or escaped character within single quotes. String constants are specified by enclosing zero or more characters and escaped characters within double quotes. String constants generate one character constant for each character in the string. There is no trailing zero stored. For example:
db "Hello worldn", 0, a, b, r, n, t
Labels
A label is a sequence of alphanumeric characters ( including underbar ) that starts a line. Labels do not have colons. Labels local to the last nonlocal label can be defined by prefixing the name with a dot. For instance
; example from example-1.asm
foo call .1
.1 jmp .2
.2 jmp .1
bar call .1
.1 jmp .2
.2 jmp .1
In this example, the labels defined are foo, foo.1, foo.2, bar, bar.1, and bar.2. The first call branches to foo.1. The second call branches to bar.1. The labels local to foo can not be referenced before foo has been declared nor after bar has been declared.
Directives
Data can be declared. The declarator takes the place of the instruction and is followed by one or more expressions separated by commas. Each expression corresponds to one word in the output code regardless of the declarator type.
db - each operand is AND-ed with 0xff before being stored
dw - full 14 bit word definition
dt - each operand is AND-ed with 0xff and OR-ed with 0x3400 ( the return-with-value opcode ). This allows generation of case tables. You can add the accumulator ( w ) to the offset of the table. The processor will branch to the location in the table and return with an eight bit result
For instance:
db 1,2,3
dw 0x3fff, 0x3ff * 16 + 15, -1
dt 0b001, 0b010, 0b100
Equates are a named sequence of tokens. They can be defined with equ. For instance:
led_1 equ 0x100 | 1
led_2 equ 0x100 | 2
combo equ ( led_1 ) | ( led_2 )
The org position can be changed with org. For instance
org 0x10o
Enhancements:
- This release adds support for sophisticated macros, include files, conditional compilation, and compatibility with Microchip headers.
Download (0.040MB)
Added: 2006-10-31 License: GPL (GNU General Public License) Price:
1090 downloads
Test::Cmd 1.05
Test::Cmd is a Perl module for portable testing of commands and scripts. more>>
Test::Cmd is a Perl module for portable testing of commands and scripts.
SYNOPSIS
use Test::Cmd;
$test = Test::Cmd->new(prog => program_or_script_to_test,
interpreter => script_interpreter,
string => identifier_string,
workdir => ,
subdir => dir,
match_sub => $code_ref,
verbose => 1);
$test->verbose(1);
$test->prog(program_or_script_to_test);
$test->basename(@suffixlist);
$test->interpreter(script_interpreter);
$test->string(identifier string);
$test->workdir(prefix);
$test->workpath(subdir, file);
$test->subdir(subdir, ...);
$test->subdir([sub, dir], ...);
$test->write(file, read($contents, [subdir, file]);
$test->read(@lines, [subdir, file]);
$test->writable(dir);
$test->writable(dir, $rwflag);
$test->writable(dir, $rwflag, %errors);
$test->preserve(condition, ...);
$test->cleanup(condition);
$test->run(prog => program_or_script_to_test,
interpreter => script_interpreter,
chdir => dir, args => arguments, stdin => pass(condition, &func);
$test->fail(condition);
$test->fail(condition, &func);
$test->fail(condition, &func, $caller);
$test->no_result(condition);
$test->no_result(condition, &func);
$test->no_result(condition, &func, $caller);
$test->stdout;
$test->stdout($run_number);
$test->stderr;
$test->stderr($run_number);
$test->match(@lines, @matches);
$test->match($lines, $matches);
$test->match_exact(@lines, @matches);
$test->match_exact($lines, $matches);
$test->match_regex(@lines, @regexes);
$test->match_regex($lines, $regexes);
$test->diff_exact(@lines, @matches, @output);
$test->diff_exact($lines, $matches, @output);
$test->diff_regex(@lines, @regexes, @output);
$test->diff_regex($lines, $regexes, @output);
sub func {
my ($self, $lines, $matches) = @_;
# code to match $lines and $matches
}
$test->match_sub(&func);
$test->match_sub(sub { code to match $_[1] and $_[2] });
$test->here;
The Test::Cmd module provides a low-level framework for portable automated testing of executable commands and scripts (in any language, not just Perl), especially commands and scripts that interact with the file system.
The Test::Cmd module makes no assumptions about what constitutes a successful or failed test. Attempting to read a file that doesnt exist, for example, may or may not be an error, depending on the software being tested.
Consequently, no Test::Cmd methods (including the new() method) exit, die or throw any other sorts of exceptions (but they all do return useful error indications). Exceptions or other error status should be handled by a higher layer: a subclass of Test::Cmd, or another testing framework such as the Test or Test::Simple Perl modules, or by the test itself.
(That said, see the Test::Cmd::Common module if you want a similar module that provides exception handling, either to use directly in your own tests, or as an example of how to use Test::Cmd.)
In addition to running tests and evaluating conditions, the Test::Cmd module manages and cleans up one or more temporary workspace directories, and provides methods for creating files and directories in those workspace directories from in-line data (that is, here-documents), allowing tests to be completely self-contained. When used in conjunction with another testing framework, the Test::Cmd module can function as a fixture (common startup code for multiple tests) for simple management of command execution and temporary workspaces.
The Test::Cmd module inherits File::Spec methods (file_name_is_absolute(), catfile(), etc.) to support writing tests portably across a variety of operating and file systems.
A Test::Cmd environment object is created via the usual invocation:
$test = Test::Cmd->new();
Arguments to the Test::Cmd::new method are keyword-value pairs that may be used to initialize the object, typically by invoking the same-named method as the keyword.
<<lessSYNOPSIS
use Test::Cmd;
$test = Test::Cmd->new(prog => program_or_script_to_test,
interpreter => script_interpreter,
string => identifier_string,
workdir => ,
subdir => dir,
match_sub => $code_ref,
verbose => 1);
$test->verbose(1);
$test->prog(program_or_script_to_test);
$test->basename(@suffixlist);
$test->interpreter(script_interpreter);
$test->string(identifier string);
$test->workdir(prefix);
$test->workpath(subdir, file);
$test->subdir(subdir, ...);
$test->subdir([sub, dir], ...);
$test->write(file, read($contents, [subdir, file]);
$test->read(@lines, [subdir, file]);
$test->writable(dir);
$test->writable(dir, $rwflag);
$test->writable(dir, $rwflag, %errors);
$test->preserve(condition, ...);
$test->cleanup(condition);
$test->run(prog => program_or_script_to_test,
interpreter => script_interpreter,
chdir => dir, args => arguments, stdin => pass(condition, &func);
$test->fail(condition);
$test->fail(condition, &func);
$test->fail(condition, &func, $caller);
$test->no_result(condition);
$test->no_result(condition, &func);
$test->no_result(condition, &func, $caller);
$test->stdout;
$test->stdout($run_number);
$test->stderr;
$test->stderr($run_number);
$test->match(@lines, @matches);
$test->match($lines, $matches);
$test->match_exact(@lines, @matches);
$test->match_exact($lines, $matches);
$test->match_regex(@lines, @regexes);
$test->match_regex($lines, $regexes);
$test->diff_exact(@lines, @matches, @output);
$test->diff_exact($lines, $matches, @output);
$test->diff_regex(@lines, @regexes, @output);
$test->diff_regex($lines, $regexes, @output);
sub func {
my ($self, $lines, $matches) = @_;
# code to match $lines and $matches
}
$test->match_sub(&func);
$test->match_sub(sub { code to match $_[1] and $_[2] });
$test->here;
The Test::Cmd module provides a low-level framework for portable automated testing of executable commands and scripts (in any language, not just Perl), especially commands and scripts that interact with the file system.
The Test::Cmd module makes no assumptions about what constitutes a successful or failed test. Attempting to read a file that doesnt exist, for example, may or may not be an error, depending on the software being tested.
Consequently, no Test::Cmd methods (including the new() method) exit, die or throw any other sorts of exceptions (but they all do return useful error indications). Exceptions or other error status should be handled by a higher layer: a subclass of Test::Cmd, or another testing framework such as the Test or Test::Simple Perl modules, or by the test itself.
(That said, see the Test::Cmd::Common module if you want a similar module that provides exception handling, either to use directly in your own tests, or as an example of how to use Test::Cmd.)
In addition to running tests and evaluating conditions, the Test::Cmd module manages and cleans up one or more temporary workspace directories, and provides methods for creating files and directories in those workspace directories from in-line data (that is, here-documents), allowing tests to be completely self-contained. When used in conjunction with another testing framework, the Test::Cmd module can function as a fixture (common startup code for multiple tests) for simple management of command execution and temporary workspaces.
The Test::Cmd module inherits File::Spec methods (file_name_is_absolute(), catfile(), etc.) to support writing tests portably across a variety of operating and file systems.
A Test::Cmd environment object is created via the usual invocation:
$test = Test::Cmd->new();
Arguments to the Test::Cmd::new method are keyword-value pairs that may be used to initialize the object, typically by invoking the same-named method as the keyword.
Download (0.030MB)
Added: 2007-02-23 License: Perl Artistic License Price:
978 downloads
Apache::TestUtil 1.29
Apache::TestUtil Perl module contains utility functions for writing tests. more>>
Apache::TestUtil Perl module contains utility functions for writing tests.
SYNOPSIS
use Apache::Test;
use Apache::TestUtil;
ok t_cmp("foo", "foo", "sanity check");
t_write_file("filename", @content);
my $fh = t_open_file($filename);
t_mkdir("/foo/bar");
t_rmtree("/foo/bar");
t_is_equal($a, $b);
Apache::TestUtil automatically exports a number of functions useful in writing tests.
All the files and directories created using the functions from this package will be automatically destroyed at the end of the program execution (via END block). You should not use these functions other than from within tests which should cleanup all the created directories and files at the end of the test.
FUNCTIONS
t_cmp()
t_cmp($received, $expected, $comment);
t_cmp() prints the values of $comment, $expected and $received. e.g.:
t_cmp(1, 1, "1 == 1?");
prints:
# testing : 1 == 1?
# expected: 1
# received: 1
then it returns the result of comparison of the $expected and the $received variables. Usually, the return value of this function is fed directly to the ok() function, like this:
ok t_cmp(1, 1, "1 == 1?");
the third argument ($comment) is optional, mostly useful for telling what the comparison is trying to do.
It is valid to use undef as an expected value. Therefore:
my $foo;
t_cmp(undef, $foo, "undef == undef?");
will return a true value.
You can compare any two data-structures with t_cmp(). Just make sure that if you pass non-scalars, you have to pass their references. The datastructures can be deeply nested. For example you can compare:
t_cmp({1 => [2..3,{5..8}], 4 => [5..6]},
{1 => [2..3,{5..8}], 4 => [5..6]},
"hash of array of hashes");
You can also compare the second argument against the first as a regex. Use the qr// function in the second argument. For example:
t_cmp("abcd", qr/^abc/, "regex compare");
will do:
"abcd" =~ /^abc/;
This function is exported by default.
t_filepath_cmp()
This function is used to compare two filepaths via t_cmp(). For non-Win32, it simply uses t_cmp() for the comparison, but for Win32, Win32::GetLongPathName() is invoked to convert the first two arguments to their DOS long pathname. This is useful when there is a possibility the two paths being compared are not both represented by their long or short pathname.
This function is exported by default.
t_debug()
t_debug("testing feature foo");
t_debug("test", [1..3], 5, {a=>[1..5]});
t_debug() prints out any datastructure while prepending # at the beginning of each line, to make the debug printouts comply with Test::Harnesss requirements. This function should be always used for debug prints, since if in the future the debug printing will change (e.g. redirected into a file) your tests wont need to be changed.
the special global variable $Apache::TestUtil::DEBUG_OUTPUT can be used to redirect the output from t_debug() and related calls such as t_write_file(). for example, from a server-side test you would probably need to redirect it to STDERR:
sub handler {
plan $r, tests => 1;
local $Apache::TestUtil::DEBUG_OUTPUT = *STDERR;
t_write_file(/tmp/foo, bar);
...
}
left to its own devices, t_debug() will collide with the standard HTTP protocol during server-side tests, resulting in a situation both confusing difficult to debug. but STDOUT is left as the default, since you probably dont want debug output under normal circumstances unless running under verbose mode.
This function is exported by default.
t_write_file()
t_write_file($filename, @lines);
t_write_file() creates a new file at $filename or overwrites the existing file with the content passed in @lines. If only the $filename is passed, an empty file will be created.
If parent directories of $filename dont exist they will be automagically created.
The generated file will be automatically deleted at the end of the programs execution.
This function is exported by default.
t_append_file()
t_append_file($filename, @lines);
t_append_file() is similar to t_write_file(), but it doesnt clobber existing files and appends @lines to the end of the file. If the file doesnt exist it will create it.
If parent directories of $filename dont exist they will be automagically created.
The generated file will be registered to be automatically deleted at the end of the programs execution, only if the file was created by t_append_file().
This function is exported by default.
t_write_shell_script()
Apache::TestUtil::t_write_shell_script($filename, @lines);
Similar to t_write_file() but creates a portable shell/batch script. The created filename is constructed from $filename and an appropriate extension automatically selected according to the platform the code is running under.
It returns the extension of the created file.
t_write_perl_script()
Apache::TestUtil::t_write_perl_script($filename, @lines);
Similar to t_write_file() but creates a executable Perl script with correctly set shebang line.
t_open_file()
my $fh = t_open_file($filename);
t_open_file() opens a file $filename for writing and returns the file handle to the opened file.
If parent directories of $filename dont exist they will be automagically created.
The generated file will be automatically deleted at the end of the programs execution.
This function is exported by default.
t_mkdir()
t_mkdir($dirname);
t_mkdir() creates a directory $dirname. The operation will fail if the parent directory doesnt exist.
If parent directories of $dirname dont exist they will be automagically created.
The generated directory will be automatically deleted at the end of the programs execution.
This function is exported by default.
t_rmtree()
t_rmtree(@dirs);
t_rmtree() deletes the whole directories trees passed in @dirs.
This function is exported by default.
t_chown()
Apache::TestUtil::t_chown($file);
Change ownership of $file to the tests User/Group. This function is noop on platforms where chown(2) is unsupported (e.g. Win32).
t_is_equal()
t_is_equal($a, $b);
t_is_equal() compares any two datastructures and returns 1 if they are exactly the same, otherwise 0. The datastructures can be nested hashes, arrays, scalars, undefs or a combination of any of these. See t_cmp() for an example.
If $b is a regex reference, the regex comparison $a =~ $b is performed. For example:
t_is_equal($server_version, qr{^Apache});
If comparing non-scalars make sure to pass the references to the datastructures.
This function is exported by default.
t_server_log_error_is_expected()
If the handlers execution results in an error or a warning logged to the error_log file which is expected, its a good idea to have a disclaimer printed before the error itself, so one can tell real problems with tests from expected errors. For example when testing how the package behaves under error conditions the error_log file might be loaded with errors, most of which are expected.
For example if a handler is about to generate a run-time error, this function can be used as:
use Apache::TestUtil;
...
sub handler {
my $r = shift;
...
t_server_log_error_is_expected();
die "failed because ...";
}
After running this handler the error_log file will include:
*** The following error entry is expected and harmless ***
[Tue Apr 01 14:00:21 2003] [error] failed because ...
When more than one entry is expected, an optional numerical argument, indicating how many entries to expect, can be passed. For example:
t_server_log_error_is_expected(2);
will generate:
*** The following 2 error entries are expected and harmless ***
If the error is generated at compile time, the logging must be done in the BEGIN block at the very beginning of the file:
BEGIN {
use Apache::TestUtil;
t_server_log_error_is_expected();
}
use DOES_NOT_exist;
After attempting to run this handler the error_log file will include:
*** The following error entry is expected and harmless ***
[Tue Apr 01 14:04:49 2003] [error] Cant locate "DOES_NOT_exist.pm"
in @INC (@INC contains: ...
Also see t_server_log_warn_is_expected() which is similar but used for warnings.
This function is exported by default.
t_server_log_warn_is_expected()
t_server_log_warn_is_expected() generates a disclaimer for expected warnings.
See the explanation for t_server_log_error_is_expected() for more details.
This function is exported by default.
t_client_log_error_is_expected()
t_client_log_error_is_expected() generates a disclaimer for expected errors. But in contrast to t_server_log_error_is_expected() called by the client side of the script.
See the explanation for t_server_log_error_is_expected() for more details.
For example the following client script fails to find the handler:
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET);
plan tests => 1;
t_client_log_error_is_expected();
my $url = "/error_document/cannot_be_found";
my $res = GET($url);
ok t_cmp(404, $res->code, "test 404");
After running this test the error_log file will include an entry similar to the following snippet:
*** The following error entry is expected and harmless ***
[Tue Apr 01 14:02:55 2003] [error] [client 127.0.0.1]
File does not exist: /tmp/test/t/htdocs/error
When more than one entry is expected, an optional numerical argument, indicating how many entries to expect, can be passed. For example:
t_client_log_error_is_expected(2);
will generate:
*** The following 2 error entries are expected and harmless ***
This function is exported by default.
t_client_log_warn_is_expected()
t_client_log_warn_is_expected() generates a disclaimer for expected warnings on the client side.
See the explanation for t_client_log_error_is_expected() for more details.
This function is exported by default.
t_catfile(a, b, c)
This function is essentially File::Spec->catfile, but on Win32 will use Win32::GetLongpathName() to convert the result to a long path name (if the result is an absolute file). The function is not exported by default.
t_catfile_apache(a, b, c)
This function is essentially File::Spec::Unix->catfile, but on Win32 will use Win32::GetLongpathName() to convert the result to a long path name (if the result is an absolute file). It is useful when comparing something to that returned by Apache, which uses a Unix-style specification with forward slashes for directory separators. The function is not exported by default.
t_start_error_log_watch(), t_finish_error_log_watch()
This pair of functions provides an easy interface for checking the presence or absense of any particular message or messages in the httpd error_log that were generated by the httpd daemon as part of a test suite. It is likely, that you should proceed this with a call to one of the t_*_is_expected() functions.
t_start_error_log_watch();
do_it;
ok grep {...} t_finish_error_log_watch()
<<lessSYNOPSIS
use Apache::Test;
use Apache::TestUtil;
ok t_cmp("foo", "foo", "sanity check");
t_write_file("filename", @content);
my $fh = t_open_file($filename);
t_mkdir("/foo/bar");
t_rmtree("/foo/bar");
t_is_equal($a, $b);
Apache::TestUtil automatically exports a number of functions useful in writing tests.
All the files and directories created using the functions from this package will be automatically destroyed at the end of the program execution (via END block). You should not use these functions other than from within tests which should cleanup all the created directories and files at the end of the test.
FUNCTIONS
t_cmp()
t_cmp($received, $expected, $comment);
t_cmp() prints the values of $comment, $expected and $received. e.g.:
t_cmp(1, 1, "1 == 1?");
prints:
# testing : 1 == 1?
# expected: 1
# received: 1
then it returns the result of comparison of the $expected and the $received variables. Usually, the return value of this function is fed directly to the ok() function, like this:
ok t_cmp(1, 1, "1 == 1?");
the third argument ($comment) is optional, mostly useful for telling what the comparison is trying to do.
It is valid to use undef as an expected value. Therefore:
my $foo;
t_cmp(undef, $foo, "undef == undef?");
will return a true value.
You can compare any two data-structures with t_cmp(). Just make sure that if you pass non-scalars, you have to pass their references. The datastructures can be deeply nested. For example you can compare:
t_cmp({1 => [2..3,{5..8}], 4 => [5..6]},
{1 => [2..3,{5..8}], 4 => [5..6]},
"hash of array of hashes");
You can also compare the second argument against the first as a regex. Use the qr// function in the second argument. For example:
t_cmp("abcd", qr/^abc/, "regex compare");
will do:
"abcd" =~ /^abc/;
This function is exported by default.
t_filepath_cmp()
This function is used to compare two filepaths via t_cmp(). For non-Win32, it simply uses t_cmp() for the comparison, but for Win32, Win32::GetLongPathName() is invoked to convert the first two arguments to their DOS long pathname. This is useful when there is a possibility the two paths being compared are not both represented by their long or short pathname.
This function is exported by default.
t_debug()
t_debug("testing feature foo");
t_debug("test", [1..3], 5, {a=>[1..5]});
t_debug() prints out any datastructure while prepending # at the beginning of each line, to make the debug printouts comply with Test::Harnesss requirements. This function should be always used for debug prints, since if in the future the debug printing will change (e.g. redirected into a file) your tests wont need to be changed.
the special global variable $Apache::TestUtil::DEBUG_OUTPUT can be used to redirect the output from t_debug() and related calls such as t_write_file(). for example, from a server-side test you would probably need to redirect it to STDERR:
sub handler {
plan $r, tests => 1;
local $Apache::TestUtil::DEBUG_OUTPUT = *STDERR;
t_write_file(/tmp/foo, bar);
...
}
left to its own devices, t_debug() will collide with the standard HTTP protocol during server-side tests, resulting in a situation both confusing difficult to debug. but STDOUT is left as the default, since you probably dont want debug output under normal circumstances unless running under verbose mode.
This function is exported by default.
t_write_file()
t_write_file($filename, @lines);
t_write_file() creates a new file at $filename or overwrites the existing file with the content passed in @lines. If only the $filename is passed, an empty file will be created.
If parent directories of $filename dont exist they will be automagically created.
The generated file will be automatically deleted at the end of the programs execution.
This function is exported by default.
t_append_file()
t_append_file($filename, @lines);
t_append_file() is similar to t_write_file(), but it doesnt clobber existing files and appends @lines to the end of the file. If the file doesnt exist it will create it.
If parent directories of $filename dont exist they will be automagically created.
The generated file will be registered to be automatically deleted at the end of the programs execution, only if the file was created by t_append_file().
This function is exported by default.
t_write_shell_script()
Apache::TestUtil::t_write_shell_script($filename, @lines);
Similar to t_write_file() but creates a portable shell/batch script. The created filename is constructed from $filename and an appropriate extension automatically selected according to the platform the code is running under.
It returns the extension of the created file.
t_write_perl_script()
Apache::TestUtil::t_write_perl_script($filename, @lines);
Similar to t_write_file() but creates a executable Perl script with correctly set shebang line.
t_open_file()
my $fh = t_open_file($filename);
t_open_file() opens a file $filename for writing and returns the file handle to the opened file.
If parent directories of $filename dont exist they will be automagically created.
The generated file will be automatically deleted at the end of the programs execution.
This function is exported by default.
t_mkdir()
t_mkdir($dirname);
t_mkdir() creates a directory $dirname. The operation will fail if the parent directory doesnt exist.
If parent directories of $dirname dont exist they will be automagically created.
The generated directory will be automatically deleted at the end of the programs execution.
This function is exported by default.
t_rmtree()
t_rmtree(@dirs);
t_rmtree() deletes the whole directories trees passed in @dirs.
This function is exported by default.
t_chown()
Apache::TestUtil::t_chown($file);
Change ownership of $file to the tests User/Group. This function is noop on platforms where chown(2) is unsupported (e.g. Win32).
t_is_equal()
t_is_equal($a, $b);
t_is_equal() compares any two datastructures and returns 1 if they are exactly the same, otherwise 0. The datastructures can be nested hashes, arrays, scalars, undefs or a combination of any of these. See t_cmp() for an example.
If $b is a regex reference, the regex comparison $a =~ $b is performed. For example:
t_is_equal($server_version, qr{^Apache});
If comparing non-scalars make sure to pass the references to the datastructures.
This function is exported by default.
t_server_log_error_is_expected()
If the handlers execution results in an error or a warning logged to the error_log file which is expected, its a good idea to have a disclaimer printed before the error itself, so one can tell real problems with tests from expected errors. For example when testing how the package behaves under error conditions the error_log file might be loaded with errors, most of which are expected.
For example if a handler is about to generate a run-time error, this function can be used as:
use Apache::TestUtil;
...
sub handler {
my $r = shift;
...
t_server_log_error_is_expected();
die "failed because ...";
}
After running this handler the error_log file will include:
*** The following error entry is expected and harmless ***
[Tue Apr 01 14:00:21 2003] [error] failed because ...
When more than one entry is expected, an optional numerical argument, indicating how many entries to expect, can be passed. For example:
t_server_log_error_is_expected(2);
will generate:
*** The following 2 error entries are expected and harmless ***
If the error is generated at compile time, the logging must be done in the BEGIN block at the very beginning of the file:
BEGIN {
use Apache::TestUtil;
t_server_log_error_is_expected();
}
use DOES_NOT_exist;
After attempting to run this handler the error_log file will include:
*** The following error entry is expected and harmless ***
[Tue Apr 01 14:04:49 2003] [error] Cant locate "DOES_NOT_exist.pm"
in @INC (@INC contains: ...
Also see t_server_log_warn_is_expected() which is similar but used for warnings.
This function is exported by default.
t_server_log_warn_is_expected()
t_server_log_warn_is_expected() generates a disclaimer for expected warnings.
See the explanation for t_server_log_error_is_expected() for more details.
This function is exported by default.
t_client_log_error_is_expected()
t_client_log_error_is_expected() generates a disclaimer for expected errors. But in contrast to t_server_log_error_is_expected() called by the client side of the script.
See the explanation for t_server_log_error_is_expected() for more details.
For example the following client script fails to find the handler:
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET);
plan tests => 1;
t_client_log_error_is_expected();
my $url = "/error_document/cannot_be_found";
my $res = GET($url);
ok t_cmp(404, $res->code, "test 404");
After running this test the error_log file will include an entry similar to the following snippet:
*** The following error entry is expected and harmless ***
[Tue Apr 01 14:02:55 2003] [error] [client 127.0.0.1]
File does not exist: /tmp/test/t/htdocs/error
When more than one entry is expected, an optional numerical argument, indicating how many entries to expect, can be passed. For example:
t_client_log_error_is_expected(2);
will generate:
*** The following 2 error entries are expected and harmless ***
This function is exported by default.
t_client_log_warn_is_expected()
t_client_log_warn_is_expected() generates a disclaimer for expected warnings on the client side.
See the explanation for t_client_log_error_is_expected() for more details.
This function is exported by default.
t_catfile(a, b, c)
This function is essentially File::Spec->catfile, but on Win32 will use Win32::GetLongpathName() to convert the result to a long path name (if the result is an absolute file). The function is not exported by default.
t_catfile_apache(a, b, c)
This function is essentially File::Spec::Unix->catfile, but on Win32 will use Win32::GetLongpathName() to convert the result to a long path name (if the result is an absolute file). It is useful when comparing something to that returned by Apache, which uses a Unix-style specification with forward slashes for directory separators. The function is not exported by default.
t_start_error_log_watch(), t_finish_error_log_watch()
This pair of functions provides an easy interface for checking the presence or absense of any particular message or messages in the httpd error_log that were generated by the httpd daemon as part of a test suite. It is likely, that you should proceed this with a call to one of the t_*_is_expected() functions.
t_start_error_log_watch();
do_it;
ok grep {...} t_finish_error_log_watch()
Download (0.15MB)
Added: 2007-07-30 License: Perl Artistic License Price:
816 downloads
Test::Trap 0.0.23
Test::Trap is a Perl module with trap exit codes, exceptions, output, etc. more>>
Test::Trap is a Perl module with trap exit codes, exceptions, output, etc.
SYNOPSIS
use Test::More;
use Test::Trap qw( trap $trap );
my @r = trap { some_code(@some_parameters) };
is ( $trap->exit, 1, Expecting &some_code to exit with 1 );
is ( $trap->stdout, , Expecting no STDOUT );
like ( $trap->stderr, qr/^Bad parameters; exitingb/, Expecting warnings. );
Primarily (but not exclusively) for use in test scripts: A block eval on steroids, configurable and extensible, but by default trapping (Perl) STDOUT, STDERR, warnings, exceptions, would-be exit codes, and return values from boxed blocks of test code.
The values collected by the latest trap can then be queried or tested through a a special result object.
EXPORT
A function and a scalar may be exported by any name. The function (by default named trap) is an analogue to block eval(), and the scalar (by default named $trap) is the corresponding analogue to $@.
Optionally, you may specify the default layers for the exported trap. Layers may be specified by name, with a colon sigil. Multiple layers may be given in a list, or just stringed together like :flow:stderr:warn.
(For the advanced user, you may also specify anonymous layer implementations -- i.e. an appropriate subroutine.)
See below for a list of the built-in layers, all of which are enabled by default. Note, finally, that the ordering of the layers matter: The :raw layer is always on the bottom (anything underneath it is ignored), and any other "flow control" layers used should be right down there with it.
FUNCTION
trap BLOCK
This function may be exported by any name, but defaults to trap.
Traps exceptions like block eval, but (by default) also traps exits and exit codes, returns and return values, context, and (Perl) STDOUT, STDERR, and warnings, All information trapped can be queried by way of the status object, which is by default exported as $trap, but can be exported by any name.
<<lessSYNOPSIS
use Test::More;
use Test::Trap qw( trap $trap );
my @r = trap { some_code(@some_parameters) };
is ( $trap->exit, 1, Expecting &some_code to exit with 1 );
is ( $trap->stdout, , Expecting no STDOUT );
like ( $trap->stderr, qr/^Bad parameters; exitingb/, Expecting warnings. );
Primarily (but not exclusively) for use in test scripts: A block eval on steroids, configurable and extensible, but by default trapping (Perl) STDOUT, STDERR, warnings, exceptions, would-be exit codes, and return values from boxed blocks of test code.
The values collected by the latest trap can then be queried or tested through a a special result object.
EXPORT
A function and a scalar may be exported by any name. The function (by default named trap) is an analogue to block eval(), and the scalar (by default named $trap) is the corresponding analogue to $@.
Optionally, you may specify the default layers for the exported trap. Layers may be specified by name, with a colon sigil. Multiple layers may be given in a list, or just stringed together like :flow:stderr:warn.
(For the advanced user, you may also specify anonymous layer implementations -- i.e. an appropriate subroutine.)
See below for a list of the built-in layers, all of which are enabled by default. Note, finally, that the ordering of the layers matter: The :raw layer is always on the bottom (anything underneath it is ignored), and any other "flow control" layers used should be right down there with it.
FUNCTION
trap BLOCK
This function may be exported by any name, but defaults to trap.
Traps exceptions like block eval, but (by default) also traps exits and exit codes, returns and return values, context, and (Perl) STDOUT, STDERR, and warnings, All information trapped can be queried by way of the status object, which is by default exported as $trap, but can be exported by any name.
Download (0.028MB)
Added: 2007-08-06 License: Perl Artistic License Price:
810 downloads
Libtubo Interprocess Communication 4.5.0
Libtubo Interprocess Communication is a small and simple library to run processes in the background and communicate via stdout. more>>
Libtubo Interprocess Communication is a small and simple library that can run processes in the background and communicate via the stdout, stderr, and stdin file descriptors.
The functionality of libtubo is similar to the glib function g_spawn_async_with_pipes(), except that all pipe setup and monitoring is taken care of.
The calling function only has to provide the functions with which to process the input/output of the remote process.
The library first appeared in the year 2000 in the xfce3 desktop as part of the xfsamba application, and is now available for use for other developers.
Enhancements:
- Some control bugfixes.
- The version has been updated to the xffm scheme, as this package is now distributed with xffm.
<<lessThe functionality of libtubo is similar to the glib function g_spawn_async_with_pipes(), except that all pipe setup and monitoring is taken care of.
The calling function only has to provide the functions with which to process the input/output of the remote process.
The library first appeared in the year 2000 in the xfce3 desktop as part of the xfsamba application, and is now available for use for other developers.
Enhancements:
- Some control bugfixes.
- The version has been updated to the xffm scheme, as this package is now distributed with xffm.
Download (0.35MB)
Added: 2006-05-25 License: LGPL (GNU Lesser General Public License) Price:
1251 downloads
Low Resolution Modeline Calculator 0.9.2
Low Resolution Modeline Calculator is a modeline calculator for legacy CRT displays. more>>
Low Resolution Modeline Calculator is a modeline calculator for legacy CRT displays, including TVs, arcade monitors, and VGA monitors.
Low Resolution Modeline Calculator can also be used to calculate low resolution modelines for modern multisync PC monitors.
As its name implies, it is not designed for calculating large resolutions, resolutions that operate over 65kHz.
Options:
-v, --vsync
Calculate the nearest mode in vertical synchronization.
-b, --bestscan
Calculate the nearest best scan mode.
-i, --interlace
Include support for interlaced calculations. Interlaced modes are not supported by many video cards. You should only enable this option if you know your video card supports them.
-d, --doublescan
Include support for doublescanned calculations. Doublescanned modes are not supported by many video cards. You should only enable this option if you know your video card supports them.
-n, --nostretch
Do not stretch modes that are out of range for your monitor. You should use this option if you know that your application does not support integer stretching.
-y, --ystretch
Assume fractional stretching of the y-resolution. You should use this option if you know that your application supports fractional stretching of the y-resolution and you want to stretch an underscanned mode so that it fills the entire screen.
-l, --lowpclock
Many video cards do not reliably support pixel clocks lower than 8mHz. If you know that your video card and its driver support pixel clocks lower than 8mHz, then you should use this option.
-h, --highpclock
Most X11 video card drivers do not support pixel clocks lower than 12mHz. In some cases your video card may not support pixel clocks lower than 12mHz either (rare). If you know that your video card (or your video card driver) does not support pixel clocks lower than 12mHz, then you should use this option.
-3x4
Stretch the horizontal resolution so that the mode has a 3:4 aspect ratio. You can use this option to correctly display vertical resolutions on a horizontal monitor.
-x, --X11R6
Print modeline in X11 format (default).
-f, --fb
Print modeline in fbset format.
-a, --advmame
Print modeline in AdvanceMAME format.
-s, --SDL
Print modeline in X11 format to stdout and print AdvanceMAME X11 configuration to stderr.
-p, --powerstrip
Print modeline in PowerStrip format.
-pal
Calculate modelines for a PAL Television (15.625kHz).
-ntsc
Calculate modelines for a NTSC Television (15.73426kHz).
-cga
Calculate modelines for a standard resolution arcade monitor (15.7500kHz).
-ega
Calculate modelines for a medium resolution arcade monitor (24.960kHz).
-vga
Calculate modelines for a standard VGA monitor (31.500kHz).
-d9200
Calculate modelines for a Wells-Gardner 9200 arcade monitor (15kHz, 25kHz, 31kHz).
-multi
Calculate modelines for a Multisync PC monitor (default)
Enhancements:
- The --reference option works correctly.
- The DOS version compiles with libxml.
<<lessLow Resolution Modeline Calculator can also be used to calculate low resolution modelines for modern multisync PC monitors.
As its name implies, it is not designed for calculating large resolutions, resolutions that operate over 65kHz.
Options:
-v, --vsync
Calculate the nearest mode in vertical synchronization.
-b, --bestscan
Calculate the nearest best scan mode.
-i, --interlace
Include support for interlaced calculations. Interlaced modes are not supported by many video cards. You should only enable this option if you know your video card supports them.
-d, --doublescan
Include support for doublescanned calculations. Doublescanned modes are not supported by many video cards. You should only enable this option if you know your video card supports them.
-n, --nostretch
Do not stretch modes that are out of range for your monitor. You should use this option if you know that your application does not support integer stretching.
-y, --ystretch
Assume fractional stretching of the y-resolution. You should use this option if you know that your application supports fractional stretching of the y-resolution and you want to stretch an underscanned mode so that it fills the entire screen.
-l, --lowpclock
Many video cards do not reliably support pixel clocks lower than 8mHz. If you know that your video card and its driver support pixel clocks lower than 8mHz, then you should use this option.
-h, --highpclock
Most X11 video card drivers do not support pixel clocks lower than 12mHz. In some cases your video card may not support pixel clocks lower than 12mHz either (rare). If you know that your video card (or your video card driver) does not support pixel clocks lower than 12mHz, then you should use this option.
-3x4
Stretch the horizontal resolution so that the mode has a 3:4 aspect ratio. You can use this option to correctly display vertical resolutions on a horizontal monitor.
-x, --X11R6
Print modeline in X11 format (default).
-f, --fb
Print modeline in fbset format.
-a, --advmame
Print modeline in AdvanceMAME format.
-s, --SDL
Print modeline in X11 format to stdout and print AdvanceMAME X11 configuration to stderr.
-p, --powerstrip
Print modeline in PowerStrip format.
-pal
Calculate modelines for a PAL Television (15.625kHz).
-ntsc
Calculate modelines for a NTSC Television (15.73426kHz).
-cga
Calculate modelines for a standard resolution arcade monitor (15.7500kHz).
-ega
Calculate modelines for a medium resolution arcade monitor (24.960kHz).
-vga
Calculate modelines for a standard VGA monitor (31.500kHz).
-d9200
Calculate modelines for a Wells-Gardner 9200 arcade monitor (15kHz, 25kHz, 31kHz).
-multi
Calculate modelines for a Multisync PC monitor (default)
Enhancements:
- The --reference option works correctly.
- The DOS version compiles with libxml.
Download (0.30MB)
Added: 2006-01-01 License: GPL (GNU General Public License) Price:
1395 downloads
gquilt 0.20
quilt is a tool for managing a series of patches by keeping track of the changes each patch makes. more>>
quilt project is a tool for managing a series of patches by keeping track of the changes each patch makes.
Patches can be applied, un-applied, refreshed, etc. gquilt is a PyGTK GUI wrapper for quilt.
Main features:
- Currently, point and click interfaces are only provided for a small (frequently used) sub set of quilts commands:
- an Open menu item in the Playground that allows the root directory for the quilt playground to be selected,
- tool bar buttons that execute common operations on the top applied patch, and
- pop up menus (triggered by the right mouse button) over the playground files tree, patch files tree and patch series list that execute common operations such as adding files to the top patch, etc.
- To compensate for the incomplete coverage of quilts command set a text entry widget is provided in the tool bar where arbitrary quilt commands may be executed. All quilt commands initiated by the user (either by point and click or the provided entry widget) are echoed (with a time stamp) to the console widget at the bottom of the main window as is the resulting output from the quilt command. To enable easy distinction between stdout and stderr output the former is printed in black and the latter in red.
Enhancements:
Add new functionality to the patch list panel:
- (where possible) "files" now displays files in unapplied patches;
- (where possible) "diff" now displays diffs for unapplied patches;
- (where possible) "diff" allows unapplied diffs to be edited and saved;
- new item "duplicate" can be used to import a duplicate of a selected unapplied patch;
- it the interdiff program from patchutils is available an "interdiff" of the top patch and a selected unapplied patch can be imported.
This new functionality is intended to facilitate the splittin of patches into a numbe of smaller patches.
<<lessPatches can be applied, un-applied, refreshed, etc. gquilt is a PyGTK GUI wrapper for quilt.
Main features:
- Currently, point and click interfaces are only provided for a small (frequently used) sub set of quilts commands:
- an Open menu item in the Playground that allows the root directory for the quilt playground to be selected,
- tool bar buttons that execute common operations on the top applied patch, and
- pop up menus (triggered by the right mouse button) over the playground files tree, patch files tree and patch series list that execute common operations such as adding files to the top patch, etc.
- To compensate for the incomplete coverage of quilts command set a text entry widget is provided in the tool bar where arbitrary quilt commands may be executed. All quilt commands initiated by the user (either by point and click or the provided entry widget) are echoed (with a time stamp) to the console widget at the bottom of the main window as is the resulting output from the quilt command. To enable easy distinction between stdout and stderr output the former is printed in black and the latter in red.
Enhancements:
Add new functionality to the patch list panel:
- (where possible) "files" now displays files in unapplied patches;
- (where possible) "diff" now displays diffs for unapplied patches;
- (where possible) "diff" allows unapplied diffs to be edited and saved;
- new item "duplicate" can be used to import a duplicate of a selected unapplied patch;
- it the interdiff program from patchutils is available an "interdiff" of the top patch and a selected unapplied patch can be imported.
This new functionality is intended to facilitate the splittin of patches into a numbe of smaller patches.
Download (0.046MB)
Added: 2007-03-05 License: GPL (GNU General Public License) Price:
963 downloads
Text::NSP::Measures::2D::Fisher2::right 1.03
Text::NSP::Measures::2D::Fisher2::right is a Perl module implementation of the right sided Fishers exact test. more>>
Text::NSP::Measures::2D::Fisher2::right is a Perl module implementation of the right sided Fishers exact test.
SYNOPSIS
Basic Usage
use Text::NSP::Measures::2D::Fisher2::right;
my $npp = 60; my $n1p = 20; my $np1 = 20; my $n11 = 10;
$right_value = calculateStatistic( n11=>$n11,
n1p=>$n1p,
np1=>$np1,
npp=>$npp);
if( ($errorCode = getErrorCode()))
{
print STDERR $errorCode." - ".getErrorMessage();
}
else
{
print getStatisticName."value for bigram is ".$right_value;
}
<<lessSYNOPSIS
Basic Usage
use Text::NSP::Measures::2D::Fisher2::right;
my $npp = 60; my $n1p = 20; my $np1 = 20; my $n11 = 10;
$right_value = calculateStatistic( n11=>$n11,
n1p=>$n1p,
np1=>$np1,
npp=>$npp);
if( ($errorCode = getErrorCode()))
{
print STDERR $errorCode." - ".getErrorMessage();
}
else
{
print getStatisticName."value for bigram is ".$right_value;
}
Download (0.93MB)
Added: 2007-03-13 License: Perl Artistic License Price:
955 downloads
bytetraf 1.0
bytetraf is a small tool for monitoring traffic to and from your machine. more>>
bytetraf project is a small tool for monitoring traffic to and from your machine.
The following information is printed to stdout at a specified time interval: time, interface, bytes received, bytes transfered, and rate.
<<lessThe following information is printed to stdout at a specified time interval: time, interface, bytes received, bytes transfered, and rate.
Download (0.004MB)
Added: 2006-08-17 License: GPL (GNU General Public License) Price:
1164 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above stdout stderr search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed