Commit Graph

4617 Commits

Author SHA1 Message Date
Maxim Biro
2e4cae692e
Use our own logging facility to log toxcore's logs 2018-08-30 22:44:18 +00:00
cotox
deb82006e5
Feature bootstrap trace/debug log output
Don't know why codes with macro dosen't work.
As it's only a few expensive, just code it without macro for now.

\#if (MIN_LOGGER_LEVEL == LOG_TRACE) || (MIN_LOGGER_LEVEL == LOG_DEBUG)
    fprintf(stderr, "[%s] %s:%d(%s) %s\n", strlevel, file, line, func, message);
\#endif
2018-08-30 22:44:18 +00:00
iphydf
36f0caaf07
Simplify configure.ac for faster autotools build.
* Remove ability to disable logging.
* Remove unused `NCURSES_FOUND`.
* Remove checks for stdbool and existence of int types.
  These mostly exist, and if they don't, we'll just fail to compile.
* Remove checks for various functions.
* Add check for `explicit_bzero` and `memset_s`.
2018-08-30 22:15:04 +00:00
iphydf
730e4cfe82
Remove the use of CLOCK_MONOTONIC_RAW.
The raw clock isn't subject to NTP adjustments. It may run less
accurately than the regular monotonic clock. I see no reason why raw
would be better for tox than the normal one.

This avoids one piece of OS-specific ifdef'd code.
2018-08-30 21:57:35 +00:00
iphydf
a5cd4764aa
Clean up add_to_list function a bit.
Can't trivially get rid of recursion here, since it's a non-linear
recursive function.
2018-08-30 21:33:15 +00:00
iphydf
515196dfa2
Include necessary opencv2 header on OSX.
opencv2 is deprecated and homebrew ships with opencv3 now.
2018-08-30 21:11:17 +00:00
Robin Lindén
18117581bd
Release 0.2.7 2018-08-30 22:43:11 +02:00
zugz (tox)
66ab386d6f
try ipv6 connections even after udp timeout
Also adds a test (auto_reconnect_test) which fails without this change.
2018-08-27 22:27:01 +02:00
iphydf
0075374f2b
Make ip_is_lan return bool instead of 0/-1.
This inverts the truthiness of the return value. Previously, 0 meant
`true` and -1 meant `false`. Now, `true` (1) means `true` and `false` (0)
means `false`.
2018-08-27 12:54:46 +00:00
Maxim Biro
25a477a7e4
Enable FreeBSD Travis-CI build 2018-08-27 05:05:10 -04:00
Maxim Biro
53c1989eba
Fix FreeBSD VM on Travis not shutting down 2018-08-27 01:50:47 -04:00
iphydf
9a70a2c185
Use bool in place of 0/1 int values. 2018-08-26 20:58:37 +00:00
iphydf
5352f48301
Make the tsan build fail instead of swallowing its errors.
We'll make it non-required, but we want to know about these failures so
we are incentivised to fix them.
2018-08-26 20:23:27 +00:00
zugz (tox)
01e2cc55cb
Add support for setting a custom monotonic time function in mono_time 2018-08-26 22:05:37 +02:00
iphydf
acc19a202f
Format crypto_core.c.
Changes:
* 100 columns maximum (not strict, can be a bit more sometimes).
* No space after cast.
2018-08-26 19:15:44 +00:00
iphydf
473cde24d8
Update copyright to 2018. 2018-08-26 18:57:29 +00:00
iphydf
368e7e37bc
Fix test class name for mono_time_test.
Was: Util, should be: MonoTime.
2018-08-26 18:18:47 +00:00
iphydf
a1035cf814
Add some tests for ping_array.
No timeout test here yet, because we don't yet have the ability to
manipulate time at will, so we would have to actually sleep.
2018-08-26 17:32:19 +00:00
iphydf
64ddb7fff2
Call abort instead of exit on test failure.
This raises a signal, so we can more easily catch it with gdb.
2018-08-26 13:18:43 +00:00
iphydf
80f8458146
Run save_compatibility_test in the autotools build. 2018-08-25 23:25:15 +00:00
iphydf
17e8195a8f
Fix the PORT_ALLOC failure of save_compatibility_test.
`tox_new_log` has a much larger range of ports it can select from.
2018-08-25 22:28:38 +00:00
iphydf
e99c13120f
Change while-loop to for-loop to express for-each-frame.
* Assignments can't be used as expressions, therefore `while` loops
  should not be used as a `for-each` construct. Use `for`, instead.
