Skip to content

Latest commit

 

History

History

RegresssionTests

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

P2-FLASH-FS / Regresssion Tests

Project Maintenance

License

These are regression test files that I'm using to certify the FS operation with each release. All tests must pass! The regression test programs are versioned here so you can repeat this testing any time to verify your driver operation.

The point of these tests is to exercise each method attempting to check both normal and error/exception cases.

Test Coverage

The Regression test coverage is nearly complete! This table indicates which methods have been test by the current regression test programs.

Public Method tested Notes
PUB version() : result YES
PUB serial_number() : sn_hi, sn_lo YES
PUB mount() : status YES
PUB unmount() YES
PUB format() : status YES
PUB error() : result YES
PUB open(p_filename,"r") : handle YES
PUB open(p_filename,"w") : handle YES
PUB open(p_filename,"a") : handle YES
PUB open(p_filename,"r+") : handle YES
PUB open(p_filename,"w+") : handle YES
PUB open_circular(p_filename,"r") : handle YES
PUB open_circular(p_filename,"a") : handle YES
PUB flush(handle) : status YES
PUB close(handle) : status YES
PUB rename(p_old_filename, p_new_filename) : status YES
PUB delete(p_filename) : status YES
PUB create_file(p_filename, fill_value, byte_count) : status YES
PUB exists(p_filename) : result YES
PUB file_size(p_filename) : size_in_bytes YES
PUB file_size_unused(p_filename) : size_in_bytes_unused YES
PUB seek(handle, position) : result YES
PUB write(handle, p_buffer, count) : result YES
PUB wr_byte(handle, byte_value) : result YES
PUB wr_word(handle, word_value) : result YES
PUB wr_long(handle, long_value) : result YES
PUB wr_str(handle, p_str) : result YES
PUB read(handle, p_buffer, count) : bytes_read YES
PUB rd_byte(handle) : value YES
PUB rd_word(handle) : value YES
PUB rd_long(handle) : value YES
PUB rd_str(handle, p_str, count) : result YES
PUB directory(p_block_id, p_filename, p_file_size) YES
PUB stats() : used_blocks, free_blocks, file_count YES
PUB string_for_error(error_code) : p_interpretation YES

Running the tests

In order the compile the tests you need to uncomment the test-support routines in Draft_flash_fs.spin2. Look for line 1705:

Driver file: flash_fs.spin2: line 2871

