diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /vo/votest/run_test.cl | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'vo/votest/run_test.cl')
-rw-r--r-- | vo/votest/run_test.cl | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vo/votest/run_test.cl b/vo/votest/run_test.cl new file mode 100644 index 00000000..1f0181f0 --- /dev/null +++ b/vo/votest/run_test.cl @@ -0,0 +1,57 @@ +#{ RUN_TEST -- Run a test script. + + +procedure run_test (name, script, output) + +string name { prompt = "Test name" } +string script { prompt = "Script to execute" } +string output { prompt = "Filename of test output" } + +bool pass = no { prompt = "Test result" } +bool cl_err = no { prompt = "CL script error?" } + +begin + string lname, lscript, lresult, loutput, lres, lout, descr + int ndiff + + + # Get parameters to local script variables. + lname = name + lscript = "tests$/" // script // ".cl" + lresult = "tests$/" // script // ".out" + loutput = output + descr = " " + + # Run the test. + votest.has_err = no + iferr { + cl ( < lscript, >& loutput ) + # print ("cl < " // lscript) |& clbye(, >& loutput) + # type (lscript) |& clbye(, >& loutput) + + } then { + printf ("\t%-50.50s\t", votest.descr) + if (votest.has_err == yes) { + pass = yes + cl_err = no + } else { + pass = no + cl_err = yes + } + + } else { + printf ("\t%-50.50s\t", votest.descr) + + lres = osfn (lresult) + lout = osfn (loutput) + diff ("-bitw", lres, lout) | count("STDIN") | scan(ndiff) + + if (ndiff == 0) { + pass = yes + } else { + pass = no + diff ("-bitw", lres, lout) + #print ("!diff -bitw " // lres // " " // lout) | cl() + } + } +end |