trying and failing to add a new test  [SOLVED]

Documentation, Web site and code modifications

Moderators: baguetl, routerov

Locked
User avatar
jzwanzig
Posts: 504
Joined: Mon Aug 17, 2009 9:25 am

trying and failing to add a new test

Post by jzwanzig » Wed Jun 04, 2014 6:50 pm

Hi,

I'm trying to add a new test (t70.in in v7) but the system doesn't find it. I've added t70.in to tests/v7/Input, added t70.out to tests/v7/Refs, and added a line to __init__.py in the tests/v7 directory. But running the following:

../../tests/runtests.py v7[70]

from the tests subdirectory of my build subdirectory gives the following output:

FortranCompiler: gfortran None
test_suite is empty. No test fulfills the requirements specified by the user!
Test_suite directory already exists! Old files will be removed
Running ntests = 0, MPI_nprocs = 1, py_nthreads = 1...
/home/jzwanzig/code/abinit/7.8/7.8.0-private/tests/pymods/testsuite.py:2962: UserWarning: len(self) == 0
warn("len(self) == 0")
Test suite results in HTML format are available in Test_suite/suite_report.html


any suggestions?

thanks,
Joe
Josef W. Zwanziger
Professor, Department of Chemistry
Canada Research Chair in NMR Studies of Materials
Dalhousie University
Halifax, NS B3H 4J3 Canada
jzwanzig@gmail.com

User avatar
jzwanzig
Posts: 504
Joined: Mon Aug 17, 2009 9:25 am

Re: trying and failing to add a new test  [SOLVED]

Post by jzwanzig » Thu Jun 05, 2014 3:05 pm

OK, I figured out my problem--when adding a new test it is necessary also to do

../../tests/runtests.py --regenerate

to re-make the database. The instructions do say this but it is buried at the bottom as an "additional note". It would be better to make it step 6 of the instruction list.

Also, I found that the --regenerate option also causes *all* the tests to be executed, in addition to just re-building the database. I think it would be better if this option only re-built the database but didn't actually run any tests. (For example, if you have compiled with all optimizations off, for debugging, and you trigger all the tests with a single thread, you're in for a long wait). Matteo, comments?

thanks,
Joe
Josef W. Zwanziger
Professor, Department of Chemistry
Canada Research Chair in NMR Studies of Materials
Dalhousie University
Halifax, NS B3H 4J3 Canada
jzwanzig@gmail.com

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: trying and failing to add a new test

Post by gmatteo » Tue Jun 17, 2014 1:14 am

Hi Joe,

By default the script runs the entire test suite if not argument is provided. This is handy because otherwise one should
specify some kind of option e.g. `runtests.py --all` or an argument e.g. `runtests.py all` to run all the tests.
This is indeed a possible solution but on the other hand I've already taken into the case in which one wants to regenerate the pickle
database and then run only a subset of tests. Use

1) runtests v1[1] --regenerate

to regenerate the database and run v[1])

or

2) runtests --regenerate --dry-run (or -d)

to bypass the execution of the tests

TIP: In the new version I've added several new handy options

A) -m#num_make_threads

to recompile the code before running the tests, e.g runtests.py v3 -k GW -m4 --regenerate -j2 -n2

B) runtests.py v3[30] --gdb

to run the test under the control of the gnu debugger. You can also try to debug a MPI run (-n2 --gdb)
but there are cases in which this trick may not work

Best,
Matteo

Locked