{   ' REMOVE BEFORE FLIGHT: uncomment this line before release!!!

' ----------------------------------------------------------------------------------------------
'   these methods are for regression testing only - they are not used in production code

comment out the 1st line to enable the code that follows. [ place a ' before the {... ]

Determine debug output routing (RT_*.spin2 files)

At the head of each of test RT .spin2 files you want to run look for the debug output lines:

{
    ' debug via serial to RPi (using RPi gateway pins)
    DEBUG_PIN_TX = 57           ' GRY GPIO 10
    DEBUG_PIN_RX = 56           ' WHT GPIO 8 (gnd is BLK GPIO 6)
    DEBUG_WINDOWS_OFF = -1      ' no debug windows showing
    DEBUG_BAUD = 2_000_000      ' comms at 2Mbit
'}

These lines when uncommented route the debug serial to PINs 56/57 which I connect to the a Raspberry Pi for logging as there is lot of output from the test runs.

In their present for (commented out) the debug output just goes the debug window on windows where you are running the compiler.

The Test files

This is a recap of the version history of these files:

Date Status
2023-Aug-26
Initial release. RT_read_write_tests.spin2
Working Format, Mount, open(file, "R"), open(file, "W"), close(),
Focused tests for wr_byte(), rd_byte(), wr_word(), rd_word(), wr_long(), rd_long(), wr_str(), and rd_str()
Spanning blocks tests need to be added
2023-Aug-27
More Tests: RT_read_write_block_tests.spin2
Working Format, Mount, open(file, "R"), open(file, "W"), close(),
Focused tests for read(), write(), and file_size_unused(): in only block, spanning two blocks, spanning 3 blocks
2023-Aug-28
More Tests: RT_read_seek_tests.spin2
Working Format, Mount, open(file, "R"), open(file, "W"), close(),
Focused tests for seek(): in only block, spanning two blocks, spanning 3 blocks
2023-Aug-29
Updated RT_read_write_tests.spin2
Working Format, Mount, open(file, "R"), open(file, "W"), close(),
Focused tests for wr_byte(), rd_byte(), wr_word(), rd_word(), wr_long(), rd_long(), wr_str(), and rd_str()
Added tests for version(), serial_number(), directory(), and 2, 3 block span tests using longs
2023-Sep-02
More Tests RT_write_append_tests.spin2
Working Format, Mount, close(),
Focused tests for open(file, "A"), wr_byte(), rd_byte(), wr_word(), rd_word(), wr_long(), rd_long(), wr_str(), and rd_str() with additional tests for 2, 3 block span tests using longs
2023-Sep-08
More Tests RT_mount_handle_basics_tests.spin2
This tests all methods when filesystem is not mounted, when we are out of handles and when attempting to use an illegal handle
The point of this testing is to ensure that methods are returning the proper error code as documented under these conditions
2023-Sep-08
More Tests RT_read_write_circular_tests.spin2
This is the full test suite exercising the open_circular() for read and append methods. They ensure that blocks are added to and removed from the filesystem as they should be. They also ensure the reading from the circular file starts at the byte that they should be. These tests use 1KB records when id and checksum in each so that the reads can be certified to start at the exact byte they should be.
2023-Sep-12
More Tests RT_read_write_append_tests.spin2
Added testing of flush() method when used with appends.
2023-Sep-12
More Tests RT_read_write_tests.spin2
Added testing of unmount() and mount() methods
2023-Sep-13
More Tests RT_read_seek_tests.spin2
Added testing of seek()'s new "current position relative" feature
2023-Sep-19
More Tests RT_read_write_8cog_tests.spin2
Added testing of multi-cog support
2023-Dec-18
Added Tests RT_read_modify_write_tests.spin2
Added testing of read/modify/write support ("r+" and "w+" open modes)
2023-Dec-19
More Tests RT_read_write_tests.spin2
Added testing of create_file() method

Test files by Stephen

This is my work in progress as I'm working toward customer facing release of the FileSystem code

File Purpose
RT_utilities.spin2 Utility methods common to all Test Files
RT_mount_handle_basics_tests.spin2 The read/write basic types test suite
RT_mount_handle_basics_tests.log Log of the read/write basic types tests [48 passes, 0 fails]
RT_read_modify_write_tests.spin2 The read/write basic types test suite
RT_read_modify_write_tests.log Log of the read/write basic types tests [102 passes, 0 fails]
RT_read_seek_tests.spin2 The open for read seek test suite
RT_read_seek_tests.log Log of the open for read seek tests [81 passes, 0 fails]
RT_read_write_8cog_tests.spin2 The multi-cog testing suite
RT_read_write_8cog_tests.log Log of the multi-cog tests [216 passes, 0 fails]
RT_read_write_8cog_tests_byCog.log Log of the multi-cog tests - Sorted by COG [216 passes, 0 fails]
RT_read_write_block_tests.spin2 The read/write records(blocks) test suite
RT_read_write_block_tests.log Log of the read/write records(blocks) tests [39 passes, 0 fails]
RT_read_write_circular_tests.spin2 The read/write circular test suite
RT_read_write_circular_tests.log Log of the read/write circular tests [262 passes, 0 fails]
RT_read_write_tests.spin2 The read/write basic types test suite
RT_read_write_tests.log Log of the read/write basic types tests [118 passes, 0 fails]
RT_write_append_tests.spin2 The open for append test suite
RT_write_append_tests.log Log of the open for append tests [114 passes, 0 fails]

Next Steps:

  • certify life-cycle changes for blocks of files created/modified (this is visuall checked for now...)
  • ...

If you like my work and/or this has helped you in some way then feel free to help me out for a couple of ☕'s or 🍕 slices!

coffee    -OR-    PatreonPatreon.com/IronSheep


Disclaimer and Legal

Parallax, Propeller Spin, and the Parallax and Propeller Hat logos are trademarks of Parallax Inc., dba Parallax Semiconductor

This project is a community project not for commercial use.

This project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Parallax Inc., dba Parallax Semiconductor or any of its affiliates or subsidiaries.


License

Licensed under the MIT License.

Follow these links for more information: