Commit Graph

183 Commits

Author SHA1 Message Date
Bastien Montagne
2f7237ac78 Fix broken ghash performance gtest.
Regression from rB2dba2b3d71d9781bce45. Do not understand why MSVC needs this convoluted
allocation (looks like broken compiler crap?), but at least let's do it correctly!
2016-02-16 22:22:41 +01:00
Sergey Sharybin
2dba2b3d71 Fix gtests on Windows/MSVC
There were some missing stubs and some tests were specifically
written for Linux. Also, apparently MSVC has a limit of 64K for
the insource strings..
2016-02-06 21:21:55 +05:00
Sergey Sharybin
5508cc2d63 Fix typo in 32bytes aligned malloc test 2016-02-06 16:42:19 +01:00
Sergey Sharybin
e1f5b2b4c1 Fix GTests compilations on Windows
Unfortunately this doesn't make all tests compilable due
to all sort of weird and wonderful bad levels includes
on Windows (G referenced from bf_blenlib) but at least
allows to selectively build tests for now.
2016-02-06 15:12:28 +01:00
Campbell Barton
d924998d3e Cleanup: pep8 2016-02-01 00:47:10 +11:00
Campbell Barton
dea38d78c4 GTests: were using C++11 feature 2016-01-19 20:44:57 +11:00
Campbell Barton
9b8eb41567 GTests: split array_utils tests 2016-01-19 19:55:25 +11:00
Campbell Barton
4e6ad37fc1 GTests: array_utils 2016-01-19 08:23:08 +11:00
Sergey Sharybin
0e5e407007 Correct include directories for GTests 2016-01-04 22:16:14 +05:00
Sergey Sharybin
5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Bastien Montagne
6ca6d29e6b Fix memleaks in our gtests. 2015-12-28 23:19:24 +01:00
858b680a50 Eigen: move C API into intern/eigen. 2015-12-10 01:58:06 +01:00
Campbell Barton
9964eed9ac PyAPI: add optional filter argument to KDTree.find 2015-12-06 21:35:32 +11:00
Bastien Montagne
be72df4f06 BLI_math: add mat3_polar_decompose, interp_m3_m3m3 and interp_m4_m4m4.
mat3_polar_decompose gives the right polar decomposition of given matrix,
as a pair (U, P) of matrices.

interp_m3_m3m3 uses that polar decomposition to perform a correct matrix interpolation,
even with non-uniformly scaled ones (where blend_m3_m3m3 would fail).

interp_m4_m4m4 just adds translation interpolation to the _m3 variant.
2015-10-09 21:26:33 +02:00
Campbell Barton
fc6f4c11ae Add test scripts to ctest & rename 2015-09-24 20:52:58 +10:00
Campbell Barton
0cf842a989 Update module test to pass w/o freestyle enabled 2015-09-23 03:36:32 +10:00
Campbell Barton
7615073e77 Update test to RNA API 2015-09-23 03:11:17 +10:00
Sybren A. Stüvel
8383a2d4cc Fix: Made bpy.path.ensure_ext compatible with compound extensions.
Extensions such as ".tar.gz" are now also supported. Before this patch,
ensure_ext('demo.tar.gz', '.tar.gz') would return 'demo.tar.tar.gz'.

This results in issues with the `ExportHelper` mix-in class; clicking
an existing file in the file dialogue warns about overwriting it
(highlighting the input box in red), but then saves to a different
file.

Also added a unit test for the new behaviour.

Reviewers: mont29, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1498
2015-09-03 13:09:16 +02:00
Sergey Sharybin
8031f36261 Tests: Ignore preview render script in module loading tests 2015-08-24 09:46:41 +02:00
Bastien Montagne
7837f0e833 BLI_math 'compare' cleanup & enhancements.
This commit:
* Adds a 'compare_ff' function for absolute 'almost equal' comparison of floats.
* Makes 'compare_vxvx' functions use that new 'compare_ff' one.
* Adds a 'compare_ff_relative' function for secured ulp-based relative comparison of floats.
* Adds matching 'compare_vxvx_relative' functions.
* Adds some basic tests for compare_ff_relative.

See https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

Note that we could replace our python/mathutils' EXPP_FloatsAreEqual() by BLI's compare_ff_relative
(using a very small absolute max_diff), but these do not have exact same behavior...
Left a comment there for now, we can do it later if/when we are sure it won't break anything!
2015-07-10 15:02:43 +02:00
Bastien Montagne
079b41dd37 Remove WITH_TESTS_PERFORMANCE option.
Performance tests now have their own CMake macro, which ensures they do not get
added to ctest list, so we do not have to bother about them anymore, and can always
build them (when GTests are enabled, of course).
2015-06-29 20:26:58 +02:00
Bastien Montagne
117bcfe039 GTests: do not add 'performance' tests to auto-ran tests (with ctest or 'make test')... 2015-06-29 18:15:02 +02:00
Bastien Montagne
a8bc5f0cdb Fix .obj testing. 2015-06-29 18:14:27 +02:00
Bastien Montagne
c68322c7e5 Cleanup: int/uint mismatch in printf... 2015-06-27 11:02:58 +02:00
Bastien Montagne
e170d6be7f Cleanup: all params of BLI_str partition funcs can be const... 2015-06-27 11:00:47 +02:00
Bastien Montagne
ff7a46cfad GTests for new 'end' option of BLI_str_partition_ex(). 2015-06-27 10:24:54 +02:00
Campbell Barton
1c81bcffde addon_utils default mismatch /w enable/disable
default_set argument is now False for both.
2015-06-14 05:14:43 +10:00
Campbell Barton
6e844da9da GTest: add test for listbase sorting
Check for correct sort and stable order for matching values.
2015-06-10 20:26:56 +10:00
Campbell Barton
99fba34b8d rename wiki -> manual 2015-06-08 11:34:07 +10:00
Campbell Barton
bf010c4a15 Cleanup: pep8 2015-06-07 17:28:02 +10:00
Campbell Barton
6fbb580e51 BLI_stack: gtest for clear 2015-06-03 18:09:12 +10:00
Campbell Barton
3a9726783f RNA defaults test
Alternative to T32894, simple test which creates new data and compares with RNA defaults.

Can be used to keep the values in sync without having to maintain a large set of defines.
2015-05-01 01:15:55 +10:00
Campbell Barton
e6ceecdf97 Cleanup: pep8, spelling 2015-04-22 16:26:54 +10:00
Sergey Sharybin
42e427905c CMake: Move performance tests under the cmake option
This way running full sweep of regression tests does not require
waiting for the performance test to finish.
2015-04-20 18:30:26 +05:00
Campbell Barton
af2f4724d5 Cleanup: don't use single sets for comparisons 2015-04-14 10:34:32 +10:00
Campbell Barton
f2452bc9ab Test: blacklist loading addons /w known problems
The test now runs without warnings
2015-04-10 12:08:23 +10:00
Sergey Sharybin
cca4405437 Cycles: Fix wrong render result in certain configuration of render layer's surface/hair
There were some synchronization missing in cases when only one of those settings
was disabled.

Also added a render test for such configurations now.
2015-04-09 21:22:48 +05:00
Bastien Montagne
2941b4ad9b BLI GHash: add some basic gtests.
We could likely add much more, but those already covers basic behavior and should be able
to catch most errors when editing this code.

Also added some performances tests as well (timing ghash insert/lookup under heavy loads,
for different kinds of keys).
2015-03-19 19:50:51 +01:00
Campbell Barton
57646cb2ce Py Tests: manual URL validator
Support for URL checker to use locally generated manual.
2015-03-12 23:49:15 +11:00
Campbell Barton
9d72c9e7e5 Tests: Print counter with operator test 2015-03-10 22:00:24 +11:00
Campbell Barton
7a977df6d4 Refactor array_utils out of BLI_array
BLI_array.h is for resizing array macros, where as array_utils can operate on any arrays.
2015-02-14 08:00:41 +11:00
Campbell Barton
616eb6818f cleanup 2015-02-13 16:17:00 +11:00
Sergey Sharybin
1ebf95bfd7 Tests: Disable failing import/export tests for until they're fixed 2015-02-10 19:29:18 +05:00
Sergey Sharybin
0827441c32 Add extra Cycles regression tests
This new tests are aimed to issues/regressions reported to the tracker.
2015-02-02 02:02:10 +05:00
Sybren A. Stüvel
9fa628f35b mathutils: added exponential map to Quaternion
Added conversion to and from exponential map representation. This
representation is useful for interpolation of > 2 quaternions, or in
PD controllers.

Implementation in C functions quat_to_expmap,
quat_normalized_to_expmap, and expmap_to_quat with Python API, unit
tests and documentation.

Added Quaternion.to_exponential_map() and Quaternion(3-vector) to
Python API.

Reviewers: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1049
2015-02-01 13:06:00 +01:00
Sergey Sharybin
7d543e7310 Corrections to Cycles ctests
- Apply VERBOSE to idiff result as well
- Don't treat verification failed error as unknown
2015-01-30 15:13:09 +05:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Sergey Sharybin
ae213d740d Don't add Cycles tests if tests folder does not exist
Also print message about those tests being disabled.
2015-01-23 20:56:03 +05:00
Sergey Sharybin
433ecb88bd Revert "New cycles tests require buildbot to checkout tests of have test succeed if we test 0 files."
This reverts commit d390e24c49ba8543b56948402622563cae6e860f.

Forcing tests to success is really bad idea. It'll only lead to cases when
you see PASSED and will think everything is OK.

Long story short: never force tests to pass!
2015-01-23 20:48:55 +05:00
Martijn Berger
d390e24c49 New cycles tests require buildbot to checkout tests of have test succeed if we test 0 files. 2015-01-23 16:29:06 +01:00
Campbell Barton
3ff3f563e5 PyAPI: don't adjust prefs when an fails to load
Recent addons commit meant that addons would be enabled even if they weren't found.
This would give an error (which is fine), but also remove from preferences.
2015-01-23 21:18:35 +11:00
Sergey Sharybin
cae72caa82 CTests: Add render tests for Cycles
The idea is to use the set of really small images from the lib folder
and run Cycles render on them comparing render output to reference
images in the tests repository.

For sure same thing could become more generic for BI or Freestyle
render engines.

Thanks Campbell for review and code tweaks!
2015-01-22 15:57:20 +05:00
Campbell Barton
bb4c34fe78 Fix Python CTest's, ignore 'addons_contrib'
Too many contrib addons are in an unstable state making the test not so useful.

Thanks to Sergey initial patch: D1012, redid mostly - but outcome is the same.
2015-01-21 12:56:30 +11:00
Bastien Montagne
16ed20ff3c Add some BLI helpers needed by asset branch.
`BLI_strncpy_ensure_pad()` is also useful with current master code.

The two others (`BLI_strcmp_ignore_pad()` and `BLI_filelist_duplicate()`)
are only used in asset branch currently, but think they could be useful
in other places too, and simplifies handling of asset branch & future patch review.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D965
2015-01-03 10:13:44 +01:00
Campbell Barton
6b8b3badf5 GTest: test beautify with polyfill 2015-01-03 18:05:18 +11:00
Sergey Sharybin
caa2306d16 Libmv: Update to latest upstream version
Main purpose of this is to bring new gflags library which is more likely
to have a fix for undefined order of static variables initialization and
also to bring new glog where some compilation error are fixed (which are
only visible with more strict checks with clang and c++11 enabled).
2014-12-31 16:02:04 +05:00
Bastien Montagne
64c0c13e6e Add Murmur2A hashing feature to BLI
Murmur2a is a very fast hashing function generation int32 hashes.
It also features a very good distribution of generated hashes.

However, it is not endianness-agnostic, meaning it will usually generate
different hashes for a same key on big- and little-endian architectures.
Consequently, **it shall not be used to generate persistent hashes**
(never store them in .blend file e.g.).

This implementation supports incremental hashing, and is a direct
adaptation of reference implementation (in c++):
https://smhasher.googlecode.com/svn-history/r130/trunk/MurmurHash2.cpp

That cpp code was also used to generate reference values in gtests file.

Reviewers: sergey, campbellbarton

Reviewed By: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D892
2014-11-14 11:00:26 +01:00
Campbell Barton
503484c978 GTest: polyfill2d
Collection of test cases from libGDX and our own tracker

Tests:

- combine triangle area matches polygon area.
- tris have same winding.
- tris don't have duplicates.
- correct number of internal & boundary edges.
- degenerate polys still give topologically correct output.

also checks all possible start-vert offsets, forwards and backwards.

optional OBJ output, for debugging.
2014-09-28 21:43:15 +10:00
Campbell Barton
a4c3b92294 BLI_Stack add BLI_stack_peek, BLI_stack_discard
also remove own incorrect assert
2014-09-28 15:08:54 +10:00
Campbell Barton
90f75b8ce0 Cleanup: use static sets where possible 2014-09-18 17:45:31 +10:00
Campbell Barton
0e0e528ea4 Cleanup: pep8 2014-09-17 18:36:17 +10:00
Campbell Barton
7d9760d962 Text3d: assert for <0 len text
also add operator to test blacklist
2014-09-10 23:12:11 +10:00
Bastien Montagne
e44c49d89d Py Mathutils: add invert_safe() and inverted_safe() to Matrix.
Those two mimic our BLI invert_m4_m4_safe - they add a small offset to diagonal values,
in case org matrix is degenerated, and if still non-invertible, return identity matrix.

