Skip to content
Merged
13 changes: 8 additions & 5 deletions indra/cmake/ALAddTestBinary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ function(al_add_test_binary name)
add_executable(${target} ${arg_SOURCES} ${arg_UNIT})
target_link_libraries(${target} PRIVATE al::flags al_test_support ${arg_SUPPORT} ${arg_LIBRARIES})
target_include_directories(${target} PRIVATE ${arg_INCLUDES} ${INDRA_SOURCE_DIR}/test)
# For the helpers in test/ that TUT tests still share, so each fails a
# test the way its framework does.
target_compile_definitions(${target} PRIVATE AL_TEST_CATCH2=1)
if(arg_UNIT)
target_include_directories(
${target}
Expand Down Expand Up @@ -324,7 +321,9 @@ function(al_add_test_binary name)
# Every case no file's tag names: a filter of nothing but exclusions
# leaves the hidden cases out, as the files' entries do, and one that
# matches nothing exits 2. The ISA gate is not asked: nothing runs, and a
# listing already needs the binary to start on any host.
# listing already needs the binary to start on any host. Disabled where
# the files' entries are: a run starts its checks whatever it matches,
# and a GL binary's make the context the host has none of.
set(strays)
foreach(stem IN LISTS stems)
string(APPEND strays "~[#${stem}]")
Expand All @@ -338,7 +337,11 @@ function(al_add_test_binary name)
)
set_tests_properties(
${target}/stray_cases
PROPERTIES ENVIRONMENT_MODIFICATION "${AL_TEST_ENVIRONMENT}" LABELS "${labels}" TIMEOUT 60
PROPERTIES
ENVIRONMENT_MODIFICATION "${AL_TEST_ENVIRONMENT}"
LABELS "${labels}"
DISABLED ${disabled}
TIMEOUT 60
)

list(LENGTH stems file_count)
Expand Down
338 changes: 157 additions & 181 deletions indra/llui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -562,207 +562,183 @@ if(AL_BUILD_TESTS)
llcommon
${spellcheck_lib}
)
# Four that test templates whole in their headers, and need nothing
# compiled of llui's.
al_add_test(alfenwicktree PROJECT llui LIBRARIES ${test_libs})
al_add_test(allinetable PROJECT llui LIBRARIES ${test_libs})
al_add_test(almaxima PROJECT llui LIBRARIES ${test_libs})
al_add_test(alprefixsums PROJECT llui LIBRARIES ${test_libs})

# What llui asks the viewer for, defined once: compiled here and linked
# into every test and benchmark below, which link the library. A test
# file holds no copy of its own, since two in one binary would not link.
# into every test and benchmark below. A test file holds no copy of its
# own, since two in one binary would not link.
add_library(llui_test_fakes OBJECT tests/llui_test_fakes.cpp)
target_link_libraries(llui_test_fakes PRIVATE al::flags llcommon)
set_target_properties(llui_test_fakes PROPERTIES FOLDER "Tests/llui")

set(test_libs llui llui_test_fakes ${test_libs})
foreach(
test
llstatbar
lltextparser
llview
lluistring
llxuiparser
llfocusmgr
alxuioverlay
alxuidocuments
alxuifindings
alxuitranslate
)
al_add_test(${test} PROJECT llui LIBRARIES ${test_libs})
endforeach()
# Tests of one of llui's files each, linked against the library that
# holds it rather than compiling a copy of their own.
foreach(
test
llchatautocompletemodel
alkeymap
alanchoredranges
altextdocument
altextcarets
altextundo
alnotecarditems
alsyntaxhighlighter
llurlentry
llemojidictionary
)
al_add_test(${test} PROJECT llui LIBRARIES ${test_libs})
endforeach()
# What comparing two texts is made of, below the view.
al_add_test(altextdiff PROJECT llui LIBRARIES ${test_libs})
# Two texts' differences written as a unified diff.
al_add_test(alunifieddiff PROJECT llui LIBRARIES ${test_libs})
# A merge settled in a comparison, and lines of a text put in place of
# others as one edit of it.
al_add_test(
aldiffmerge
PROJECT llui
LIBRARIES ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
)
al_add_test(
aldiffmodel
PROJECT llui
LIBRARIES ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
)
# A grammar's regions for a comparison, read again only where a text
# changed: over the grammars the viewer ships.
al_add_test(
aldifflexer
PROJECT llui
LIBRARIES ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
)

