Selaa lähdekoodia

Some polishing on the visual tests. Changed CMake test variables and names. Update changelog.

Michael Ragazzon 5 vuotta sitten
vanhempi
sitoutus
2392c8dec2

+ 3 - 6
CMakeLists.txt

@@ -75,12 +75,9 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
 	
 	
 	if(BUILD_TESTING)
 	if(BUILD_TESTING)
 		set(RMLUI_TESTS_ENABLED ON)
 		set(RMLUI_TESTS_ENABLED ON)
-		option(BUILD_UNIT_TESTS "Enable to build UnitTests." ON)
-		option(BUILD_VISUAL_TESTS "Enable to build VisualTests." ON)
-		set(VISUAL_TESTS_DIRECTORIES "" CACHE STRING "Specify additional directories containing *.rml documents for the visual tests. Backslashes must be escaped. Separate multiple directories by semicolon.")
-		set(VISUAL_TESTS_INPUT_DIRECTORY "" CACHE PATH "Set the input directory for screenshot comparison performed by the VisualTests.")
-		set(VISUAL_TESTS_OUTPUT_DIRECTORY "" CACHE PATH "Set the output directory for screenshots generated by the VisualTests.")
-		option(BUILD_BENCHMARKS "Enable to build Benchmarks." ON)
+		set(VISUAL_TESTS_RML_DIRECTORIES "" CACHE PATH "Specify additional directories containing *.rml test documents for VisualTests. Separate multiple directories by semicolon.")
+		set(VISUAL_TESTS_COMPARE_DIRECTORY "" CACHE PATH "Set the input directory for screenshot comparison performed by VisualTests.")
+		set(VISUAL_TESTS_CAPTURE_DIRECTORY "" CACHE PATH "Set the output directory for screenshots generated by VisualTests.")
 	endif()
 	endif()
 endif()
 endif()
 
 

+ 1 - 1
Source/Debugger/LogSource.h