Org patch by me, final enhanced version by ideasman42, many thanks!
2014-09-06 14:58:38 +02:00
Campbell Barton
7ef925752c Tests: remove support.run_unittest 2014-08-21 19:56:21 +10:00
Bastien Montagne
8535b9bd15 Fix T38722: Adding units in Imperial setting results in inconsistent values
Now always check for a default unit, and evaluate the whole expression in this "unit space".
Not an ideal solution, but should handle most cases nicely
(we can't address all possible corner cases anyway).

Note default unit is searched in current string first (bigger unit of current system wins),
then in previous string.

Note this also replaces ',' by '+' in default separation between units,
helps solving issues with parenthesis (e.g. (1'1")*2.5 would fail in existing code)!
This would break if someone uses py ops with lower precedence than '+' (like bitwise
operations, and comparison), but these are not expected usecase here anyway.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D340
2014-08-20 12:12:03 +02:00
Campbell Barton
1528e5c20a Run unittest.main() directly 2014-08-11 15:23:00 +10:00
Nicholas Bishop
1c8ac33970 Fix incorrect comments in listbase, add unit test to verify change
Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D708
2014-08-05 10:33:24 -04:00
Campbell Barton
200dd87de1 Cleanup: pep8 & redundant vars 2014-07-22 12:03:15 +10:00
Campbell Barton
f7d6749e2f Cleanup: test naming 2014-07-19 20:02:14 +10:00
Campbell Barton
4cc93123c8 Add thousands separators to scene stats (D646)
by januz with own modifications
2014-07-17 14:54:12 +10:00
Campbell Barton
5c4180d898 BLI_stack: various small additions
- add BLI_stack_count
- add BLI_stack_pop_n to pop into an array
- add BLI_stack_push_r, which returns a pointer that can be filled in

Also remove sanity check in BLI_stack_pop, assert if the stack is empty.
2014-07-15 21:09:03 +10:00
Campbell Barton
ea1f1fe0c2 BLI_string, dont pass unicode to ascii BLI_str_partition functions 2014-07-08 06:06:34 +10:00
Bastien Montagne
e3c8cf0a9e Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs.

Reviewed by Campbell Barton, many thanks!
2014-07-04 14:14:06 +02:00
Campbell Barton
228361973d Add BLI_stack test 2014-06-30 11:55:01 +10:00
Campbell Barton
8df6769040 CMake: update source files 2014-06-28 23:17:11 +10:00
Campbell Barton
489937e1e7 GTest now works without buildinfo 2014-06-23 01:16:49 +10:00
Howard Trickey
eaac6cbcd9 Add a bmesh_core_test, a start at testing bmesh functionality.
Needed to make the blender link libraries a global property
now that tests are parallel to source directory.
Current sort order for blender link libraries doesn't work
for tests that start with few defined symbols. Doubling the
lib list works, but a TODO to find a better way (probably
using CMake's own mechanism for tracking dependencies).
2014-06-19 11:53:55 -04:00
Campbell Barton
7ecc3f4734 Add brief license headers to tests
These are effectively public-domain, but use apache2.0 to avoid adding new licenses
2014-06-19 18:48:41 +10:00
Sergey Sharybin
a6e58cd761 Use Blender codestyle, not Google's one! 2014-06-19 12:47:56 +06:00
Sergey Sharybin
16d64a99b4 Add unit tests for aligned alloc
This was really handy on initial work of aligned alloc
and would be handy as well when we'll need to support
arbitrary alignment on Apple platforms.
2014-06-19 12:45:00 +06:00
Sergey Sharybin
72b607ab74 Some WITH_TESTS weer not renamed to WITH_GTEST 2014-06-18 22:28:27 +06:00
Sergey Sharybin
306cbb82ec GTest unit testing framework
Currently covers only small set of functionality.
2014-06-19 02:09:16 +10:00
Campbell Barton
0eb060c7b4 Move tests into tests/ top-level dir 2014-06-18 22:03:46 +10:00