Commit Graph

256 Commits

Author SHA1 Message Date
iphydf
c8697ccc20
Move load_state and its helper functions to their own module. 2018-07-09 20:36:39 +00:00
iphydf
3c1025d2dc
Factor out the actual test code from conference_test.
Also, renamed simple_conference_test to conference_simple_test so it's
sorted together with the other conference tests.

Next step is to use run_auto_test.h for the conference test.
2018-07-07 10:35:35 +00:00
iphydf
9d5c55b4b3
Add a test that reproduces the NULL peer nick bug. 2018-07-06 11:14:44 +00:00
iphydf
3ef1f839fc
Add some tests for our ring_buffer implementation.
These can serve as documentation until we write actual api docs, probably
using apidsl.
2018-07-04 10:37:46 +00:00
iphydf
1a54be06cd
Simplify Travis CI builds.
Have one script per build. This means more duplication between the
scripts, but it's much easier to understand and to run locally.
2018-07-01 08:35:44 +00:00
iphydf
706fad1ce8
Add a test to try and overflow the send queue in net_crypto. 2018-06-29 23:24:20 +00:00
iphydf
b9a75d98b2
Remove broken conference tests.
These display some idea, but the tests are not implemented correctly. We
will need to implement the idea correctly later, but for now we can't use
these.
2018-06-29 18:25:44 +00:00
Robin Lindén
ae7899cab8
Release v0.2.3 2018-06-25 23:49:52 +02:00
iphydf
d22332dd50
Remove the format test.
It's annoying to have a test touch every source file. It causes a
recompile of everything after every test run.
2018-06-25 19:48:11 +00:00
iphydf
29b2dd6315
Use clang-format for C++ code.
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
2018-06-24 20:17:53 +00:00
iphydf
5c2600d87b
Add new Circle CI configuration.
This one has ASAN enabled, unlike Travis.
2018-06-24 19:51:34 +00:00
iphydf
5a8790eab0
Add a test for double conference invite.
In Persistent Group Chats (PGC), this will cause a use-after-free. This
test ensures that we fix this bug before merging PGC.
2018-06-24 01:09:46 +00:00
iphydf
cfff361679
Add random testing program.
This can be used as a random stress test for toxcore.
Adjust the weights to make certain actions more or less likely.
2018-06-23 12:43:09 +00:00
iphydf
a48e0c4d18
Add tests for what happens when passing an invalid proxy host.
Related: https://github.com/qTox/qTox/issues/5174
2018-06-23 12:34:33 +00:00
iphydf
2296d07e09
Add test for creating multiple conferences in one tox.
This triggers a code path in Persistent Group Chats that causes a memory
leak. I'm adding this test now, so that we don't merge PGC without fixing
the memory leak first.
2018-06-19 21:00:26 +00:00
iphydf
3a85d88fb1
Remove resource_leak_test.
This test has never caught a bug. It's better to catch these with asan or
the likes.
2018-06-18 19:25:30 +00:00
iphydf
90e1d969ac
Fix linking with address sanitizer.
`-fsanitize=address` also needs to be passed to the linker.
2018-06-18 19:19:31 +00:00
iphydf
cf9caa069a
In DEBUG mode, make toxcore crash on signed integer overflow.
Signed overflow is undefined behaviour, so in debug mode, we want to make
it fail in a noisy way.
2018-06-08 23:48:40 +00:00
endoffile78
91f65354a2
Make toxcore compile on BSD 2018-05-10 17:56:15 +02:00
Robin Lindén
2824daf74a
Release v0.2.2 2018-04-18 00:13:16 +02:00
Braiden Vasco
09478f9957
CMake warn if libconfig not found 2018-04-06 15:51:20 +00:00
hqwrong
eb6b602095
fix build error on macos 2018-03-22 17:35:44 +08:00
iphydf
9706d9a0f0
Disallow stderr logger by default. 2018-03-17 15:04:03 +00:00
iphydf
ea7ecd6d32
Add COVERAGE cmake flag for clang.
This only works with clang/llvm. Coveralls support needs to be added later.
2018-03-17 14:32:57 +00:00
iphydf
23e9f01f1c
Update version to 0.2.1. 2018-03-09 20:40:28 +00:00
iphydf
d3b286cb43
Fix a bunch of compiler warnings and remove suppressions. 2018-02-24 22:20:22 +00:00
iphydf
b2a2a0bbc7
Link all tests to the android cpufeatures library if available.
This is needed for libvpx to work on android.

This also means that we can upload our test binaries to an android device
and actually run them, now that libcheck is no longer a blocker.
2018-02-23 01:05:00 +00:00
iphydf
c8359c843b
Fix toxcore.pc generation.
It's missing vpx and opus at the moment.
2018-02-22 17:34:39 +00:00
iphydf
d7471482d1
Add an option that allows us to specify that we require toxav. 2018-02-22 13:56:55 +00:00
iphydf
ee53d96447
Fix the windows build: pthread needs to be linked after vpx. 2018-02-21 01:13:39 +00:00
iphydf
c4a734e304
Remove apidsl from the build.
apidsl is in feature freeze. We can rely on the web service, instead.
2018-02-19 21:00:19 +00:00
iphydf
3dc8cf6df8
Disable lan discovery in most tests. 2018-02-18 21:32:28 +00:00
Robin Lindén
c3515c49e0
Split up tox_test into multiple smaller tests 2018-02-18 14:50:18 +00:00
iphydf
13706de14b
Don't build all the small sub-libraries.
This caused us to build everything 2-4 times, now we only build it 1-2
times (depending on selection of static/shared builds). The disadvantage
is that now it's more up to the reviewer to ensure modularity (we still
catch it in the bazel build, though).
2018-02-18 14:11:03 +00:00
zoff99
82662d4e16
Make outgoing Filetransfers round-robin.
Instead of 1 FT blocking all others.
2018-02-17 16:32:25 +00:00
iphydf
c09917c6a7
Optionally use newer cmake features.
So we can keep supporting cmake 2.8.12, which is the version on ubuntu
trusty.
2018-02-12 10:56:10 +00:00
iphydf
2e74db5447
Improve gtest finding, support local checkout.
Also fix library dependency order for monolith test.
2018-02-11 12:20:36 +00:00
iphydf
6cd4fcdec4
Remove libcheck from the dependencies.
We're not gaining much from this library, and it's a burden, especially
for windows development.
2018-02-09 20:51:39 +00:00
iphydf
05912fd65c
Add gtest include directory to -I flags if found.
Otherwise it won't be found when cross-compiling.
2018-02-09 20:36:54 +00:00
iphydf
8a0e98bab8
Fix LAN discovery on FreeBSD.
Also, add an auto-test for bootstrap and for LAN discovery.

Bootstrap is never tested otherwise, and LAN discovery is a prerequisite
for everything else. Having these two tests lets us rule out or identify
LAN discovery as a possible cause for test failures.
2018-02-08 14:57:34 +00:00
iphydf
36ba80aacb
Remove csrc from the RTPHeader struct.
This is not used by anything in the code, so we shouldn't have it in the
header.
2018-02-08 13:20:40 +00:00
iphydf
3fcc9a3c83
Add some unit tests for util.h. 2018-02-08 12:54:39 +00:00
iphydf
dcd439a5c3
Make cmake script more forgiving.
Instead of hard-erroring when we don't find dependencies, we just don't
build the things requested and print a warning. This is less annoying to
users because we enable a bunch of things by default. This way, we can at
least build something with the default "cmake" invocation.
2018-02-06 20:22:33 +00:00
iphydf
835b9fbdc9
Improve stability of crypto_memcmp test.
Also reduce number of people in conference to 5, because on Circle CI the
test times out trying to connect more than 6 or 7 people. The persistent
conferences PR will improve this so we can set it much higher then.
2018-02-06 20:21:27 +00:00
iphydf
52f6e4e7c5
Move tox_shell program to the toxins repository.
https://github.com/TokTok/toxins/tree/master/tox_shell
2018-02-06 13:06:22 +00:00
iphydf
a3a0e553f3
Move irc_syncbot to the toxins repository. 2018-02-06 11:45:50 +00:00
iphydf
f71ec8dd02
Move the tox_sync tool to the toxins repository. 2018-02-05 18:15:31 +00:00
iphydf
92ffad1a72
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
2018-01-30 23:35:50 +00:00
iphydf
6f6c4dc2bd
Add -D__STDC_LIMIT_MACROS=1 for C++ code.
Without this, `UINT*_MAX` are not defined.
2018-01-29 22:14:21 +00:00
Maxim Biro
c9ed0ae8cd Show source file name and line number on crash 2018-01-25 17:27:26 -05:00
Maxim Biro
5ef37e0b63 Prefix add_test() with $CROSSCOMPILING_EMULATOR
$CMAKE_CROSSCOMPILING_EMULATOR is automatically prefixing add_test()
in CMake versions starting 3.3[1], but because we target CMake 2.8, we
can't use that and we have to add our own $CROSSCOMPILING_EMULATOR that
will prefix add_test().

