mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-04 07:24:20 +01:00
* wip based on early draft. todo benchmarking * fixup eraser, assume keys are unique * fix cursor copy, test removal at random * small benchmark via permutations. todo lambdas and novirtual * fix empty condition / reset * overwrite optimizations, fix move offsets overflows * ...erase using 0xff instead of 0 * test the theory with code, different length kv were bugged * try to check for out-of-bounds writes / reads * style * trying to fix mover again * clarify length, defend against reading len on edge * fix uncommited rewind change * prove space assumptions * more concise traces, fix move condition (agrh!!!) * slightly more internal knowledge (estimates API?) * make sure cursor is only valid within the range * ensure 0 does not blow things * go back up * cursor comments * comments * rewrite writes through cursor * in del too * estimate kv storage requirements, return available size * move raw erase / move into a method, allow ::set to avoid scanning storage twice * refactor naming, use in code * amend storage slicing test * fix crash handler offsets, cleanup configuration * start -> begin * eeprom readiness * dependencies * unused * SPI_FLASH constants for older Core * vtables -> templates * less include dependencies * gcov help, move estimate outside of the class * writer position can never match, use begin + offset * tweak save_crash to trigger only once in a serious crash * doh, header function should be inline * foreach api, tweak structs for public api * use test helper class * when not using foreach, move cursor reset closer to the loop using read_kv * coverage comments, fix typo in tests decltype * ensure set() does not break with offset * make codacy happy again
40 lines
1.2 KiB
INI
40 lines
1.2 KiB
INI
# This file is used compile and run tests located in the `unit` directory.
|
|
# For more info, see:
|
|
# https://docs.platformio.org/en/latest/plus/unit-testing.html
|
|
# https://github.com/ThrowTheSwitch/Unity
|
|
# https://github.com/ThrowTheSwitch/Unity/blob/master/docs/UnityAssertionsReference.md
|
|
|
|
[platformio]
|
|
test_dir = unit
|
|
src_dir = ../espurna
|
|
|
|
# TODO: add `-t coverage` via python scripting?
|
|
# TODO: do we need `-O0`?
|
|
|
|
# To prepare coverage data for lcov, add ${coverage.build_flags} to env:test build flags
|
|
# To actually generate coverage report:
|
|
# $ `pio test` / run the test `program` manually
|
|
# $ lcov --include (readlink -f ../espurna)'/*' --capture --directory .pio/build/test/ --output-file test.info
|
|
# $ genhtml --ignore-errors source test.info --output-directory out
|
|
|
|
[coverage]
|
|
build_flags = -lgcov -fprofile-arcs -ftest-coverage
|
|
|
|
[env:test]
|
|
platform = native
|
|
lib_compat_mode = off
|
|
test_build_project_src = true
|
|
src_filter =
|
|
+<../espurna/terminal_commands.cpp>
|
|
+<../espurna/terminal_parsing.cpp>
|
|
lib_deps =
|
|
StreamString
|
|
https://github.com/bxparks/UnixHostDuino#d740398e
|
|
build_flags =
|
|
-DMANUFACTURER="PLATFORMIO"
|
|
-DDEVICE="TEST"
|
|
-std=gnu++11
|
|
-g
|
|
-Os
|
|
-I../espurna/
|