diff options
Diffstat (limited to 'tests/CMakeLists.txt')
| -rwxr-xr-x | tests/CMakeLists.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100755 index 0000000..a457b14 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,41 @@ +set (TestDataDir "${CMAKE_SOURCE_DIR}/tests") + +add_without_config_test (NoOperation "" 1) +add_normal_test (IdentifyMcu "ident" 0) +# Frequency option format. Budeme testovat len format, ostatne nemame +# ako automaticky, pretoze sa to testuje len pri nahravani firmwaru. +add_normal_test (FrequencyFormat1 "ident -f a" 2) +add_normal_test (FrequencyFormat2 "ident -f 2a" 2) +add_normal_test (FrequencyFormat3 "ident -f 2-2" 2) +add_normal_test (FrequencyFormat4 "ident -f 22" 0) +add_normal_test (FrequencyFormat5 "ident -f 22.2" 0) +add_normal_test (FrequencyFormat6 "ident -f 2a2,2" 2) +add_normal_test (FrequencyFormat7 "ident -f 2a2.2" 2) +add_normal_test (FrequencyFormat8 "ident -f -33" 2) +add_normal_test (FrequencyFormat9 "ident -f 0" 2) + +add_normal_test (UnknownOperation "XUnknownOperationX" 2) +add_write_test (MissingInputFile "" 2 "" "") +add_read_test (MissingOutputFile "" 2 "") +add_erase_test (UnknownEraseOption "-?" 2 "" "") +add_read_test (UnknownReadOption "-? read.bin" 2 "") +add_write_test (UnknownWriteOption "-? write.bin" 2 "" "") +add_erase_test (MissingValueForOption1 "-p" 2 "" "") +add_erase_test (MissingValueForOption2 "-s" 2 "" "") +add_erase_test (MissingValueForOption3 "-b" 2 "" "") +add_read_test (ReadOptionFormat "-n -1" 2 "") +add_normal_test (ReadMultipleOutputFilenames "read read.bin read2.bin" 2) +add_normal_test (WriteMultipleInputFilenames "write random.bin random2.bin" 2) +add_read_test (NonExistentSerialPort "-p XNonExistentSerialPortNameX" 7 "read.bin") +add_write_test (CanNotOpenInputFile "" 3 "" "XNonExistentInputFileX") + +# Try to open directory instead of unreadable file +add_normal_test (CanNotOpenOutputFile "read -n 1 SerialPort" 3) +add_erase_test (EraseOptionFormat1 "-b a" 2 "" "") +add_erase_test (EraseOptionFormat2 "-b 1.2" 2 "" "") +add_erase_test (EraseOptionFormat3 "-b 1,a" 2 "" "") +add_erase_test (EraseOptionFormat4 "-b ,1,2" 2 "" "") +add_erase_test (EraseOptionFormat5 "-b 1,2," 2 "" "") +add_erase_test (EraseOptionFormat6 "-b 1,,2" 2 "" "") +add_erase_test (EraseOptionFormat7 "-b -1,2,4,5,-1654" 6 "" "") +add_erase_test (EraseOptionFormat8 "-b 1a" 2 "" "") |