2018-08-25 20:39:24 +00:00
zugz (tox)
d380c41131
fix leave callback calling in del_groupchat 2018-08-25 15:39:31 +00:00
iphydf
94b06818fb
Use do-while instead of while in tests.
This forces all the loop bodies to be executed at least once, which is
harmless since it just means one more tox event loop iteration. This
reduces the jitter we see in coverage measurements, which is partially
caused by loops sometimes being entered and sometimes not (because their
condition happens to randomly already be true).
2018-08-25 15:25:33 +00:00
iphydf
0935aab927
Run all tests (and compilation) in parallel with autotools.
With distcheck, it's all or nothing, so we build with -j50 and run tests
with -j50.
2018-08-25 14:16:30 +00:00
iphydf
853a2a10b1
Stop using massive macros in toxav_basic_test.
Turned a huge macro into a function. Macros are a pain to debug.
2018-08-25 13:46:47 +00:00
zugz (tox)
efcda6c319
Fix auto_tests Makefile
* specify correct source files
* add save_compatibility_test (commented out for now)
* reformat TESTS to one line per test, and set check_PROGRAMS := TESTS
* add run_auto_test.h to EXTRA_DIST
* Fix `AUTO_TEST_CFLAGS` -> `AUTOTEST_CFLAGS`.
2018-08-25 14:30:04 +02:00
iphydf
ff342a5ba6
Force storing the result of crypto_memcmp in the test.
So we don't accidentally elide the call given that it's a pure function
and its result isn't used.
2018-08-23 22:26:46 +00:00
iphydf
2730c95699
Install the DHT_bootstrap binary on make install.
We didn't install it before, only `tox-bootstrapd`.
2018-08-23 21:33:54 +00:00
endoffile78
76f4ae64b7
Add check to make sure tox was created successfully 2018-08-22 10:12:46 +00:00
zugz (tox)
21b178396a
consistently use 'mono_time' rather than 'monotime' 2018-08-21 23:11:39 +02:00
iphydf
46b48f06ed
Always print output on failure in cmake tests on Travis.
Not only the second time it fails.
2018-08-21 17:52:56 +00:00
iphydf
2b73b6298b
Run project tests like yamllint_test.
We check that:
* The license is GPLv3.
* .travis.yml conforms with the toktok style specification.
* There exists a README.md file.
2018-08-21 17:31:22 +00:00
iphydf
74e685b497
Enable color diagnostics on circleci.
See https://github.com/ninja-build/ninja/issues/814
2018-08-21 17:12:22 +00:00
zugz (tox)
8e0aea1add
handle libsodium dependency of misc_tools correctly for autotools 2018-08-20 22:36:15 +02:00
iphydf
7aa57afeba
Avoid redefining macros from different files. 2018-08-19 23:15:01 +00:00
iphydf
0e7cc197f4
Upload coverage to codecov as well as coveralls. 2018-08-19 22:37:05 +00:00
iphydf
0fa700b55b
Make the save_compatibility_test work with bazel. 2018-08-19 22:08:02 +00:00
zugz (tox)
14484c6879
make Mono_Time an argument to current_time_monotonic 2018-08-19 23:41:43 +02:00
iphydf
e32e0b3402
Run both asan and tsan on Circle CI. 2018-08-19 12:05:28 +00:00
iphydf
248902ffd4
Fix const cast in save-generator. 2018-08-19 11:51:00 +00:00
endoffile78
30960dcc7e
Add save file generator, save compatibility test, and generate a save file 2018-08-19 10:38:51 +00:00
iphydf
fc7a5dc4d8
Enable .travis.yml check and use non-markdown license. 2018-08-18 22:29:31 +00:00
iphydf
9fb87056bc
Set _POSIX_C_SOURCE to 200112L. We need it for C99 compat.
It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application
using c99.  The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b,
and POSIX.1c applications. Likewise, it is invalid to compile an XPG6
or a POSIX.1-2001 application with anything other than a c99 or later
compiler.  Therefore, Solaris libc forces an error in both cases.
2018-08-17 22:43:24 +00:00
iphydf
d6d305feeb
Use per-instance Mono_Time for Messenger and onion. 2018-08-16 21:01:43 +00:00
iphydf
54066f338f
Reduce the number of times unix_time_update is called.
Reduced by, e.g.:
* `file_transfer_test`: 33% of the `clock_gettime` calls.
* `tox_many_test`: 53% of the `clock_gettime` calls.

Other tests will see similar improvements. Real world applications will
be closer to 40-50% improvement, since tox_many_test has 100 nodes, while
file_transfer_test has 2 nodes.
2018-08-16 21:01:38 +00:00
Robin Lindén
31ea1aa06e
Release 0.2.6 2018-08-16 22:45:33 +02:00
iphydf
c0db255425
Limit the size of a save file in file_saving_test.
Limited to 4GiB. That ought to be enough for any save file.
2018-08-16 10:15:01 +00:00
Leonid Bobrov
006b4f4e5c
Prune long long warnings. 2018-08-16 09:57:37 +00:00
crypto-universe
3036cc1f23
Fix possible resource leaks in test 2018-08-15 22:50:24 +00:00