1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
Commit graph

44 commits

Author SHA1 Message Date
Jason Rhinelander
0839c16f19 Final abseil purge
Bye-bye Google Boost.
2020-02-24 14:27:44 -04:00
Jason Rhinelander
561bfe24c0 Add cmake "check" target to run all tests
Renames the cmake Catch2 test target to "catch" (instead of "check") and
adds a "rungtest" for gtest (because the "gtest" target is already taken
by the gtest library itself), and then repurposes the "check" target to
run both test suite binaries.

Also updates the top-level Makefile to do the same thing, except that
there the gtest target is just "gtest" instead of "rungtest".
2020-02-24 14:27:44 -04:00
Jason Rhinelander
98c34d995b De-abseil: Add our own llarp::TrimWhiteSpace
Adds a TrimWhiteSpace instead of using abseil's.

Adds Catch2 tests for it, and also converts the existing str tests to
catch (which look much, much nicer than the gtest ones).
2020-02-24 14:27:44 -04:00
Jason Rhinelander
fe61367a87 Vastly simplified llarp::util::memFn
There is a huge pile of unnecessary machinery here that can be solved
with a few lambdas and some member function pointer type deduction.
2020-02-21 23:24:33 -04:00
Jason Rhinelander
b4440094b0 De-abseil, part 2: mutex, locks, (most) time
- util::Mutex is now a std::shared_timed_mutex, which is capable of
  exclusive and shared locks.

- util::Lock is still present as a std::lock_guard<util::Mutex>.

- the locking annotations are preserved, but updated to the latest
  supported by clang rather than using abseil's older/deprecated ones.

- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
  locks anymore (WTF abseil).

- ReleasableLock is gone.  Instead there are now some llarp::util helper
  methods to obtain unique and/or shared locks:
    - `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
      unlockable object (std::unique_lock<T>, with T inferred from
      `mutex`).
    - `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
      "reader") lock of the mutex.
    - `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
      used to atomically lock multiple mutexes at once (returning a
      tuple of the locks).
  This are templated on the mutex which makes them a bit more flexible
  than using a concrete type: they can be used for any type of lockable
  mutex, not only util::Mutex.  (Some of the code here uses them for
  getting locks around a std::mutex).  Until C++17, using the RAII types
  is painfully verbose:

  ```C++
  // pre-C++17 - needing to figure out the mutex type here is annoying:
  std::unique_lock<util::Mutex> lock(mutex);
  // pre-C++17 and even more verbose (but at least the type isn't needed):
  std::unique_lock<decltype(mutex)> lock(mutex);
  // our compromise:
  auto lock = util::unique_lock(mutex);
  // C++17:
  std::unique_lock lock(mutex);
  ```

  All of these functions will also warn (under gcc or clang) if you
  discard the return value.  You can also do fancy things like
  `auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
  lock take over an already-locked mutex).

- metrics code is gone, which also removes a big pile of code that was
  only used by metrics:
  - llarp::util::Scheduler
  - llarp:🧵:TimerQueue
  - llarp::util::Stopwatch
2020-02-21 23:22:47 -04:00
Jeff Becker
827ca0bda7
make catch2 a submodule 2020-02-17 08:26:20 -05:00
Stephen Shelton
7842889fef Add NodeDB tests around FindClosestTo() 2020-02-14 17:45:22 -04:00
Jeff Becker
e35d17764a * add path::Path::UniqueEndpointSet_t
* start using check2 for new unit tests
* unit test for path::Path::UniqueEndpointSet_t
2020-02-14 17:41:31 -04:00
Jeff
186dba45cb
Merge pull request #956 from notlesh/km-testing
Implement KeyManager tests
2020-02-13 14:04:42 -05:00
Stephen Shelton
f0571a9f2c
Fix IsCompatableWith() logic WRT emptyRouterVersion, add unit tests 2020-01-31 13:23:48 -07:00
Jeff Becker
8d11519eb2
unit tests for logging levels 2020-01-21 13:21:11 -05:00
Jeff Becker
562f3f07ab
add unit test for decaying hash set 2019-12-30 15:52:10 -05:00
Jeff Becker
fcf0ae2b9e
prune unused files. 2019-12-15 07:02:17 -05:00
Stephen Shelton
332f33b049 Remove FS_LIB conditionals 2019-12-12 12:58:46 -07:00
Stephen Shelton
c99ab0c9b7 Fix build 2019-12-09 14:35:38 -07:00
Stephen Shelton
ef075a53dd Implement KeyManager tests 2019-12-09 12:29:33 -07:00
Jeff Becker
ac686a9329
remove valgrind access errors 2019-11-22 16:23:20 -05:00
Michael
edd0ec398f
Move thread stuff to subdirectory 2019-09-03 20:52:28 +01:00
Michael
0950571313
Move metrics to subdirectory 2019-09-03 20:52:28 +01:00
Michael
4d8fe2a8a8
Move meta programming to subdirectory 2019-09-03 20:52:28 +01:00
Michael
5da5c77104
Delete ev loop tests 2019-07-21 16:57:12 +01:00
Michael
f310160065
Fixup and add tests 2019-07-06 14:46:25 +01:00
Michael
a2326efa37
Revert "Merge pull request #679 from tewinget/revert-config-refactor"
This reverts commit 2996a7f29c, reversing
changes made to 10df3bd4b3.
2019-07-06 14:46:25 +01:00
Thomas Winget
d044d60101 Reverts #678 #677 and #669 with hashes:
10df3bd
766ece8
979f095

