common/util.cc: add unit test, fix bug in util::read_file (#21251)

* add test case for util

* fix bug in read_file

* gitignore test_util

* better test

* referer

* more

* more test

* REQUIRE size

* apply reviews

* only test binary

* simplify the test

* read  non-permission

* debug print

* remove /etc/shadow

* test read directory

* Update selfdrive/common/tests/test_util.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: a873a23e0dbfe43027911acdd270610048eed74a
This commit is contained in:
Dean Lee
2021-06-16 17:01:13 +08:00
committed by GitHub
parent d8ac1df789
commit 6bfc7f4ca5
5 changed files with 56 additions and 2 deletions

View File

@@ -208,6 +208,7 @@ jobs:
$UNIT_TEST selfdrive/athena && \
$UNIT_TEST selfdrive/thermald && \
$UNIT_TEST tools/lib/tests && \
./selfdrive/common/tests/test_util && \
./selfdrive/camerad/test/ae_gray_test"
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash) -v -F unit_tests