Running the Run-Time Error Detection Test Suite 1) Download and untar and gunzip as necessary 2) In each of the directories C, C++ and FORTRAN, copy the appropriate CONFIGURATION.* file to CONFIGURATION. If one is not appropriate copy one that is close, and modify as needed. 3) Modify CONFIGURATION file in the case that you have additional tools (see CONFIGURATION.sun_and_bcheck). Also, the TMP variable allow you to specify a temporary space which may be faster than a subdirectory of the current working directory. ** CAUTION ** If you change the value of TMP, do not change it to RESULT or to any directory which you want to keep, as this directory is destroyed prior to running each test. 4) In any of the 3 directories C, C++ and FORTRAN, issue ./run_tests_all This will run all the tests for that language, printing a section by section summary. There are about 3000 tests, so on a slow machine (either compiling or running) these tests can take significant time.) E.g. on a SUN Ultra 10 and using the tool bcheck, the entire package takes about 3 hours to run. On a 2.8 MhZ Intel machine with 10K SCSI disks the entire suite takes about 30 minutes. 5) After running, you can cd into any section, and see which tests passed/failed in the files test_results_E, test_results_D, test_results_C, test_results_B, test_results_A. The criteria for passing at the E level is the least strict and the A level is the most strict. 6) In each section, you may type ../chk test_name where test_name is one of the tests in any of the test_results files. An example is at the end of the Readme. 7) After running, you can issue ./cleanup_all to get rid of the result files. 8) Note: Some tests in the C/C99_specific_errors will fail to compile if the C compiler does not implement features in the C99 standard. Correspondingly, some tests in FORTRAN/f95_specific_errors will fail to compile if the FORTRAN compiler does not implement FORTRAN95. The C, C++ and FORTRAN program source has the .c, .ccp and .f90 extensions, and the FORTRAN source is in free format source form. If you encounter problems with these tests, please send email to rted@iastate.edu Appendix A: ../chk example: > ../chk c_I_1_c test_results_A:c_I_1_c FAIL test_results_B:c_I_1_c FAIL test_results_C:c_I_1_c PASS test_results_D:c_I_1_c PASS test_results_E:c_I_1_c PASS Actual error message for test c_I_1_c : ------------------------------------------- Read from unallocated (rua): Attempting to read 4 bytes at address 0xffbff990 =>[1] func_2(ptr = (nil)), line 38 in "c_I_1_c_s.c" [2] main(), line 63 in "c_I_1_c.c" Read from unallocated (rua): Attempting to read 4 bytes at address 0xffbff928 =>[1] ret(), line 11 in "TEST_PARAM.H" [2] func_2(ptr = 0xffbffa50), line 47 in "c_I_1_c_s.c" [3] main(), line 63 in "c_I_1_c.c" Actual leaks report (actual leaks: 1 total size: 80 bytes) Memory Leak (mel): Found leaked block of size 80 bytes at address 0x23318 At time of allocation, the call stack was: [1] func_1() at line 48 in "c_I_1_c.c" [2] main() at line 62 in "c_I_1_c.c" Possible leaks report (possible leaks: 0 total size: 0 bytes) Blocks in use report (blocks in use: 0 total size: 0 bytes) Ideal error message for test c_I_1_c : ------------------------------------------- ERROR: memory leak A memory leak occurred due to double allocation using pointer of pointer 'ptrA'. The error occurs at line 38 column 27 in file 'c_I_1_c_s.c'. The pointer is declared in line 60 of file 'c_I_1_c.c'. The memory allocation for 'ptrA' is in line 48 of file 'c_I_1_c.c'. Appendix B: For greater flexibility: 9) To run just one or two sections for a given language, you may type ./run_tests_all section1 section2 ... This does destroy any existing test_results files, and any files in the RESULTS subdirectory. 10) If you are in a section subdirectory, you may run just a few of the tests for that section by issuing ../tools/run_tests test1 test2 ... Again, this destroys any existing test_results and RESULTS/ files. Once this is done, ../chk works only for the smaller set of tests you've just run.