Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ versioned baseline.
before.
- `gui\src\ASWUnitTests_GUI_Sources.cmake`, which lists the GUI runners' shared units as
`ASWUNITTESTS_GUI_SOURCES`.
- A dark theme in the VCL GUI runner, with **View > Theme** to choose it: **Use Windows Setting**
- A dark theme in both GUI runners, with **View > Theme** to choose it: **Use Windows Setting**
(the default) follows Windows' app mode setting, switching as soon as it changes, and **Light**
and **Dark** override it. The choice applies without a restart and is saved in the layout file;
`--layout-ignore` and `--layout-reset` cover it as they do the layout. Dark is RAD Studio's Carbon
VCL style, so a project of your own that runs its tests in the VCL GUI runner needs Carbon among
its custom styles (Project > Options > Application > Appearance) for it, and a `WinMain()` that
applies the saved theme as `vcl\gui\rad370\ASWUnitTests_VCL_GUI.cpp` does.
`--layout-ignore` and `--layout-reset` cover it as they do the layout. In the VCL GUI runner, dark
is RAD Studio's Carbon VCL style, so a project of your own that runs its tests in it needs Carbon
among its custom styles (Project > Options > Application > Appearance) for it, and a `WinMain()`
that applies the saved theme as `vcl\gui\rad370\ASWUnitTests_VCL_GUI.cpp` does. The Win32 GUI
runner paints Carbon's colors itself, so it needs nothing more; its message boxes are its own
dialogs, in its theme, and its tree, results tabs and progress bar are drawn without flicker as
the window is resized.
- An ASWUnitTests icon, `resource\ASWUnitTests.ico`, which this repository's console and GUI
runners now have on Windows, with the PNGs it's made from and `resource\make_icon.ps1`, which
draws them. `ASWUNITTESTS_WIN32_GUI_SOURCES` includes `resource\ASWUnitTests_Icon.rc`, so a Win32
Expand Down Expand Up @@ -132,6 +135,8 @@ versioned baseline.
full. It now shows every finished test, and starts each run empty.
- The VCL GUI runner's tooltips for Run Selected and Copy Details showed their keyboard shortcut
twice, e.g. "(F9) (F9)".
- The VCL GUI runner's status bar cut off its first panel's text, e.g. "Checked: 44 / 44 show", and
now has room for up to "Checked: 9999 / 9999 shown".
- With `--catch-crashes` and `--test-timeout-seconds` together, a crash that came while a test was
logging or recording a result, such as one in a run observer's `OnLog()`, left the run waiting
forever at the next test. The run now continues with the next test, as after any other crash.
Expand Down
24 changes: 24 additions & 0 deletions Deploy.bat
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_DPI.cpp" "win32\gui\src\ASWU
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_DPI.h" "win32\gui\src\ASWUnitTests_Win32GUI_DPI.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Glyphs.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_Glyphs.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Glyphs.h" "win32\gui\src\ASWUnitTests_Win32GUI_Glyphs.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_MainLayout.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_MainLayout.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_MainLayout.h" "win32\gui\src\ASWUnitTests_Win32GUI_MainLayout.h"
Expand All @@ -367,6 +371,14 @@ call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_MainWindow.h" "win32\gui\src
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Manifest.rc" "win32\gui\src\ASWUnitTests_Win32GUI_Manifest.rc"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_MessageDialog.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_MessageDialog.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_MessageDialog.h" "win32\gui\src\ASWUnitTests_Win32GUI_MessageDialog.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Palette.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_Palette.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Palette.h" "win32\gui\src\ASWUnitTests_Win32GUI_Palette.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_ShuffleSeedDialog.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_ShuffleSeedDialog.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_ShuffleSeedDialog.h" "win32\gui\src\ASWUnitTests_Win32GUI_ShuffleSeedDialog.h"
Expand All @@ -385,6 +397,10 @@ call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_TextDialog.cpp" "win32\gui\s
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_TextDialog.h" "win32\gui\src\ASWUnitTests_Win32GUI_TextDialog.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Theme.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_Theme.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Theme.h" "win32\gui\src\ASWUnitTests_Win32GUI_Theme.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_WinMain.cpp" "win32\gui\src\ASWUnitTests_Win32GUI_WinMain.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\gui\src\ASWUnitTests_Win32GUI_Windows.h" "win32\gui\src\ASWUnitTests_Win32GUI_Windows.h"
Expand All @@ -397,10 +413,18 @@ call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_DPI.cpp" "win32\tests\Tes
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_DPI.h" "win32\tests\Test_ASWUnitTests_Win32GUI_DPI.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_Glyphs.cpp" "win32\tests\Test_ASWUnitTests_Win32GUI_Glyphs.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_Glyphs.h" "win32\tests\Test_ASWUnitTests_Win32GUI_Glyphs.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_MainLayout.cpp" "win32\tests\Test_ASWUnitTests_Win32GUI_MainLayout.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_MainLayout.h" "win32\tests\Test_ASWUnitTests_Win32GUI_MainLayout.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_Palette.cpp" "win32\tests\Test_ASWUnitTests_Win32GUI_Palette.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_Palette.h" "win32\tests\Test_ASWUnitTests_Win32GUI_Palette.h"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_System.cpp" "win32\tests\Test_ASWUnitTests_Win32GUI_System.cpp"
if errorlevel 1 exit /b 1
call :CopyFile "win32\tests\Test_ASWUnitTests_Win32GUI_System.h" "win32\tests\Test_ASWUnitTests_Win32GUI_System.h"
Expand Down
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,17 @@ Reset Layout** restores the default layout right away; `--layout-ignore` and `--
(below) control this from the command line. Since the file is named after the executable, the two
GUI runners, and each project's own build of them, keep separate layouts.

In the VCL GUI runner, **View > Theme** chooses a light or dark look. **Use Windows Setting**, the
In both GUI runners, **View > Theme** chooses a light or dark look. **Use Windows Setting**, the
default, follows Windows' app mode setting (Settings > Personalization > Colors), and switches as
soon as it changes, but stays light while high contrast is on, so the window shows high contrast's
own colors. **Light** and **Dark** keep that look whatever Windows is set to. Dark is RAD Studio's
Carbon VCL style, and light the standard Windows look. A choice applies right away and is saved in
the layout file at once, so the next session starts with it; **View > Reset Layout** leaves it as
it is. The Theme commands are disabled during a run, and a change of the Windows setting during one
applies when it ends. The Win32 GUI runner always has the standard Windows look, for now.
own colors. **Light** and **Dark** keep that look whatever Windows is set to. Light is the standard
Windows look. Dark is RAD Studio's Carbon VCL style in the VCL GUI runner, and the Win32 GUI runner
paints the same colors itself. A choice applies right away and is saved in the layout file at once,
so the next session starts with it; **View > Reset Layout** leaves it as it is. The Theme commands
are disabled during a run, and a change of the Windows setting during one applies when it ends. In
the Win32 GUI runner's dark look, the title bar is dark unless Windows shows the accent color on
title bars, which it then keeps while the window is active, and the Export JUnit Report dialog,
Windows' own, stays light.

The window also remembers which tests are checked, in `%APPDATA%\ASWUnitTests\<exe name>.selection`,
as long as the command line doesn't choose them itself (no `--run`, `--filter`, or partition
Expand Down Expand Up @@ -430,12 +433,12 @@ these differences:
- `--exit` (GUI-only, requires `--run`) closes the window when that run finishes, and exits with the
same code the console runner would; a run ended with Stop exits with `1`. Without `--exit`, the
GUI always exits with `0`.
- `--layout-ignore` (GUI-only) neither loads nor saves the window layout, or the VCL GUI runner's
theme, so the window opens with the defaults and the saved ones are left as they are. A theme
chosen in the View menu then lasts only until the window closes.
- `--layout-reset` (GUI-only) deletes the saved window layout, and with it the VCL GUI runner's
theme, and opens with the defaults, which is a way to recover if a saved layout ever causes a
problem. The layout is saved again when the window closes.
- `--layout-ignore` (GUI-only) neither loads nor saves the window layout, or the theme, so the
window opens with the defaults and the saved ones are left as they are. A theme chosen in the View
menu then lasts only until the window closes.
- `--layout-reset` (GUI-only) deletes the saved window layout, and with it the theme, and opens with
the defaults, which is a way to recover if a saved layout ever causes a problem. The layout is
saved again when the window closes.

A GUI process doesn't make a Windows command prompt wait for it, so a script that needs `--exit`'s
exit code should start it with `start /wait` (or its own language's equivalent; Bash, including Git
Expand Down
6 changes: 6 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ if(WIN32)
target_sources(ASWUnitTests PRIVATE
../win32/gui/src/ASWUnitTests_Win32GUI_DialogTemplate.cpp
../win32/gui/src/ASWUnitTests_Win32GUI_DPI.cpp
../win32/gui/src/ASWUnitTests_Win32GUI_Glyphs.cpp
../win32/gui/src/ASWUnitTests_Win32GUI_MainLayout.cpp
../win32/gui/src/ASWUnitTests_Win32GUI_Palette.cpp
../win32/gui/src/ASWUnitTests_Win32GUI_System.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_DialogTemplate.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_DPI.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_Glyphs.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_MainLayout.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_Palette.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_System.cpp
)
target_include_directories(ASWUnitTests PRIVATE
Expand Down Expand Up @@ -126,7 +130,9 @@ if(WIN32)
${ASWUNITTESTS_SELF_TEST_SOURCES}
../win32/tests/Test_ASWUnitTests_Win32GUI_DialogTemplate.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_DPI.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_Glyphs.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_MainLayout.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_Palette.cpp
../win32/tests/Test_ASWUnitTests_Win32GUI_System.cpp
)

Expand Down
9 changes: 4 additions & 5 deletions gui/src/ASWUnitTests_GUI_CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ std::string TGUICommandLine::GUIOptionsHelp()
" returning the same exit code the console runner would.\n"
" Requires --run.\n"
" --layout-ignore Neither load nor save the window layout (its size,\n"
" position, and panel sizes) or the VCL GUI's theme;\n"
" open with the defaults.\n"
" --layout-reset Delete the saved window layout (and the VCL GUI's\n"
" theme) and open with the defaults; the layout is saved\n"
" again on closing.\n"
" position, and panel sizes) or the theme; open with the\n"
" defaults.\n"
" --layout-reset Delete the saved window layout (and the theme) and open\n"
" with the defaults; the layout is saved again on closing.\n"
"\n"
"Ignored by the GUI: --list, --pause, and the color options.\n";
}
Expand Down
7 changes: 3 additions & 4 deletions gui/src/ASWUnitTests_GUI_Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ struct TGUICommandContext
//
// Whether each of a GUI runner's commands is enabled, one member per
// command, named as in the VCL GUI runner's actions (e.g. RunSelected for
// Act_RunSelected), plus the filter box. Theme is the VCL GUI runner's
// View > Theme menu, its three actions together; the Win32 GUI runner has no
// themes yet, so it has no command that uses it.
// Act_RunSelected), plus the filter box. Theme is the GUI runners' View >
// Theme menu, its three commands together.
/////////////////////////////////////////////////////////////////////////////
struct TGUICommandStates
{
Expand Down Expand Up @@ -94,7 +93,7 @@ struct TGUICommandStates
// modal dialog (About, Command Line Options, Shuffle Seed, Export JUnit Report) would hold up the run until
// it closed; the run's tests and order are already decided, so checking tests and changing the shuffle
// would only mislead; changing the filter would rebuild the tree the run is updating; and changing the theme
// would recreate the windows the run is updating.
// would restyle (in the VCL GUI runner, recreate) the windows the run is updating.
// - Run Selected and Run Failed stay disabled once a run has been aborted.
// - Run Failed and Select Failed need a failed test, Export JUnit Report a finished run's report, Copy Details a
// selected node, and Expand All and Collapse All a tree with nodes.
Expand Down
7 changes: 3 additions & 4 deletions gui/src/ASWUnitTests_GUI_Theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ namespace ASWUnitTests
/////////////////////////////////////////////////////////////////////////////
// EGUITheme
//
// A GUI runner's theme, as chosen in the VCL GUI runner's View > Theme menu
// and saved in its layout file. Contains no UI code, so it's unit tested
// from the console runners (see gui/tests/Test_ASWUnitTests_GUI_Theme.cpp).
// The Win32 GUI runner has no themes yet.
// A GUI runner's theme, as chosen in its View > Theme menu and saved in its
// layout file. Contains no UI code, so it's unit tested from the console
// runners (see gui/tests/Test_ASWUnitTests_GUI_Theme.cpp).
/////////////////////////////////////////////////////////////////////////////
enum class EGUITheme
{
Expand Down
2 changes: 1 addition & 1 deletion gui/src/ASWUnitTests_GUI_View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ std::vector<std::string> GUIStatusPanels(TGUITestList const& testList, size_t ru
//---------------------------------------------------------------------------
std::vector<int> GUIStatusPanelWidths()
{
return { 120, 100, 90, 90, 90, 70, 190, 300 };
return { 170, 100, 90, 90, 90, 70, 190, 300 };
}
//---------------------------------------------------------------------------
TTestCaseRecord GUIUnhandledExceptionRecord(TTestId const& test, std::string const& description)
Expand Down
16 changes: 16 additions & 0 deletions rad370/ASWUnitTests.cbproj
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,18 @@
<DependentOn>..\win32\gui\src\ASWUnitTests_Win32GUI_DPI.h</DependentOn>
<BuildOrder>50</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\gui\src\ASWUnitTests_Win32GUI_Glyphs.cpp">
<DependentOn>..\win32\gui\src\ASWUnitTests_Win32GUI_Glyphs.h</DependentOn>
<BuildOrder>60</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\gui\src\ASWUnitTests_Win32GUI_MainLayout.cpp">
<DependentOn>..\win32\gui\src\ASWUnitTests_Win32GUI_MainLayout.h</DependentOn>
<BuildOrder>52</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\gui\src\ASWUnitTests_Win32GUI_Palette.cpp">
<DependentOn>..\win32\gui\src\ASWUnitTests_Win32GUI_Palette.h</DependentOn>
<BuildOrder>62</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\gui\src\ASWUnitTests_Win32GUI_System.cpp">
<DependentOn>..\win32\gui\src\ASWUnitTests_Win32GUI_System.h</DependentOn>
<BuildOrder>48</BuildOrder>
Expand All @@ -372,10 +380,18 @@
<DependentOn>..\win32\tests\Test_ASWUnitTests_Win32GUI_DPI.h</DependentOn>
<BuildOrder>51</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\tests\Test_ASWUnitTests_Win32GUI_Glyphs.cpp">
<DependentOn>..\win32\tests\Test_ASWUnitTests_Win32GUI_Glyphs.h</DependentOn>
<BuildOrder>61</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\tests\Test_ASWUnitTests_Win32GUI_MainLayout.cpp">
<DependentOn>..\win32\tests\Test_ASWUnitTests_Win32GUI_MainLayout.h</DependentOn>
<BuildOrder>53</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\tests\Test_ASWUnitTests_Win32GUI_Palette.cpp">
<DependentOn>..\win32\tests\Test_ASWUnitTests_Win32GUI_Palette.h</DependentOn>
<BuildOrder>63</BuildOrder>
</CppCompile>
<CppCompile Include="..\win32\tests\Test_ASWUnitTests_Win32GUI_System.cpp">
<DependentOn>..\win32\tests\Test_ASWUnitTests_Win32GUI_System.h</DependentOn>
<BuildOrder>49</BuildOrder>
Expand Down
2 changes: 1 addition & 1 deletion vcl/gui/src/ASWUnitTests_GUI_MainForm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ object FormASWUnitTestsGUIMain: TFormASWUnitTestsGUIMain
Height = 19
Panels = <
item
Width = 120
Width = 170
end
item
Width = 100
Expand Down
Loading
Loading