Download Sage Developer`s Guide
Transcript
Sage Developer’s Guide, Release 6.9 2 of 8 in __main__.example_14 ***Test Failed*** 6 failures. For whitespace errors, see the file /home/jdemeyer/.sage//tmp/.doctest_sudoku.py [21.1 s] ---------------------------------------------------------------------The following tests failed: sage -t "src/sage/games/sudoku.py" Total time for all tests: 21.3 seconds In this case, we received an error because the system-wide Sage installation is a different (older) version than the one we are using for Sage development. Make sure you always test the files with the correct version of Sage. Parallel Testing Many Modules So far we have used a single thread to doctest a module in the Sage library. There are hundreds, even thousands of modules in the Sage library. Testing them all using one thread would take a few hours. Depending on our hardware, this could take up to six hours or more. On a multi-core system, parallel doctesting can significantly reduce the testing time. Unless we also want to use our computer while doctesting in parallel, we can choose to devote all the cores of our system for parallel testing. Let us doctest all modules in a directory, first using a single thread and then using four threads. For this example, suppose we want to test all the modules under sage/crypto/. We can use a syntax similar to that shown above to achieve this: [jdemeyer@sage sage-6.0]$ ./sage -t src/sage/crypto Running doctests with ID 2012-07-03-03-45-40-7f837dcf. Doctesting 24 files. sage -t src/sage/crypto/__init__.py [0 tests, 0.0 s] sage -t src/sage/crypto/all.py [0 tests, 0.0 s] sage -t src/sage/crypto/boolean_function.pyx [252 tests, 4.4 s] sage -t src/sage/crypto/cipher.py [10 tests, 0.0 s] sage -t src/sage/crypto/classical.py [718 tests, 11.3 s] sage -t src/sage/crypto/classical_cipher.py [130 tests, 0.5 s] sage -t src/sage/crypto/cryptosystem.py [82 tests, 0.1 s] sage -t src/sage/crypto/lattice.py [1 tests, 0.0 s] sage -t src/sage/crypto/lfsr.py [31 tests, 0.1 s] sage -t src/sage/crypto/stream.py [17 tests, 0.1 s] sage -t src/sage/crypto/stream_cipher.py [114 tests, 0.2 s] sage -t src/sage/crypto/util.py [122 tests, 0.2 s] sage -t src/sage/crypto/block_cipher/__init__.py [0 tests, 0.0 s] sage -t src/sage/crypto/block_cipher/all.py 3.3. Running Sage’s tests 59