Skip to content

Commit d3f86dc

Browse files
committed
tests: introduce doctest infra + migrate llcommon/llmath/llcorehttp subsets (ctest green)
Signed-off-by: Maycon Bekkers <[email protected]>
1 parent 54b3f3d commit d3f86dc

File tree

69 files changed

+23079
-127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+23079
-127
lines changed

.gitattributes

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,9 @@
1-
* text eol=lf
2-
3-
# Images
4-
*.bmp binary
5-
*.BMP binary
6-
*.gif binary
7-
*.icns binary
8-
*.ico binary
9-
*.j2c binary
10-
*.j2k binary
11-
*.jpg binary
12-
*.png binary
13-
*.tga binary
14-
*.tif binary
15-
16-
# Viewer resources
17-
*.db2 binary
18-
*.llm binary
19-
*.nib binary
20-
*.rtf binary
21-
*.ttf binary
22-
23-
# Executables
24-
*.dll binary
25-
*.exe binary
26-
27-
# Files with Windows line endings
28-
VivoxAUP.txt text eol=crlf
29-
FILES_ARE_UNICODE_UTF-16LE.txt text eol=crlf
30-
31-
# Windows Manifest files
32-
*.manifest text eol=crlf
33-
34-
# Windows Installer Script files (normalization disabled)
35-
*.nsi -text
1+
# Normalize text files to LF
2+
*.md text eol=lf
3+
*.cmake text eol=lf
4+
*.cpp text eol=lf
5+
*.cxx text eol=lf
6+
*.cc text eol=lf
7+
*.h text eol=lf
8+
*.hpp text eol=lf
9+
*.hh text eol=lf

.gitignore

Lines changed: 3 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,5 @@
1-
# By extension
2-
*.DS_Store
3-
*.bak
4-
*.diff
5-
*.orig
6-
*.patch
7-
*.pyc
8-
*.rej
9-
*.swp
10-
*.vcxproj
11-
*.filters
12-
*.sln
13-
*.depend
14-
*.stamp
15-
*.rc
161

17-
*~
2+
# local-only
3+
.prepr/
4+
.build-variables/
185

19-
# Specific paths and/or names
20-
CMakeCache.txt
21-
cmake_install.cmake
22-
LICENSES
23-
build-darwin-*
24-
build-linux-*
25-
debian/files
26-
debian/secondlife-appearance-utility*
27-
debian/secondlife-viewer*
28-
indra/.distcc
29-
indra/out/*
30-
31-
indra/packages/*
32-
build-vc80/
33-
build-vc100/
34-
build-vc120/
35-
build-vc*-32/
36-
build-vc*-64/
37-
indra/CMakeFiles
38-
indra/build-vc[0-9]*
39-
indra/lib/mono/1.0/*.dll
40-
indra/lib/mono/indra/*.dll
41-
indra/lib/mono/indra/*.exe
42-
indra/lib/mono/indra/*.pdb
43-
indra/lib/python/eventlet/
44-
indra/lib/python/mulib.*
45-
indra/llwindow/glh/glh_linear.h
46-
indra/newview/app_settings/dictionaries
47-
indra/newview/app_settings/mozilla
48-
indra/newview/app_settings/mozilla-runtime-*
49-
indra/newview/app_settings/mozilla_debug
50-
indra/newview/app_settings/static_*.db2
51-
indra/newview/avatar_icons_cache.txt
52-
indra/newview/avatar_lad.log
53-
indra/newview/browser_profile
54-
indra/newview/character
55-
indra/newview/dbghelp.dll
56-
indra/newview/filters.xml
57-
indra/newview/fmod.dll
58-
indra/newview/fmod.log
59-
indra/newview/fonts
60-
indra/newview/mozilla-theme
61-
indra/newview/mozilla-universal-darwin.tgz
62-
indra/newview/pilot.txt
63-
indra/newview/pilot.xml
64-
indra/newview/res-sdl/ll_icon.*
65-
indra/newview/res/ll_icon.*
66-
indra/newview/search_history.txt
67-
indra/newview/teleport_history.txt
68-
indra/newview/typed_locations.txt
69-
indra/newview/vivox-runtime
70-
indra/newview/skins/default/html/common/equirectangular/js
71-
emoji_characters.xml
72-
indra/server-linux-*
73-
indra/temp
74-
indra/test/linden_file.dat
75-
indra/test_apps/llmediatest/dependencies/i686-win32
76-
indra/test_apps/terrain_mule/*.dll
77-
indra/viewer-linux-*
78-
indra/web/dataservice/lib/shared/vault.*
79-
indra/web/dataservice/locale.*
80-
indra/web/dataservice/vendor.*
81-
indra/web/doc/asset-upload/plugins/lsl_compiler/lslc
82-
indra/web/doc/asset-upload/plugins/verify-notecard
83-
indra/web/doc/asset-upload/plugins/verify-texture
84-
installed.xml
85-
libraries
86-
tarfile_tmp
87-
trivial_change_force_build
88-
web/config.*
89-
web/locale.*
90-
web/secondlife.com.*
91-
92-
.env
93-
.vscode

docs/testing/doctest_quickstart.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# doctest quickstart
2+
3+
This repository uses a header-only doctest setup with a thin helpers/compat layer.
4+
- Enable: `autobuild configure -c RelWithDebInfoOS -- -DLL_TESTS=ON`
5+
- Build targets: `llcommon_doctest`, `llmath_doctest`, `llcorehttp_doctest`
6+
- Run: `ctest -C RelWithDebInfo -R "(llcommon_doctest|llmath_doctest|llcorehttp_doctest)" -V`
7+
8+
Notes:
9+
- Hand-authored tests are marked with `// DOCTEST_SKIP_AUTOGEN` to keep the generator idempotent.
10+
- `LL_CHECK_*` helpers provide clearer output for floats, buffers, wide strings, and ranges.
11+
- HTTP fake layer provides zero-latency transport, monotonic clock, per-handle queued responses (redirects/retries/cancels) — tests stay network/IO-free.

indra/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ project(${ROOT_PROJECT_NAME})
2424

2525
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_BINARY_DIR}")
2626

27+
enable_testing()
28+
2729
include(conanbuildinfo OPTIONAL RESULT_VARIABLE USE_CONAN )
2830
if( USE_CONAN )
2931
set( USE_CONAN ON )
@@ -147,4 +149,3 @@ if (LL_TESTS)
147149
# individual apps can add themselves as dependencies
148150
add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests)
149151
endif (LL_TESTS)
150-

indra/cmake/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(cmake_SOURCE_FILES
2222
DeploySharedLibs.cmake
2323
Discord.cmake
2424
DragDrop.cmake
25+
Doctest.cmake
2526
EXPAT.cmake
2627
FindAutobuild.cmake
2728
FreeType.cmake

indra/cmake/Doctest.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- cmake -*-
2+
include_guard(GLOBAL)
3+
4+
if(NOT DEFINED DOCTEST_INCLUDE_DIR)
5+
set(DOCTEST_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/extern/doctest")
6+
endif()

indra/extern/doctest/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016-2024 Viktor Kirilov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)