# Tests that build widgets above LLView stand up a UI over the source
# tree's skins and fonts; this is where it is.
foreach(
test
llurlmatch
lllayoutstack
llresizebar
llaccordionctrltab
llspinctrl
llcombobox
llradiogroup
lltabcontainer
llfloater
alpropertygrid
alcolorfield
alcolortablepanel
alimagefield
alcolorpicker
alfontfield
alflagsfield
alxuinotes
alfollowscontrol
alcanvasview
aldockpanel
alpanefolds
alangledial
alcornerfield
aldraggesture
aloffsetpad
alemptystate
alxuifill
alviewtype
alxuidiagnostics
alxuishellbuild
alxuicatalog
alxuilint
alxuiedit
alfindbar
alfolderfilter
alhistorylist
alplace
alpopover
alkeycapture
alscopebar
aljumpbar
almenuslot
alpanelist
alspecimenlist
altabstrip
alquickopen
alstudiofloater
altextgotoline
alxuifields
alxuischema
alxuiselection
alxuisourcemap
alxuitreemodel
alsettingrow
alstringmatch
alsurface
alcolorsheet
lluicolortable
alundostack
alsyntaxgrammars
altextediting
altextfind
altextindent
altextlayout
altextsearch
altextspelling
altextview
alcodecards
alcodeeditor
alchangepeek
aldiffview
albracketindex
alcompletionmodel
alfuzzymatch
alfixlistmodel
alfoldmodel
alsnippetsession
alvimkeymap
alvimmappings
alvimpattern
alvimregisters
alxuiservice
aloutputview
alchoicelist
llurlregistry
)
al_add_test(
${test}
PROJECT llui
LIBRARIES ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
# What llui's test binaries set up for the process, put back after every
# case, and give the state guard to check: once for the binary with no GL,
# once for the one that draws.
add_library(llui_test_checks OBJECT tests/llui_test_checks.cpp)
add_library(llui_gl_test_checks OBJECT tests/llui_test_checks.cpp)
target_compile_definitions(llui_gl_test_checks PRIVATE LLUI_TEST_GL=1)
foreach(checks llui_test_checks llui_gl_test_checks)
target_link_libraries(${checks} PRIVATE al::flags al_test_support llui)
target_compile_definitions(
${checks}
PRIVATE "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
)
set_target_properties(${checks} PROPERTIES FOLDER "Tests/llui")
endforeach()

# What the text view draws, read back from llrender's hidden window.
al_add_test(
altextview_gl
GL
# llui's tests with no GL but the colour table's: templates tested whole
# in their headers; text, strings, XUI and parsing; a file of llui's
# each, from the key map to the URL entries; what comparing two texts is
# made of, and the merges and grammars over it; and every widget above
# LLView, built over one headless UI on the source tree's skins and fonts.
al_add_test_binary(
llui_tests
PROJECT llui
LIBRARIES ${test_libs}
SOURCES
tests/alanchoredranges_test.cpp
tests/alangledial_test.cpp
tests/albracketindex_test.cpp
tests/alcanvasview_test.cpp
tests/alchangepeek_test.cpp
tests/alchoicelist_test.cpp
tests/alcodecards_test.cpp
tests/alcodeeditor_test.cpp
tests/alcolorfield_test.cpp
tests/alcolorpicker_test.cpp
tests/alcolorsheet_test.cpp
tests/alcolortablepanel_test.cpp
tests/alcompletionmodel_test.cpp
tests/alcornerfield_test.cpp
tests/aldifflexer_test.cpp
tests/aldiffmerge_test.cpp
tests/aldiffmodel_test.cpp
tests/aldiffview_test.cpp
tests/aldockpanel_test.cpp
tests/aldraggesture_test.cpp
tests/alemptystate_test.cpp
tests/alfenwicktree_test.cpp
tests/alfindbar_test.cpp
tests/alfixlistmodel_test.cpp
tests/alflagsfield_test.cpp
tests/alfolderfilter_test.cpp
tests/alfoldmodel_test.cpp
tests/alfollowscontrol_test.cpp
tests/alfontfield_test.cpp
tests/alfuzzymatch_test.cpp
tests/alhistorylist_test.cpp
tests/alimagefield_test.cpp
tests/aljumpbar_test.cpp
tests/alkeycapture_test.cpp
tests/alkeymap_test.cpp
tests/allinetable_test.cpp
tests/almaxima_test.cpp
tests/almenuslot_test.cpp
tests/alnotecarditems_test.cpp
tests/aloffsetpad_test.cpp
tests/aloutputview_test.cpp
tests/alpanefolds_test.cpp
tests/alpanelist_test.cpp
tests/alplace_test.cpp
tests/alpopover_test.cpp
tests/alprefixsums_test.cpp
tests/alpropertygrid_test.cpp
tests/alquickopen_test.cpp
tests/alscopebar_test.cpp
tests/alsettingrow_test.cpp
tests/alsnippetsession_test.cpp
tests/alspecimenlist_test.cpp
tests/alstringmatch_test.cpp
tests/alstudiofloater_test.cpp
tests/alsurface_test.cpp
tests/alsyntaxgrammars_test.cpp
tests/alsyntaxhighlighter_test.cpp
tests/altabstrip_test.cpp
tests/altextcarets_test.cpp
tests/altextdiff_test.cpp
tests/altextdocument_test.cpp
tests/altextediting_test.cpp
tests/altextfind_test.cpp
tests/altextgotoline_test.cpp
tests/altextindent_test.cpp
tests/altextlayout_test.cpp
tests/altextsearch_test.cpp
tests/altextspelling_test.cpp
tests/altextundo_test.cpp
tests/altextview_test.cpp
tests/alundostack_test.cpp
tests/alunifieddiff_test.cpp
tests/alviewtype_test.cpp
tests/alvimkeymap_test.cpp
tests/alvimmappings_test.cpp
tests/alvimpattern_test.cpp
tests/alvimregisters_test.cpp
tests/alxuicatalog_test.cpp
tests/alxuidiagnostics_test.cpp
tests/alxuidocuments_test.cpp
tests/alxuiedit_test.cpp
tests/alxuifields_test.cpp
tests/alxuifill_test.cpp
tests/alxuifindings_test.cpp
tests/alxuilint_test.cpp
tests/alxuinotes_test.cpp
tests/alxuioverlay_test.cpp
tests/alxuischema_test.cpp
tests/alxuiselection_test.cpp
tests/alxuiservice_test.cpp
tests/alxuishellbuild_test.cpp
tests/alxuisourcemap_test.cpp
tests/alxuitranslate_test.cpp
tests/alxuitreemodel_test.cpp
tests/llaccordionctrltab_test.cpp
tests/llchatautocompletemodel_test.cpp
tests/llcombobox_test.cpp
tests/llemojidictionary_test.cpp
tests/llfloater_test.cpp
tests/llfocusmgr_test.cpp
tests/lllayoutstack_test.cpp
tests/llradiogroup_test.cpp
tests/llresizebar_test.cpp
tests/llspinctrl_test.cpp
tests/llstatbar_test.cpp
tests/lltabcontainer_test.cpp
tests/lltextparser_test.cpp
tests/lluistring_test.cpp
tests/llurlentry_test.cpp
tests/llurlmatch_test.cpp
tests/llurlregistry_test.cpp
tests/llview_test.cpp
tests/llxuiparser_test.cpp
SUPPORT llui_test_fakes llui_test_checks llrender_test_checks llcommon_test_checks
LIBRARIES llui ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
)

# A surface's ground and frame, and the tab strip's tabs, read back the
# same way.
al_add_test(
alsurface_gl
GL
# The colour table's own tests, alone: each loads documents of its own,
# and a name, once in the table, stays there for every case after it.
al_add_test_binary(
lluicolortable_test
PROJECT llui
LIBRARIES ${test_libs}
SOURCES tests/lluicolortable_test.cpp
SUPPORT llui_test_fakes llrender_test_checks llcommon_test_checks
LIBRARIES llui ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
)

# What a comparison draws over its sides -- the current change's outline,
# a folded row's words -- read back the same way.
al_add_test(
aldiffview_gl
GL
# What the text view, a surface and its tab strip, and a comparison draw,
# read back from llrender's hidden window: one GL context, and the
# headless UI's fonts with GL textures on it.
al_add_test_binary(
llui_gl_tests
PROJECT llui
LIBRARIES ${test_libs}
SOURCES tests/aldiffview_gl_test.cpp tests/alsurface_gl_test.cpp tests/altextview_gl_test.cpp
SUPPORT llui_test_fakes llui_gl_test_checks llrender_test_checks llcommon_test_checks
LIBRARIES llui ${test_libs}
DEFINES "LLUI_TEST_APP_DIR=\"${INDRA_SOURCE_DIR}/newview\""
GL
)

# The benchmarks, still executables of their own, link the fakes with
# the library.
set(test_libs llui llui_test_fakes ${test_libs})

# The code editor over 50,000-line scripts: what each change to the edit
# pipeline, the highlighter, the layout, the folds or find is measured by.
al_add_bench(
Expand Down
Loading
Loading