[1] https://cmake.org/cmake/help/v3.3/variable/CMAKE_CROSSCOMPILING_EMULATOR.html#variable:CMAKE_CROSSCOMPILING_EMULATOR
2018-01-25 15:57:50 -05:00
iphydf
8f1bbcf83e
Use <stdlib.h> for alloca on FreeBSD.
https://www.freebsd.org/cgi/man.cgi?alloca

If stdlib.h does not define alloca, and we're using GCC (or Clang), we
define the macro ourselves in terms of a GCC builtin.
2018-01-22 21:05:30 +00:00
iphydf
033965b8cc
Make the monolith test a C++ binary.
This way, developers compile toxcore, toxav, and toxencryptsave as C++ at
least once at home, reducing the likelyhood of running into travis
failures where we compile as C++ in the windows build.
2018-01-21 20:56:30 +00:00
iphydf
d7583a719a
Remove nTox from the repo.
It's a maintenance burden nobody uses. Let's make toxic the official
console client, instead.
2018-01-20 19:05:53 +00:00
iphydf
7c2e4dd403
Add a simple conference test with 3 friends.
This tests that a message from tox1 is relayed via tox2 to tox3 when tox1
and tox3 are not friends.
2018-01-20 12:22:52 +00:00
iphydf
0b13936ce8
Use apidsl to generate LAN_discovery.h. 2018-01-16 14:17:05 +00:00
iphydf
cec5fea71b
Remove hstox test for now.
This isn't adding value. We're going to redo the whole rpc test framework
in the future, after a lot of refactoring that the hstox test currently
just stands in the way of.
2018-01-15 11:29:51 +00:00
Smoked Cheese
402664f58d
update rpm spec and use variables in cmake instead of hardcoded paths (#624) 2018-01-15 14:23:33 +03:00
iphydf
d79b15c52d
Use apidsl to generate ping.h.
The ping.api.h file looks rather ugly, but it works. This is an exercise
in finding the complete set of use cases needed from apidsl for toxcore.
We'll try to make things work as much as possible, and then make apidsl
better and make the .api.h files pretty.
2018-01-14 19:30:05 +00:00
iphydf
e775b5533b
Make Ping_Array a module-private type. 2018-01-13 23:55:08 +00:00
iphydf
d6047692a5
Bump toxcore version to 0.2.0.
We're not releasing yet, but projects preparing for the release will want
to build against this version in master.
2018-01-08 19:36:00 +00:00
iphydf
c09c3b6078
Add support for building the monolith test on android. 2018-01-06 23:37:51 +00:00
iphydf
2c8fb05f6e Remove deprecated ToxDNS
Based on #331.

Fixes #42.
2017-12-29 00:32:18 +00:00
iphydf
f2b6090eca Generate only one large library "libtoxcore".
This library contains all the code for the old libtoxcore, libtoxav,
libtoxdns, and libtoxencryptsave. The build for toxav is still optional,
and disabling it causes libtoxcore to simply not contain those symbols
and the pkg-config file to not include opus and vpx as dependencies.
2017-12-28 23:01:41 +00:00
Robin Lindén
fc0cc08b21
Release v0.1.11 2017-12-26 17:46:13 +01:00
Diadlo
b39cc55d37
Add support of IPv6 disabling 2017-11-15 15:22:19 +03:00
Diadlo
7077662e32
Replace include(CTest) on enable_testing()
CTest include generate a lot of unused targets
2017-09-14 08:31:40 +03:00
Maxim Biro
8dc261fcf2 Disable compiler thread safety analysis 2017-08-22 04:10:45 -04:00
Robin Lindén
6295d28a1e
Release v0.1.10 2017-08-06 12:22:48 +02:00
Maxim Biro
1b290c0d84 Fix Windows build 2017-06-09 23:18:43 -04:00
Robin Lindén
a429ef4a28
Release v0.1.9 2017-06-06 22:50:57 +02:00
iphydf
cb69b8a986
Build tests on appveyor, the MSVC build.
Tests are not actually ran on appveyor for now, since they all fault for
some reason. For now, we just build them. Also, some tests are disabled
on msvc entirely, because they don't even compile. We'll need to look
into those, later. They are disabled using `MSVC_DONT_BUILD`.
2017-06-05 13:45:20 +00:00
pranomostro
7f5b057b05
Add test for changing the conference title and not receiving a callback. 2017-06-05 12:50:58 +00:00
Maxim Biro
b0aec02225 Split daemon's logging backends in separate modules 2017-06-04 16:07:03 -04:00
iphydf
1e8fa85aad
Add a monolith_test that includes all toxcore sources.
This requires that every symbol, even if static (file-scope), is unique.
The idea is that we can easily run "whole" program static analysis on
programs that include monolith.h ("whole" is in quotes, as we don't
include dependencies like libsodium in this static analysis).
2017-06-04 17:48:23 +00:00
pranomostro
03f99bde2e
Test for memberlist not changing after changing own name.
This test shows that the conference members callback is not invoked when
the own name changes.
2017-06-04 13:40:44 +00:00
iphydf
41850deb43
Factor out strict_abi cmake code into a separate module. 2017-06-04 12:20:35 +00:00
iphydf
b782ef5d8e
Fix formatting and spelling in version-sync script.
Also some minor reformatting and fixes to the hstox sut driver.
2017-06-04 12:07:43 +00:00
iphydf
cda770cfe1
Forbid undefined symbols in shared libraries.
Also a little bit of refactoring:
- Moved add_cflag and friends from CMakeLists.txt to a separate
  AddCompilerFlag module.
- Build the spectest SUT if msgpack is found, even if spectest itself is
  not found, so once it exists, users can run it themselves or
  reconfigure cmake.
2017-06-04 10:08:51 +00:00
iphydf
d4be41a3ad
Use new encoding of Maybe in msgpack results.
The new encoding is `0` for `Nothing` and `[1, x]` for `Just x`.
2017-06-03 23:32:46 +00:00
Robin Lindén
f6db9333e2
Release v0.1.8 2017-04-27 20:20:19 +02:00
Maxim Biro
c25e3d2d7c Revert "initial version of tox_loop"
This reverts commit 200ee1cace.
2017-04-22 15:31:25 -04:00
Maxim Biro
c7f63737eb Revert "Implement tox_loop"
This reverts commit 5ff099763b.
2017-04-22 15:31:25 -04:00
Ansa89
5ff099763b
Implement tox_loop 2017-04-01 17:47:34 +02:00
michael bishop
200ee1cace
initial version of tox_loop 2017-04-01 17:47:34 +02:00
Carsten Brandt
d4414ffa3a
CMake: install bootstrapd if it is built
if bootstrapd option is enabled the binary should be
installed on `make install`.
2017-03-26 20:17:09 +02:00
Robin Lindén
48c86e942d
Release v0.1.7 2017-03-26 15:42:48 +02:00
Carsten Brandt
a1f9df48d6
make BUILD_TOXAV and option and fail if dependencies are missing
fixes #482
2017-03-25 17:22:16 +01:00
Maxim Biro
def92ab029 Add test for tox_strncasecmp() 2017-03-01 20:43:30 -05:00
Maxim Biro
61c3b47bef Disable -Wdisabled-macro-expansion
Due to clang's tolower() macro being recursive.
2017-03-01 20:43:30 -05:00
Diadlo
1387c8f150
Remove network dependency from toxcrypto 2017-02-26 23:19:24 +03:00
iphydf
6ae33c16cf
Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
iphydf
895de7ef26
Release v0.1.6. 2017-01-26 23:31:27 +00:00
iphydf
ce0bf232d1
Add appveyor build for native windows tests.
It doesn't compile, yet. A few changes (like VLA support) need to be made
before we can enable appveyor as a required PR check.
2017-01-22 11:56:02 +00:00
iphydf
995578f103
Release v0.1.5. 2017-01-19 18:26:48 +00:00
Carsten Brandt
86e67f805a decouple version-sync script from cmake 2017-01-18 11:20:07 +01:00
Carsten Brandt
3520eee05d SO versions for cmake and libtool
this updates the version-sync script to generate proper SO versions
which will be used by cmake and libtool to create version symlinks
on the system when a library is installed as well as setting the SO
version in the binary.

To see what this does, you have to configure tox with a prefix:

    ./configure --prefix=/tmp/tox-with-libtool
    mkdir cbuild && cd cbuild && cmake -DCMAKE_INSTALL_PREFIX=/tmp/tox-with-cmake ..

Then run `make && make install`.

in both instances you should see the following installed in `lib/`:

    libtoxcore.so -> libtoxcore.so.1.4.0
    libtoxcore.so.1 -> libtoxcore.so.1.4.0
    libtoxcore.so.1.4.0

inside the binary the soname should be the one with .1 and it should not
contain the full version:

    $ objdump -p libtoxcore.so.1.4.0 | grep SONAME
      SONAME               libtoxcore.so.1
2017-01-18 11:20:07 +01:00
iphydf
5ad3c98905
Make building DHT_bootstrap in cmake optional.
It's enabled by default.
2017-01-16 22:43:41 +00:00
iphydf
27a97a8280
Release v0.1.4. 2017-01-12 15:48:39 +00:00
iphydf
8b4eae4038
Remove TOX_DEBUG and have asserts always enabled.
These are cheap asserts. I've also replaced the fprintf's with
`LOGGER_ERROR` calls.
2017-01-11 19:43:08 +00:00