X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=HACKING;h=9d2f4ff506e5716993edd41b248935bbc9147283;hb=adf51f404bb1b243a386f2e71884eab18cf8e9bf;hp=773f187ee4e037735e91fdf1474eebba74051d8f;hpb=88f7fbebef60f0d8e5ebae8579cd249be6331ea3;p=bup.git diff --git a/HACKING b/HACKING index 773f187..9d2f4ff 100644 --- a/HACKING +++ b/HACKING @@ -60,24 +60,34 @@ We also love a good "Tested-by:" -- the more the merrier. Testing ======= -You can run the test suite much more quickly via "make -j test" (as -compared to "make test"), at the expense of slightly more confusing -output (interleaved parallel test output), and inaccurate intermediate -success/failure counts, but the final counts displayed should be -correct. +Individual tests can be run via -Individual non-Python tests can be run via "./wvtest run test/TEST" and -if you'd like to see all of the test output, you can omit the wvtest -run wrapper: "test/TEST" + ./pytest TEST -Individual Python tests can be run via "./wvtest run ./wvtest.py -test/int/TEST", and as above, you can see all the output by omitting -the wvtest run wrapper like this: "./wvtest.py test/TEST" +For example: + + ./pytest test/int/test_git.py + ./pytest test/ext/test-ftp + +If you have the xdist module installed, then you can specify its `-n` +option to run the tests in parallel (e.g. `./pytest -nauto ...`), or +you can specify `-j` to make, which will be translated to xdist with +`-j` becoming `-nauto` and `-jN` becoming `-nN`. Internal tests that test bup's code directly are located in test/int, and external tests that test bup from the outside, typically by running the executable, are located in test/ext. +Currently, all pytests must be located in either test/ext or test/int. +Internal test filenames must match test_*.py, and external tests must +be located in text/ext and their filenames must match test-* (see +test/ext/conftest.py for the handling of the latter). Any paths +matching those criteria will be automatically collected by pytest. + +Some aspects of the environment are automatically restored after each +test via fixtures in conftest.py, including the state of the +environment variables and the working directory; the latter is reset +to the top of the source tree. Submitting patches ==================