@@ -30,7 +30,7 @@ static const char* log_rcss = R"RCSS(body
 {
 {
 	width: 400dp;
 	width: 400dp;
 	height: 300dp;
 	height: 300dp;
-	min-width: 230dp;
+	min-width: 250dp;
 	min-height: 150dp;
 	min-height: 150dp;
 	top: 42dp;
 	top: 42dp;
 	left: 20dp;
 	left: 20dp;

+ 51 - 52
Tests/CMakeLists.txt

@@ -32,74 +32,73 @@ file(GLOB TestsCommon_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Common/*.cpp
 #===================================
 #===================================
 # Unit Tests =======================
 # Unit Tests =======================
 #===================================
 #===================================
-if(BUILD_UNIT_TESTS)
-	file(GLOB UnitTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.h )
-	file(GLOB UnitTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.cpp )
 
 
-	add_executable(UnitTests ${UnitTests_HDR_FILES} ${UnitTests_SRC_FILES})
-	target_link_libraries(UnitTests RmlCore doctest::doctest)
-	set_target_properties(UnitTests PROPERTIES CXX_STANDARD 14)
+file(GLOB UnitTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.h )
+file(GLOB UnitTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.cpp )
 
 
-	add_common_target_options(UnitTests)
+add_executable(UnitTests ${UnitTests_HDR_FILES} ${UnitTests_SRC_FILES})
+target_link_libraries(UnitTests RmlCore doctest::doctest)
+set_target_properties(UnitTests PROPERTIES CXX_STANDARD 14)
 
 
-	if(MSVC)
-		target_compile_definitions(UnitTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
-	endif()
+add_common_target_options(UnitTests)
 
 
-	doctest_discover_tests(UnitTests)
+if(MSVC)
+	target_compile_definitions(UnitTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
 endif()
 endif()
 
 
+doctest_discover_tests(UnitTests)
+
+
 
 
 #===================================
 #===================================
 # Visual Tests =====================
 # Visual Tests =====================
 #===================================
 #===================================
-if(BUILD_VISUAL_TESTS)
-	file(GLOB VisualTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.h )
-	file(GLOB VisualTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.cpp )
-	
-	if(WIN32)
-		add_executable(VisualTests WIN32 ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
-	else()
-		add_executable(VisualTests ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
-	endif()
-	
-	target_link_libraries(VisualTests RmlCore RmlDebugger lodepng::lodepng ${sample_LIBRARIES})
-	set_target_properties(VisualTests PROPERTIES CXX_STANDARD 14)
-
-	# Enable compiler warnings
-	add_common_target_options(VisualTests)
-	
-	if(VISUAL_TESTS_DIRECTORIES)
-		target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_DIRECTORIES="${VISUAL_TESTS_DIRECTORIES}")
-	endif()
-	if(VISUAL_TESTS_INPUT_DIRECTORY)
-		target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_INPUT_DIRECTORY="${VISUAL_TESTS_INPUT_DIRECTORY}")
-	endif()
-	if(VISUAL_TESTS_OUTPUT_DIRECTORY)
-		target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_OUTPUT_DIRECTORY="${VISUAL_TESTS_OUTPUT_DIRECTORY}")
-	endif()
-	
-	if(MSVC)
-		target_compile_definitions(VisualTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
-	endif()
+
+file(GLOB VisualTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.h )
+file(GLOB VisualTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.cpp )
+
+if(WIN32)
+	add_executable(VisualTests WIN32 ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
+else()
+	add_executable(VisualTests ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
 endif()
 endif()
 
 
+target_link_libraries(VisualTests RmlCore RmlDebugger lodepng::lodepng ${sample_LIBRARIES})
+set_target_properties(VisualTests PROPERTIES CXX_STANDARD 14)
+
+# Enable compiler warnings
+add_common_target_options(VisualTests)
+
+if(VISUAL_TESTS_RML_DIRECTORIES)
+	target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_RML_DIRECTORIES="${VISUAL_TESTS_RML_DIRECTORIES}")
+endif()
+if(VISUAL_TESTS_COMPARE_DIRECTORY)
+	target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_COMPARE_DIRECTORY="${VISUAL_TESTS_COMPARE_DIRECTORY}")
+endif()
+if(VISUAL_TESTS_CAPTURE_DIRECTORY)
+	target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_CAPTURE_DIRECTORY="${VISUAL_TESTS_CAPTURE_DIRECTORY}")
+endif()
+
+if(MSVC)
+	target_compile_definitions(VisualTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
+endif()
+
+
 
 
 #===================================
 #===================================
 # Benchmarks =======================
 # Benchmarks =======================
 #===================================
 #===================================
-if(BUILD_BENCHMARKS)
-	file(GLOB Benchmarks_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.h )
-	file(GLOB Benchmarks_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.cpp )
 
 
-	add_executable(Benchmarks ${Benchmarks_HDR_FILES} ${Benchmarks_SRC_FILES} ${TestsCommon_HDR_FILES} ${TestsCommon_SRC_FILES})
-	target_link_libraries(Benchmarks RmlCore RmlDebugger doctest::doctest nanobench::nanobench ${sample_LIBRARIES})
-	set_target_properties(Benchmarks PROPERTIES CXX_STANDARD 14)
+file(GLOB Benchmarks_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.h )
+file(GLOB Benchmarks_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.cpp )
+
+add_executable(Benchmarks ${Benchmarks_HDR_FILES} ${Benchmarks_SRC_FILES} ${TestsCommon_HDR_FILES} ${TestsCommon_SRC_FILES})
+target_link_libraries(Benchmarks RmlCore RmlDebugger doctest::doctest nanobench::nanobench ${sample_LIBRARIES})
+set_target_properties(Benchmarks PROPERTIES CXX_STANDARD 14)
 
 
-	# Enable compiler warnings
-	add_common_target_options(Benchmarks)
+# Enable compiler warnings
+add_common_target_options(Benchmarks)
 
 
-	if(MSVC)
-		target_compile_definitions(Benchmarks PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
-	endif()
-endif()
+if(MSVC)
+	target_compile_definitions(Benchmarks PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
+endif()

+ 2 - 1
Tests/Data/VisualTests/LICENSE.txt

@@ -1,4 +1,5 @@
-This software or document includes material copied and modified from the CSS specifications [1], in particular from examples there-in. In addition, parts of the CSS test suites [2] have been modified and included with this software. The license [3] of this material is restated below. Copyright © 2020 W3C® (MIT, ERCIM, Keio, Beihang).
+This software or document includes material copied and modified from the CSS specifications [1], in particular from examples there-in. In addition, parts of the CSS test suites [2] have been modified and included with this software. The material is located in some of the *.rml files in the same directory as this file, and have been tagged with an XML 'link' node with a 'rel=source' attribute pointing to the exact place on the 'w3.org' or 'csswg.org' websites the material has been copied and modified from. The license [3] of this material is restated below. Copyright © 2020 W3C® (MIT, ERCIM, Keio, Beihang).
+
 [1] https://drafts.csswg.org/
 [1] https://drafts.csswg.org/
 [2] https://www.w3.org/Style/CSS/Test/
 [2] https://www.w3.org/Style/CSS/Test/
 [3] https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
 [3] https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document

+ 1 - 1
Tests/Data/VisualTests/css1_clear.rml

@@ -4,7 +4,7 @@
 <link type="text/rcss" href="../style.rcss"/>
 <link type="text/rcss" href="../style.rcss"/>
 <link rel="source" href="https://www.w3.org/Style/CSS/Test/CSS1/current/sec5526.htm"/>
 <link rel="source" href="https://www.w3.org/Style/CSS/Test/CSS1/current/sec5526.htm"/>
 <link rel="help" href="http://www.w3.org/TR/REC-CSS1#clear"/>
 <link rel="help" href="http://www.w3.org/TR/REC-CSS1#clear"/>
-<meta name="description" content="This is the ACID1 test. Some minor modifications have been applied such as matching fonts and borders to the RmlUi syntax." />
+<meta name="description" content="Basic CSS1 test of the 'clear' property." />
 <style type="text/css">
 <style type="text/css">
 @spritesheet theme 
 @spritesheet theme 
 {
 {

+ 3 - 1
Tests/Data/VisualTests/inline_block.rml

@@ -2,7 +2,9 @@
 <head>
 <head>
     <title>Inline-block</title>
     <title>Inline-block</title>
     <link type="text/rcss" href="../style.rcss"/>
     <link type="text/rcss" href="../style.rcss"/>
-	<meta name="Description" content="Inline-block" />
+	<link rel="help" href="https://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#inlineblock-width" />
+	<link rel="help" href="https://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#leading" />
+	<meta name="Description" content="Elements with 'display: inline-block' should shrink-to-fit when no width is specified. The baseline of the element should be the baseline of its last line." />
 	<style>
 	<style>
 		body {
 		body {
 			background: #ddd;
 			background: #ddd;

+ 1 - 0
Tests/Data/VisualTests/position_01_normal_flow.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Normal flow</title>
 	<title>CSS Position: Normal flow</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content="Position demo" />
 	<meta name="description" content="Position demo" />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_02_relative_positioning.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Relative positioning</title>
 	<title>CSS Position: Relative positioning</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='The result is identical to normal flow, except that the "outer" text is shifted 12px upward, without affecting the flow of the "body" or "inner" text.' />
 	<meta name="description" content='The result is identical to normal flow, except that the "outer" text is shifted 12px upward, without affecting the flow of the "body" or "inner" text.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_03_floating_a_box.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Floating a box</title>
 	<title>CSS Position: Floating a box</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='The "inner" text lays out in an independent box on the right, causing the remaining "body" and "outer" text to flow around it.' />
 	<meta name="description" content='The "inner" text lays out in an independent box on the right, causing the remaining "body" and "outer" text to flow around it.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_04_floating_a_box_sibling.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Floating a box - Sibling</title>
 	<title>CSS Position: Floating a box - Sibling</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='Identical to the previous example, save that there is now "sibling" text flowing with the "body" and "outer" text.' />
 	<meta name="description" content='Identical to the previous example, save that there is now "sibling" text flowing with the "body" and "outer" text.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_05_floating_a_box_clear.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Floating a box - Clear</title>
 	<title>CSS Position: Floating a box - Clear</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='Now the "sibling" text moves down to below the "inner" text’s box, leaving blank space behind. The text following the "sibling" text flows after it as normal.' />
 	<meta name="description" content='Now the "sibling" text moves down to below the "inner" text’s box, leaving blank space behind. The text following the "sibling" text flows after it as normal.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_06_absolute_positioning.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Absolute positioning</title>
 	<title>CSS Position: Absolute positioning</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='All of the text within #outer (the "outer" and "inner" text) moves down to an independent box in the lower right corner. The two halves of "body" text flow together.' />
 	<meta name="description" content='All of the text within #outer (the "outer" and "inner" text) moves down to an independent box in the lower right corner. The two halves of "body" text flow together.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_07_absolute_positioning_relative.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Absolute positioning - Relative</title>
 	<title>CSS Position: Absolute positioning - Relative</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='The "inner" text is positioned in an independent box, relative to the top-left corner of the start of the "outer" text.' />
 	<meta name="description" content='The "inner" text is positioned in an independent box, relative to the top-left corner of the start of the "outer" text.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_08_absolute_positioning_no_relative.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Absolute positioning - No relative</title>
 	<title>CSS Position: Absolute positioning - No relative</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='Same as before, except now the "inner text" is positioned relative to the top-left corner of the page itself.' />
 	<meta name="description" content='Same as before, except now the "inner text" is positioned relative to the top-left corner of the page itself.' />
 	<style>
 	<style>

+ 1 - 0
Tests/Data/VisualTests/position_09_absolute_positioning_change_bars.rml

@@ -2,6 +2,7 @@
 <head>
 <head>
 	<title>CSS Position: Absolute positioning - Change bars</title>
 	<title>CSS Position: Absolute positioning - Change bars</title>
 	<link type="text/rcss" href="../style.rcss"/>
 	<link type="text/rcss" href="../style.rcss"/>
+	<link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
 	<meta name="description" content='The two red hyphens, indicating a change, sit in the left margin of the page on the line containing the word "THIS", regardless of what line that ends up being.' />
 	<meta name="description" content='The two red hyphens, indicating a change, sit in the left margin of the page on the line containing the word "THIS", regardless of what line that ends up being.' />
 	<style>
 	<style>

+ 1 - 1
Tests/Data/VisualTests/shrink_to_fit_01.rml

@@ -3,7 +3,7 @@
     <title>Shrink-to-fit</title>
     <title>Shrink-to-fit</title>
     <link type="text/rcss" href="../style.rcss"/>
     <link type="text/rcss" href="../style.rcss"/>
 	<link rel="help" href="https://www.w3.org/TR/CSS21/visudet.html#shrink-to-fit-float" />
 	<link rel="help" href="https://www.w3.org/TR/CSS21/visudet.html#shrink-to-fit-float" />
-	<meta name="Description" content="Shrink-to-fit width" />
+	<meta name="Description" content="Floating elements, absolutely positioned elements, and inline-block elements should shrink-to-fit when their width is auto." />
 	<style>
 	<style>
 		body {
 		body {
 			background: #ddd;
 			background: #ddd;

+ 1 - 1
Tests/Data/VisualTests/shrink_to_fit_02.rml

@@ -74,7 +74,7 @@
 </head>
 </head>
 
 
 <body id="test">
 <body id="test">
-<p>The following boxes should all appear the same, with the background and border tightly packed around the word 'BOX'.</p>
+<p>The background of the following boxes should pack tightly around their contents, with no line-breaks.</p>
 <div style="position: relative; top: -50px;">
 <div style="position: relative; top: -50px;">
 <div class="x" id="absolute">
 <div class="x" id="absolute">
 Element Information
 Element Information

+ 6 - 6
Tests/Source/VisualTests/TestConfig.cpp

@@ -34,8 +34,8 @@
 
 
 Rml::String GetCompareInputDirectory()
 Rml::String GetCompareInputDirectory()
 {
 {
-#ifdef RMLUI_VISUAL_TESTS_INPUT_DIRECTORY
-	const Rml::String input_directory = Rml::String(RMLUI_VISUAL_TESTS_INPUT_DIRECTORY);
+#ifdef RMLUI_VISUAL_TESTS_COMPARE_DIRECTORY
+	const Rml::String input_directory = Rml::String(RMLUI_VISUAL_TESTS_COMPARE_DIRECTORY);
 #else
 #else
 	const Rml::String input_directory = Shell::FindSamplesRoot() + "../Tests/Output";
 	const Rml::String input_directory = Shell::FindSamplesRoot() + "../Tests/Output";
 #endif
 #endif
@@ -44,8 +44,8 @@ Rml::String GetCompareInputDirectory()
 
 
 Rml::String GetCaptureOutputDirectory()
 Rml::String GetCaptureOutputDirectory()
 {
 {
-#ifdef RMLUI_VISUAL_TESTS_OUTPUT_DIRECTORY
-	const Rml::String output_directory = Rml::String(RMLUI_VISUAL_TESTS_OUTPUT_DIRECTORY);
+#ifdef RMLUI_VISUAL_TESTS_CAPTURE_DIRECTORY
+	const Rml::String output_directory = Rml::String(RMLUI_VISUAL_TESTS_CAPTURE_DIRECTORY);
 #else
 #else
 	const Rml::String output_directory = Shell::FindSamplesRoot() + "../Tests/Output";
 	const Rml::String output_directory = Shell::FindSamplesRoot() + "../Tests/Output";
 #endif
 #endif
@@ -58,8 +58,8 @@ Rml::StringList GetTestInputDirectories()
 
 
 	Rml::StringList directories = { samples_root + "../Tests/Data/VisualTests" };
 	Rml::StringList directories = { samples_root + "../Tests/Data/VisualTests" };
 
 
-#ifdef RMLUI_VISUAL_TESTS_DIRECTORIES
-	Rml::StringUtilities::ExpandString(directories, RMLUI_VISUAL_TESTS_DIRECTORIES, ';');
+#ifdef RMLUI_VISUAL_TESTS_RML_DIRECTORIES
+	Rml::StringUtilities::ExpandString(directories, RMLUI_VISUAL_TESTS_RML_DIRECTORIES, ';');
 #endif
 #endif
 
 
 	return directories;
 	return directories;

+ 18 - 10
Tests/Source/VisualTests/TestNavigator.cpp

@@ -121,17 +121,18 @@ void TestNavigator::ProcessEvent(Rml::Event& event)
 			else
 			else
 			{
 			{
 				ComparisonResult result = CompareCurrentView();
 				ComparisonResult result = CompareCurrentView();
+				const Rml::String compare_path = GetCompareInputDirectory() + '/' + GetImageFilenameFromCurrentTest();
 				if (result.success)
 				if (result.success)
 				{
 				{
 					if (result.is_equal)
 					if (result.is_equal)
 					{
 					{
-						Rml::Log::Message(Rml::Log::LT_INFO, "%s compares EQUAL to the reference image.",
-							CurrentSuite().GetFilename().c_str());
+						Rml::Log::Message(Rml::Log::LT_INFO, "%s compares EQUAL to the reference image %s.",
+							CurrentSuite().GetFilename().c_str(), compare_path.c_str());
 					}
 					}
 					else
 					else
 					{
 					{
-						Rml::Log::Message(Rml::Log::LT_INFO, "%s compares NOT EQUAL to the reference image. See diff image written to %s.",
-							CurrentSuite().GetFilename().c_str(), GetCaptureOutputDirectory().c_str());
+						Rml::Log::Message(Rml::Log::LT_INFO, "%s compares NOT EQUAL to the reference image %s.\nSee diff image written to %s.",
+							CurrentSuite().GetFilename().c_str(), compare_path.c_str(), GetCaptureOutputDirectory().c_str());
 					}
 					}
 
 
 					if (!result.error_msg.empty())
 					if (!result.error_msg.empty())
@@ -141,15 +142,22 @@ void TestNavigator::ProcessEvent(Rml::Event& event)
 				{
 				{
 					Rml::Log::Message(Rml::Log::LT_ERROR, "Comparison of %s failed.\n%s", CurrentSuite().GetFilename().c_str(), result.error_msg.c_str());
 					Rml::Log::Message(Rml::Log::LT_ERROR, "Comparison of %s failed.\n%s", CurrentSuite().GetFilename().c_str(), result.error_msg.c_str());
 				}
 				}
-
 			}
 			}
 		}
 		}
 		else if (key_identifier == Rml::Input::KI_F7)
 		else if (key_identifier == Rml::Input::KI_F7)
 		{
 		{
 			if (key_ctrl && key_shift)
 			if (key_ctrl && key_shift)
+			{
 				StartTestSuiteIteration(IterationState::Capture);
 				StartTestSuiteIteration(IterationState::Capture);
+			}
 			else
 			else
-				CaptureCurrentView();
+			{
+				const Rml::String filepath = GetCaptureOutputDirectory() + '/' + GetImageFilenameFromCurrentTest();
+				if (CaptureCurrentView())
+					Rml::Log::Message(Rml::Log::LT_INFO, "Succesfully captured and saved screenshot to %s", filepath.c_str());
+				else
+					Rml::Log::Message(Rml::Log::LT_ERROR, "Could not capture screenshot to %s", filepath.c_str());
+			}
 		}
 		}
 		else if (key_identifier == Rml::Input::KI_F1)
 		else if (key_identifier == Rml::Input::KI_F1)
 		{
 		{
@@ -330,15 +338,15 @@ void TestNavigator::LoadActiveTest()
 	UpdateGoToText();
 	UpdateGoToText();
 }
 }
 
 
-static Rml::String ImageFilenameFromTest(const TestSuite& suite)
+Rml::String TestNavigator::GetImageFilenameFromCurrentTest()
 {
 {
-	const Rml::String& filename = suite.GetFilename();
+	const Rml::String& filename = CurrentSuite().GetFilename();
 	return filename.substr(0, filename.rfind('.')) + ".png";
 	return filename.substr(0, filename.rfind('.')) + ".png";
 }
 }
 
 
 ComparisonResult TestNavigator::CompareCurrentView()
 ComparisonResult TestNavigator::CompareCurrentView()
 {
 {
-	const Rml::String filename = ImageFilenameFromTest(CurrentSuite());
+	const Rml::String filename = GetImageFilenameFromCurrentTest();
 
 
 	ComparisonResult result = CompareScreenToPreviousCapture(shell_renderer, filename);
 	ComparisonResult result = CompareScreenToPreviousCapture(shell_renderer, filename);
 
 
@@ -348,7 +356,7 @@ ComparisonResult TestNavigator::CompareCurrentView()
 
 
 bool TestNavigator::CaptureCurrentView()
 bool TestNavigator::CaptureCurrentView()
 {
 {
-	const Rml::String filename = ImageFilenameFromTest(CurrentSuite());
+	const Rml::String filename = GetImageFilenameFromCurrentTest();
 	
 	
 	bool result = CaptureScreenshot(shell_renderer, filename, 1060);
 	bool result = CaptureScreenshot(shell_renderer, filename, 1060);
 	
 	

+ 2 - 0
Tests/Source/VisualTests/TestNavigator.h

@@ -63,6 +63,8 @@ private:
 
 
 	void UpdateGoToText(bool out_of_bounds = false);
 	void UpdateGoToText(bool out_of_bounds = false);
 
 
+	Rml::String GetImageFilenameFromCurrentTest();
+
 	ShellRenderInterfaceOpenGL* shell_renderer;
 	ShellRenderInterfaceOpenGL* shell_renderer;
 	Rml::Context* context;
 	Rml::Context* context;
 	TestViewer* viewer;
 	TestViewer* viewer;

+ 1 - 1
Tests/Source/VisualTests/main.cpp

@@ -125,7 +125,7 @@ int main(int RMLUI_UNUSED_PARAMETER(argc), char** RMLUI_UNUSED_PARAMETER(argv))
 
 
 			if (files.empty())
 			if (files.empty())
 			{
 			{
-				Rml::Log::Message(Rml::Log::LT_WARNING, "Could not find any *.rml* files in directory '%s'. Ignoring.'", directory.c_str());
+				Rml::Log::Message(Rml::Log::LT_WARNING, "Could not find any *.rml files in directory '%s'. Ignoring.", directory.c_str());
 			}
 			}
 			else
 			else
 			{
 			{

+ 15 - 1
changelog.md

@@ -57,17 +57,31 @@ For now, this is considered an experimental feature.
 - Have a look at the 'databinding' sample for usage examples.
 - Have a look at the 'databinding' sample for usage examples.
 - See discussion in [#83](https://github.com/mikke89/RmlUi/pull/83) and [#25](https://github.com/mikke89/RmlUi/issues/25).
 - See discussion in [#83](https://github.com/mikke89/RmlUi/pull/83) and [#25](https://github.com/mikke89/RmlUi/issues/25).
 
 
+### Test suite
+
+Work has started on a complete test suite for RmlUi. The tests have been separated into three projects.
+
+- `Visual tests`. For visually testing the layout engine in particular, with small test documents that can be easily added. Includes features for capturing and comparing tests for easily spotting differences during development. A best-effort conversion script for the [CSS 2.1 tests](https://www.w3.org/Style/CSS/Test/CSS2.1/), which includes thousands of tests, to RML/RCSS is included for testing conformance with the CSS specifications.
+- `Unit tests`. To ensure smaller units of the library are working properly.
+- `Benchmarks`. Benchmarking various components of the library to keep track of performance increases or regressions for future development, and find any performance hotspots that could need extra attention.
+
+
 ### Other features and improvements
 ### Other features and improvements
 
 
 - Implemented `Element::QuerySelector` and `Element::QuerySelectorAll`.
 - Implemented `Element::QuerySelector` and `Element::QuerySelectorAll`.
 - Improved the SFML2 sample [#106](https://github.com/mikke89/RmlUi/pull/106) and [#103](https://github.com/mikke89/RmlUi/issues/103) (thanks @hachmeister).
 - Improved the SFML2 sample [#106](https://github.com/mikke89/RmlUi/pull/106) and [#103](https://github.com/mikke89/RmlUi/issues/103) (thanks @hachmeister).
-
+- Implemented the `word-break` RCSS property.
+- Floating elements, absolutely positioned elements, and inline-block elements (as before) will now all shrink to the width of their contents when their width is set to `auto`.
+- Several other layouting improvements (to-be-detailed).
+- `tab-index: auto` can now be set on the `body` element to enable tabbing back to the document.
+- Debugger improvements: Sort property names alphabetically. Fix a bug where the outlines would draw underneath the document.
 
 
 ### Breaking changes
 ### Breaking changes
 
 
 - Namespaces and plugin names changed! See the restructuring changes above.
 - Namespaces and plugin names changed! See the restructuring changes above.
 - It is no longer possible to use `{{` and `}}` inside RML documents outside the context of data bindings.
 - It is no longer possible to use `{{` and `}}` inside RML documents outside the context of data bindings.
 - Attributes starting with `data-` are now reserved for RmlUi.
 - Attributes starting with `data-` are now reserved for RmlUi.
+- The changes to the layout engine may result in changes to the rendered layout in some situations.
 - The `BaseXMLParser` class has some minor interface changes.
 - The `BaseXMLParser` class has some minor interface changes.