Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Tree [05fd08] branch-5_25 version-5_25_1 / tests /
History



File Date Author Commit
wester_problems 2007-06-04 robert_dodier robert_dodier [ed863b] Commit test scripts written by Michael Wester, ...
.gitignore 2011-04-20 Andrej Vodopivec Andrej Vodopivec [fda809] renamed .cvsignore to .gitignore
Makefile.am 2011-07-31 crategus crategus [cf6b2f] Adding the test file rtest_power.mac
README.how-to 2007-05-29 willisbl willisbl [001fa4] update to README.how-to
mcond_display_elseif.mac 2005-07-28 robert_dodier robert_dodier [d89c99] Modify display code so that if -- then -- elsei...
mcond_display_elseif.out 2005-07-28 robert_dodier robert_dodier [d89c99] Modify display code so that if -- then -- elsei...
rexamples.mac 2007-11-14 robert_dodier robert_dodier [a46b1c] Change name of quotient operator from "//" to "/".
rtest1.mac 2010-06-03 robert_dodier robert_dodier [c661c5] Let prederror=true in sort, so that the sort pr...
rtest10.mac 2007-12-09 dgildea dgildea [8b4ae6] src/simp.lisp:
rtest11.mac 2011-03-27 robert_dodier robert_dodier [1d0650] Fix bug reported on mailing list 2011-03-25:
rtest12.mac 2007-05-23 willisbl willisbl [649507] make tests less dependent on ratsimp and evalua...
rtest13.mac 2010-10-12 crategus crategus [b332ce] Cutting out one example. It is moved to the fil...
rtest13s.mac 2007-05-23 willisbl willisbl [649507] make tests less dependent on ratsimp and evalua...
rtest14.mac 2010-03-27 crategus crategus [d31f5a] Updating examples in
rtest15.mac 2010-10-02 crategus crategus [485e0c] Updating an example to be more correct.
rtest16.mac 2011-07-03 crategus crategus [87e88b] Adding tests related to the bug report ID: 2905...
rtest1a.mac 2007-05-15 willisbl willisbl [734dcb] o Make tests less dependent on ratsimp and eval...
rtest2.mac 2010-06-20 robert_dodier robert_dodier [4161ae] SF bug # 3014545 "submatrix does not work as ex...
rtest3.mac 2009-08-13 robert_dodier robert_dodier [d433b0] Ensure that bigfloat literal is read with known...
rtest4.mac 2008-06-02 dgildea dgildea [c7f90e] src/nrat4.lisp:
rtest5.mac 2010-04-27 crategus crategus [61554e] Adding two examples from Bug report ID: 947808 ...
rtest6.mac 2004-11-14 amundson amundson [0b0bdd] Tests, demos and eigen.mac downcased. All tests...
rtest6a.mac 2009-11-01 crategus crategus [e01df6] Cutting out two tests for the function specint,...
rtest6b.mac 2007-05-15 willisbl willisbl [ca68de] o Make tests less dependent on ratsimp and eval...
rtest7.mac 2008-07-12 willisbl willisbl [e906d5] append regression test for SF bug 2014436
rtest8.mac 2010-10-06 rtoy rtoy [0c4941] Be careful about binding $numer to T when deali...
rtest9.mac 2010-02-20 crategus crategus [a37f2b] Updating two examples which work after revision...
rtest9a.mac 2009-06-23 crategus crategus [470fcd] Modifying the results of 11 examplesd because o...
rtest_abs.mac 2010-10-06 willisbl willisbl [232d3e] o change simpabs to use simpcheck instead of si...
rtest_algebraic.mac 2008-07-05 willisbl willisbl [76a33d] append new rtest file: rtest_algebraic, modify ...
rtest_allnummod.mac 2010-10-10 crategus crategus [2289e8] Because of revision 1.15 of maxmin.lisp:
rtest_ask.mac 2009-10-17 billingd billingd [3d5a66] Bug 2876387: ode2 asks if sqrt(3) is an integer
rtest_boolean.mac 2008-01-21 robert_dodier robert_dodier [9203d7] Throw in a couple of tests for SF bug [ 1726148...
rtest_carg.mac 2010-08-22 crategus crategus [7aa150] Adding a testfile for the function carg.
rtest_diff_invtrig.mac 2006-02-21 robert_dodier robert_dodier [6568bb] Modified rtest_trig.mac to collect some express...
rtest_dot.mac 2007-08-09 rtoy rtoy [cd640b] src/float.lisp:
rtest_elliptic.mac 2011-03-15 rtoy rtoy [9efcf9] Fix bug in elliptic_pi(n,phi,0) for n < 1.
rtest_equal.mac 2009-09-29 willisbl willisbl [6c6bb0] o additional tests for rtest_equal (SF bug 2869...
rtest_everysome.mac 2006-02-21 robert_dodier robert_dodier [6568bb] Modified rtest_trig.mac to collect some express...
rtest_expintegral.mac 2009-12-14 rtoy rtoy [251012] Bug 2909980: optimization for log of bfloats
rtest_gamma.mac 2011-05-01 crategus crategus [02a3a9] Adding tests for the limit of Error functions.
rtest_hypgeo.mac 2010-09-28 willisbl willisbl [9b3cb7] o chages for updated simpabs
rtest_integrate.mac 2011-07-31 crategus crategus [7d62e1] Updating examples ind some test files because o...
rtest_integrate_special.mac 2011-07-31 crategus crategus [7d62e1] Updating examples ind some test files because o...
rtest_lambert_w.mac 2010-09-25 rtoy rtoy [9a487b] Threshold is too tight on problem 15 for abcl t...
rtest_lapack.mac 2007-01-12 rtoy rtoy [f28dcc] Test script for LAPACK.
rtest_log.mac 2011-07-28 crategus crategus [e1022a] Adding a test file for the log function.
rtest_map.mac 2007-05-20 willisbl willisbl [7d4135] append rtest_map & modify Makefile.am and tests...
rtest_mset.mac 2011-03-19 robert_dodier robert_dodier [081dbf] Update test case to accommodate different behav...
rtest_plot.mac 2011-06-05 robert_dodier robert_dodier [9033e8] Example to test plot3d message change in commit...
rtest_power.mac 2011-07-31 crategus crategus [3f8df8] New test file rtest_power.mac
rtest_round.mac 2008-01-10 willisbl willisbl [93e7ae] Append regression tests for SF bug 1867942.
rtest_rules.mac 2008-03-23 robert_dodier robert_dodier [251765] Fix bug which prevented a pattern similar to p*...
rtest_scalarp.mac 2007-05-29 macrakis macrakis [6af9d1] Correct test 18 -- must have committed wrong ve...
rtest_sign.mac 2010-09-11 crategus crategus [0e69f6] Adding some more examples related to revision 1...
rtest_signum.mac 2010-10-06 willisbl willisbl [232d3e] o change simpabs to use simpcheck instead of si...
rtest_sqrt.mac 2011-07-31 crategus crategus [7d62e1] Updating examples ind some test files because o...
rtest_taylor.mac 2010-05-30 crategus crategus [d907ee] Adding examples related to the bug reports:
rtest_tex.mac 2008-07-23 robert_dodier robert_dodier [63a836] Process plus or minus argument in tex-ification...
rtest_translator.mac 2010-07-31 robert_dodier robert_dodier [cb3606] Various changes in translator to resolve SF bug...
rtest_trig.mac 2010-10-02 dgildea dgildea [50c0aa] src/trigi.lisp:
rtest_zeta.mac 2010-02-06 crategus crategus [4991ce] Updating some examples and adding examples for ...
rtestconjugate.mac 2009-10-26 crategus crategus [93c7b9] Adding an example for conjugate(atan2(y,x))
rtesthyp.mac 2010-03-27 crategus crategus [d31f5a] Updating examples in
rtestifactor.mac 2008-09-13 andrejv andrejv [e7e439] Test for ifactors(1).
rtestint.mac 2011-07-22 Dan Gildea Dan Gildea [70d548] src/defint.lisp:
rtestlabels.mac 2007-10-15 robert_dodier robert_dodier [d0cbaf] Call stringp instead of ?mstringp, now that Max...
rtestmcond_display.mac 2007-06-05 robert_dodier robert_dodier [85b796] Replace tabs embedded in strings with spaces
rtestmt19937.mac 2005-03-13 robert_dodier robert_dodier [32276c] MT19937 random number generator, adapted from C...
rtestnset.mac 2011-07-06 Barton Willis Barton Willis [743e88] o new n-ary kron_delta function
rtestode.mac 2011-01-01 crategus crategus [1d88ce] Adjusting one example because of revision 1.125...
rtestode_zp.mac 2005-04-04 amundson amundson [23c774] kill(allbut(props)) -> kill(all)
rtestparser_continuations_cr.mac 2005-11-10 robert_dodier robert_dodier [5fee8d] Changes to make backslash a line continuation c...
rtestparser_continuations_crnl.mac 2005-11-10 robert_dodier robert_dodier [5fee8d] Changes to make backslash a line continuation c...
rtestparser_continuations_nl.mac 2005-11-10 robert_dodier robert_dodier [5fee8d] Changes to make backslash a line continuation c...
rtestsum.mac 2010-03-20 crategus crategus [cddd0a] Correcting a typo. It is revision 1.43 and not ...
testsuite.lisp 2011-07-31 crategus crategus [746758] Including a new test file rtest_power.mac and s...

Read Me

Suggestions and tips for writing test files
Barton Willis

(1) test file contains pairs of expressions. The first
expression is the input, and the second is the expected output; for
example, here are two tests:

x + 0;
x$

x - x;
0$

You may terminate each line with either a semicolon or a dollar
sign. To keep the file somewhat organized, terminate the input line
with a semicolon and the expected output with a dollar sign. It's helpful to
separate each input / expected output pair with a blank line.

(2) Name your file "rtest_<a word that describes its contents>.mac".
For example, "rtest_abs.mac" is a good name for tests for the absolute 
value function.

(3) If the input is something that doesn't need to be checked, make a
compound statement with the last statement being 0. Thus

(assume(x > 0), 0);
0$

abs(x);
x$

(4) If a test needs to use a non-default value for an option variable, try to
make the change local instead of global. For example

is (x < 1), prederror : false;
unknown$

Doing so keeps your test from modifying the global environment.

(5) The first line of the test file should be 

(kill(all),0);
0$

(6) From a Maxima input prompt, use the 'batch' function to run your test:

     (%i1) batch("rtest_abs.mac", 'test);
     Error log on #<output stream rtest_abs.ERR>

You may need to give Maxima a full pathname to the file. After the
test finishes, you can look at the .ERR file to see which tests
failed.

(7) If your test defines functions, makes assumptions, or assigns
values to symbols, the last few lines of your test should clean up the
global environment; thus if your test does assume(x > 0), assigns a
value to 'a', and defines a function 'f', the last line of your test
should be something like

(forget(x > 0), remvalue(a), remfunction(f),0);
0$

(8) To append a test file to the main Maxima test suite,
you'll need to append the file name to the list in the file
/tests/testsuite.lisp. If your test has known errors, you'll need to
include this data into testsuite.lisp. To illustrate, the tests
42 and 42 in rtest_abs are known bugs. To tell Maxima that these
are known bugs, append ((mlist) "rtest_abs" 42 43) to the file 
list in testsuite.lisp.

Also, you'll need to append the name of the test file to
makefile.am. Finally, build Maxima and run the test suite. If all goes
well, commit the new test file.

(9) Other:

(a) Check that your test runs multiple times without error. After
appending a new test to Maxima's test suite, make sure that run_testsuite() 
runs multiple times without error.

(b) Always test the simple cases: abs(0), abs(0.0), abs(0.0b0), ... Also,
check that functions work correctly for CRE expressions, arguments that
contain '%i', empty lists, empty matrices, ... Thus always test
the 'boundary' cases; these are things like max(), min(), apply("*",[]), ....

(c) Check the sourceforge bug list for all reported bugs for the functions(s)
you are testing. Include tests for these bugs; also put a comment in your
test file that references the bug report:

/*  See SF Bug #  771061 */

expand((vt . a^^(-1) . u+1)^^(-2));
((vt.a^^(-1).u)^^2+2*(vt.a^^(-1).u)+1)^^(-1)$

If a bug causes a fatal error, you'll need to exclude it from your test
(or better, include it, but comment it out).

(d) It might be easier to place all known failures at the top of the
file. With this policy, you can append new tests without updating the
list of known failures in testsuite.lisp.

(e) If a test checks a not so well known identity, include a reference to the
identity:

/* A&S 13.6.1 */
hgfred([v+1/2],[2*v+1],2*%i*z);
4^(v/2)*bessel_j(v,z)*gamma(v+1)*exp(%i*z)/z^v$

(f) Maxima evaluates the input, but only simplifies the expected output. Thus
a test such as

  makelist(sin(k * %pi),k,1,5);
  makelist(0,k,1,5)$

will fail. You'll need to write the test as either 

  makelist(sin(k * %pi),k,1,5);
  ''(makelist(0,k,1,5))$

or 

  makelist(sin(k * %pi),k,1,5);
  [0,0,0,0,0]$

To get a test to pass,you may need to insert a few parenthesis in the 
expected output; for example

  -a/2;
  -(a/2)$

Another way to handle such things is to use explicit calls to ratsimp:

  ratsimp(-a/2);
  ''(ratsimp(-a/2))$

To test a function such as factor, you do not want to apply ratsimp.