touched up t/h-003.hawk
This commit is contained in:
parent
4079fb4047
commit
ea33f599fc
@ -495,7 +495,8 @@ function do_line( n,name,s)
|
||||
function output_filename(input_filename)
|
||||
{
|
||||
## HAWK - for use in t/h-003.hawk
|
||||
return length(OUTPUT_FILENAME) > 0? OUTPUT_FILENAME: "/dev/stdout";
|
||||
if (length(T_OUT_NAME) > 0) return T_OUT_NAME;
|
||||
## END HAWK
|
||||
|
||||
if (input_filename != _last_input_filename)
|
||||
{ # optimization: we cache last function result for speed
|
||||
|
@ -39,7 +39,7 @@ function are_files_identical(a, b)
|
||||
return !diff;
|
||||
}
|
||||
|
||||
function run_test (x, more_opts, in_name, redir, out_name)
|
||||
function run_test (x, more_opts, in_name, set_out_name, out_name)
|
||||
{
|
||||
@local cmd, inf, expf, outf, same;
|
||||
|
||||
@ -51,13 +51,13 @@ function run_test (x, more_opts, in_name, redir, out_name)
|
||||
outf = sprintf("/tmp/%s.%d.out", out_name, sys::getpid());
|
||||
##print TDIR, inf, expf, outf;
|
||||
|
||||
if (redir)
|
||||
if (set_out_name)
|
||||
{
|
||||
cmd=sprintf("%s %s -f %s/%s.hawk --modlibdirs=%s %s > %s", ARGV[0], more_opts, TDIR, x, hawk::modlibdirs(), inf, outf);
|
||||
cmd=sprintf("%s %s -vT_OUT_NAME=%s -f %s/%s.hawk --modlibdirs=%s %s", ARGV[0], more_opts, outf, TDIR, x, hawk::modlibdirs(), inf);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd=sprintf("%s %s -vOUTPUT_FILENAME=%s -f %s/%s.hawk --modlibdirs=%s %s", ARGV[0], more_opts, outf, TDIR, x, hawk::modlibdirs(), inf);
|
||||
cmd=sprintf("%s %s -f %s/%s.hawk --modlibdirs=%s %s > %s", ARGV[0], more_opts, TDIR, x, hawk::modlibdirs(), inf, outf);
|
||||
}
|
||||
##print cmd;
|
||||
system (cmd);
|
||||
@ -77,9 +77,9 @@ function run_test (x, more_opts, in_name, redir, out_name)
|
||||
|
||||
function main()
|
||||
{
|
||||
run_test ("journal-toc", "", @nil, 1, @nil);
|
||||
run_test ("journal-toc", "-vHTML=1", "journal-toc", 1, "journal-toc-html");
|
||||
run_test ("bibtex-to-html", "", "journal-toc", 0, "bibtex-to-html");
|
||||
run_test ("journal-toc", "", @nil, 0, @nil);
|
||||
run_test ("journal-toc", "-vHTML=1", "journal-toc", 0, "journal-toc-html");
|
||||
run_test ("bibtex-to-html", "", "journal-toc", 1, "bibtex-to-html");
|
||||
|
||||
tap_end ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user