Extension Development Help
Adrien Guillon
aj.guillon at gmail.com
Thu Jul 8 18:25:51 UTC 2010
Hi everyone,
I'm currently writing my own extensions for QMTest to make it do
exactly what I want. I've gone over the documentation several times,
but I still might be missing something. I would like to suggest that
a diagram that shows the relationship between the database, tests, and
resources might help with understanding QMTest immensely. My
understanding of QMTest is still a bit fuzzy, so bear with me as I try
to walk through my task.
What I want to do, is have a directory of files which describe
particular test cases, much like the compilation test already does.
Each of these files is the test case, it contains almost all of the
information required for a Python function I have written to run a
test and check if it passed or failed. So I might have the file
"foobar", I can just pass it to "run_test" in my own Python module and
get True or False to say if the test passed or failed. I would like
any new files (with a specific extension) placed inside a directory
hierarchy to automatically be picked up, and used as a test case. So
far, it seems like it would be best for me to modify the compilation
test database to accomplish this task... I need a database that
indicates where the tests are, and since I'm storing them inside the
directory tree... this is the right approach, right?
The next part is a bit tricky. I want to reuse the same hierarchy of
test files for a couple different implementations of the same program
that is being tested. Nothing in the test files should change. What
I want to be able to do, is run through the entire test collection,
but testing against multiple implementations. So what I think I want
to do, is have some type of configuration file that indicates what
implementations I want to test. Suppose I want to test implementation
X, Y, and Z, and I have the test directory structure: a/b/c, a/b/d...
I would create a database that will give the test ids: X.a.b.c,
Y.a.b.c, Z.a.b.c, X.a.b.d, Y.a.b.d, Z.a.b.d right?
So my current understanding of QMTest is that I will write some class
that extends Database, which indicates what the test cases are.
QMTest will automatically go through this database, and pass each test
id (or something like that) to a MyTest object which extends Test,
along with some extra arguments (I'm a bit fuzzy on how I store those,
I think those are the fields?). Each test will have Run called, which
will declare the test a pass or fail. So I have to implement my own
Database, and my own Test classes.
Okay, if there is something that I've completely missed please point
it out. Also, if there is some much easier way, please let me know.
Thanks,
AJ
More information about the qmtest
mailing list