See those commits for further details
2019-07-02 11:02:20 -04:00
Michael
8c2d67f8f1
Fix tests 2019-07-02 10:06:29 +01:00
Michael
bd78471dae
Move ini parser as well 2019-07-02 01:58:38 +01:00
Jeff Becker
32d73199e6
another fix for freebsd 2019-06-10 12:42:29 -04:00
Michael
3822fe2341
Create util::MemFn and memFn to make binding callbacks easier 2019-06-02 22:19:10 +01:00
Michael
19802229ac
Update cmake to point to vendor dir 2019-05-29 23:18:47 +01:00
Michael
a62655d501
Move tests to use top-level LlarpTest 2019-05-28 20:45:09 +01:00
Rick V
7788d6ec3c
fix windows
lto stuff remains for now
since native builds work

(cherry picked from commit 37814472af5e7c35d514bae16d19b08050765d52)

i'm not porting the UNIX-tier cppfs thing

(cherry picked from commit d6edbd789534d4fd0bce6c8c2418347cd80bebdb)

none of this had to be specified directly ffs

(cherry picked from commit 5dbefa7131a6fe0b2006c90ecdba7e466fdd1ecc)

stop breaking shit reee

(cherry picked from commit 14be89902ccc75a7fc21863593da393ca976d0d4)
2019-05-05 23:01:51 -05:00
michael-loki
0195152e05 Allow builds on MSVC (#518)
* Import cxxopts to replace getopts usage

* Add visual studio build things

* Fixup abseil build parts

* Replace __attribute__((unused)) with ABSL_ATTRIBUTE_UNUSED

* Fixup minor windows build issues

* Replace getopts usage

* Temporarily fixup .rc files

* More minor windows fixes

* Get a working build

* Revert .rc files

* Revert changes to nodedb
2019-04-19 13:24:33 -05:00
Michael
3b5d49e0f8 MetricTank metric collector 2019-04-14 17:18:32 +01:00
Michael
544c5f9b61 Move metrics publishers to their own directory 2019-04-14 17:18:32 +01:00
Jeff Becker
ac69213dd7
unit tests for llarp_ev_pkt_pipe 2019-04-08 10:04:58 -04:00
Michael
f2c5d32399
Metric collection subsystem 2019-03-25 20:36:23 +00:00
Michael
acfff4ca5c
Threading structures for metrics 2019-03-25 20:36:23 +00:00
Jeff Becker
990049f423
make rpc do basic auth and shit like that 2019-03-13 16:01:10 -04:00
Michael
e6e19369e9
Create Printer - A general-purpose, stateful printer class 2019-02-24 23:46:44 +00:00
Michael
95a5c386fe
Initial type trait work 2019-02-24 23:46:44 +00:00
Michael
4132f883a7
Make libabyss mandatory 2019-02-20 22:08:49 +00:00
Michael
656843e9a3
Fix issues on debian 2019-02-12 01:19:38 +00:00
Michael
342cdaddd0
Add support for gtest_add_tests 2019-02-12 01:19:38 +00:00
Michael
1aeacb0043
Refactor CMakeLists into distinct directories 2019-02-12 01:19:37 +00:00