Skip to content

Commit d703ba9

Browse files
committed
Merge branch 'release/2.0.1'
2 parents 01f50a2 + ae9b5bb commit d703ba9

File tree

79 files changed

+9241
-12
lines changed

Some content is hidden

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

79 files changed

+9241
-12
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
# Database release folder
2+
13
_release
4+
5+
# Delphi test code
6+
*.local
7+
*.identcache
8+
_build
9+
__history

csdb/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ From v2.0.0 all notable changes to this project will be documented in this file.
88
99
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1010

11+
## v2.0.1 of 2021/10/12
12+
13+
* Add new unit tests and demo code for _some_ snippets from the database. All such code was added to a new `tests` directory. See `tests/README.md` for details.
14+
* Fix minor errors in documentation.
15+
16+
> Other than to update the `VERSION` file there were no changes to any snippets or associated meta-data in this release.
17+
1118
## v2.0.0 of 2020/05/02
1219

1320
Initial release of v2 of the collection.

csdb/MakeRelease.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#
66
# Build tool for Windows to package up files ready for release.
77
#
8-
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
9-
# https://gravatar.com/delphidabbler
8+
# This file is licensed under the MIT license, copyright © 2020-2021 Peter
9+
# Johnson, https://gravatar.com/delphidabbler
1010
#
1111
#
1212
# Two packages are made, each in a zip file: one containing the collection and
@@ -32,6 +32,7 @@ RELEASE_FILE_STUB="${RELEASE_DIR}/csdb-v${VERSION}"
3232

3333
COLLECTION_ZIP_FILE="${RELEASE_FILE_STUB}-data.zip"
3434
DOCS_ZIP_FILE="${RELEASE_FILE_STUB}-docs.zip"
35+
TESTS_ZIP_FILE="${RELEASE_FILE_STUB}-tests.zip"
3536

3637
echo Creating CSDB release $1
3738
echo
@@ -45,4 +46,7 @@ zip -j -q $COLLECTION_ZIP_FILE ./collection/*
4546
echo Zipping documentation
4647
zip -j -q $DOCS_ZIP_FILE ./docs/*
4748

49+
echo Zipping tests
50+
zip -q -r $TESTS_ZIP_FILE ./tests/*
51+
4852
echo Done

csdb/README.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,29 @@ Version 2 is designed to be able to be used by other applications in addition to
1616

1717
Anyone is welcome to write applications or web pages that access the snippets in the collection, subject to the terms of the license (see below). You should read the collection's documentation which explains the file format in detail.
1818

19-
> **WARNING:** Implementors **must not** read the collection data directly from this GitHub repository - that could generate more than the permitted amount of traffic. Instead you must download a release from the _Releases_ tab and either distribute the collection with the application or host it on a web server.
19+
> **WARNING:** Implementers **must not** read the collection data directly from this GitHub repository - that could generate more than the permitted amount of traffic. Instead you must download a release from the _Releases_ tab and either distribute the collection with the application or host it on a web server.
2020
2121
## Documentation
2222

2323
The collection data format is fully documented in the file `collection-format.html` in the `docs` directory.
2424

25+
## Tests
26+
27+
Unit tests and demonstration projects are available for _some_ of the snippets in the database.
28+
29+
Source code for these tests and demonstrations is available in the `tests` directory. There is a sub-directory for each category where such code is available.
30+
31+
See the `README.md` file in the `tests` directory for full details.
32+
2533
## Releases
2634

2735
Releases can be found on the `releases` tab on the GitHub project page.
2836

29-
Each release comprises two zip files, as follows (replace `X.Y.X` in the file names with the release version number):
37+
From v2.0.1, each release comprises three zip files, as follows (replace `X.Y.X` in the file names with the release version number):
3038

31-
* `csdb-vX.Y.Z-data.zip` - Contains all the data in the collection. Required by applications that access the collection.
32-
* `csdb-vX.Y.Z-docs.zip` - Contains the documentation developers need to understand the structure of the data.
39+
* `csdb-vX.Y.Z-data.zip` - Contains all the data in the collection. Required by applications that access the collection.
40+
* `csdb-vX.Y.Z-docs.zip` - Contains the documentation developers need to understand the structure of the data.
41+
* `csdb-vX.Y.Z-tests.zip` - Contains the unit tests and demo code.
3342

3443
## Change Log
3544

@@ -39,4 +48,6 @@ The project's change log can be found in `CHANGELOG.md` in the collection's base
3948

4049
All snippets in this collection (stored in `.dat` files in the `collections` directory) are licensed under the MIT license and are copyright © 2005-2020, [Peter Johnson](https://gravatar.com/delphidabbler) and Contributors. The full license and a list of contributors can be found in the `LICENSE` and `CONTRIBUTORS` files in the `collection` sub-directory.
4150

42-
All other files in this project are licensed under the MIT license and are copyright © 2020, [Peter Johnson](https://gravatar.com/delphidabbler).
51+
Certain files in the `tests` directory contain copies of snippets extracted from the collection. These files are identified as such in the comments at the start of the file. The files are licensed under the same license as the `.dat` files in the `collections` directory. See the paragraph above for details.
52+
53+
All other files in this project are licensed under the MIT license and are copyright © 2020-2021, [Peter Johnson](https://gravatar.com/delphidabbler).

csdb/collection/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.0.1

csdb/docs/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!DOCTYPE HTML>
22

33
<!--
4-
* This file copyright (C) 2020, Peter Johnson (gravatar.com/delphidabbler) and
5-
* is licensed under the MIT License: https://opensource.org/licenses/MIT
4+
* This file copyright (C) 2020-2021, Peter Johnson (gravatar.com/delphidabbler)
5+
* and is licensed under the MIT License: https://opensource.org/licenses/MIT
66
*
77
* DelphiDabbler Code Snippets Database Documentation: REML markup language
88
* documentation.
@@ -19,11 +19,11 @@
1919
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
2020
<![endif]-->
2121
<meta name="author" content="Peter Johnson - https://en.gravatar.com/delphidabbler">
22-
<meta name="description" content="DelphiDabbler Code Snippets collection documentation - REML markup language">
22+
<meta name="description" content="DelphiDabbler Code Snippets collection documentation">
2323
<link rel="stylesheet" href="main.css">
2424

2525
<title>
26-
DelphiDabbler Code Snippets Database Docs - REML
26+
DelphiDabbler Code Snippets Database Docs
2727
</title>
2828

2929
</head>
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
program TestArraysCat;
2+
{
3+
4+
Delphi DUnit Test Project
5+
-------------------------
6+
This project contains the DUnit test framework and the GUI/Console test runners.
7+
Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
8+
to use the console test runner. Otherwise the GUI test runner will be used by
9+
default.
10+
11+
}
12+
13+
{$IFDEF CONSOLE_TESTRUNNER}
14+
{$APPTYPE CONSOLE}
15+
{$ENDIF}
16+
17+
uses
18+
Forms,
19+
TestFramework,
20+
GUITestRunner,
21+
TextTestRunner,
22+
UArraysCatSnippets in 'UArraysCatSnippets.pas',
23+
TestUArraysCatSnippets in 'TestUArraysCatSnippets.pas';
24+
25+
{$R *.RES}
26+
27+
begin
28+
Application.Initialize;
29+
if IsConsole then
30+
with TextTestRunner.RunRegisteredTests do
31+
Free
32+
else
33+
GUITestRunner.RunRegisteredTests;
34+
end.
35+
+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<ProjectGuid>{6FB9EE44-A094-4BB5-94FF-FECE97F6CD13}</ProjectGuid>
4+
<ProjectVersion>12.0</ProjectVersion>
5+
<Config Condition="'$(Config)'==''">Debug</Config>
6+
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
7+
<MainSource>TestArraysCat.dpr</MainSource>
8+
</PropertyGroup>
9+
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
10+
<Base>true</Base>
11+
</PropertyGroup>
12+
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
13+
<Cfg_1>true</Cfg_1>
14+
<CfgParent>Base</CfgParent>
15+
<Base>true</Base>
16+
</PropertyGroup>
17+
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
18+
<Cfg_2>true</Cfg_2>
19+
<CfgParent>Base</CfgParent>
20+
<Base>true</Base>
21+
</PropertyGroup>
22+
<PropertyGroup Condition="'$(Base)'!=''">
23+
<DCC_ExeOutput>_build\Exe</DCC_ExeOutput>
24+
<DCC_UnitSearchPath>$(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
25+
<DCC_Define>_CONSOLE_TESTRUNNER;$(DCC_Define)</DCC_Define>
26+
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
27+
<DCC_DcuOutput>_build\Bin\Cat-Arrays</DCC_DcuOutput>
28+
<DCC_DependencyCheckOutputName>_build\Exe\TestArraysCat.exe</DCC_DependencyCheckOutputName>
29+
<DCC_ImageBase>00400000</DCC_ImageBase>
30+
<DCC_Platform>x86</DCC_Platform>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="'$(Cfg_1)'!=''">
33+
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
34+
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
35+
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
36+
<DCC_DebugInformation>false</DCC_DebugInformation>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Cfg_2)'!=''">
39+
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
40+
</PropertyGroup>
41+
<ItemGroup>
42+
<DelphiCompile Include="TestArraysCat.dpr">
43+
<MainSource>MainSource</MainSource>
44+
</DelphiCompile>
45+
<DCCReference Include="UArraysCatSnippets.pas"/>
46+
<DCCReference Include="TestUArraysCatSnippets.pas"/>
47+
<BuildConfiguration Include="Base">
48+
<Key>Base</Key>
49+
</BuildConfiguration>
50+
<BuildConfiguration Include="Debug">
51+
<Key>Cfg_2</Key>
52+
<CfgParent>Base</CfgParent>
53+
</BuildConfiguration>
54+
<BuildConfiguration Include="Release">
55+
<Key>Cfg_1</Key>
56+
<CfgParent>Base</CfgParent>
57+
</BuildConfiguration>
58+
</ItemGroup>
59+
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
60+
<ProjectExtensions>
61+
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
62+
<Borland.ProjectType/>
63+
<BorlandProject>
64+
<Delphi.Personality>
65+
<Parameters>
66+
<Parameters Name="UseLauncher">False</Parameters>
67+
<Parameters Name="LoadAllSymbols">True</Parameters>
68+
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
69+
</Parameters>
70+
<VersionInfo>
71+
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
72+
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
73+
<VersionInfo Name="MajorVer">1</VersionInfo>
74+
<VersionInfo Name="MinorVer">0</VersionInfo>
75+
<VersionInfo Name="Release">0</VersionInfo>
76+
<VersionInfo Name="Build">0</VersionInfo>
77+
<VersionInfo Name="Debug">False</VersionInfo>
78+
<VersionInfo Name="PreRelease">False</VersionInfo>
79+
<VersionInfo Name="Special">False</VersionInfo>
80+
<VersionInfo Name="Private">False</VersionInfo>
81+
<VersionInfo Name="DLL">False</VersionInfo>
82+
<VersionInfo Name="Locale">2057</VersionInfo>
83+
<VersionInfo Name="CodePage">1252</VersionInfo>
84+
</VersionInfo>
85+
<VersionInfoKeys>
86+
<VersionInfoKeys Name="CompanyName"/>
87+
<VersionInfoKeys Name="FileDescription"/>
88+
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
89+
<VersionInfoKeys Name="InternalName"/>
90+
<VersionInfoKeys Name="LegalCopyright"/>
91+
<VersionInfoKeys Name="LegalTrademarks"/>
92+
<VersionInfoKeys Name="OriginalFilename"/>
93+
<VersionInfoKeys Name="ProductName"/>
94+
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
95+
<VersionInfoKeys Name="Comments"/>
96+
</VersionInfoKeys>
97+
<Source>
98+
<Source Name="MainSource">TestArraysCat.dpr</Source>
99+
</Source>
100+
</Delphi.Personality>
101+
<UnitTesting>
102+
<TestFramework>DUnit / Delphi Win32</TestFramework>
103+
<TestRunner>GUI</TestRunner>
104+
</UnitTesting>
105+
</BorlandProject>
106+
<ProjectFileVersion>12</ProjectFileVersion>
107+
</ProjectExtensions>
108+
</Project>
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
program TestArraysCatXE;
2+
{
3+
4+
Delphi DUnit Test Project
5+
-------------------------
6+
This project contains the DUnit test framework and the GUI/Console test runners.
7+
Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
8+
to use the console test runner. Otherwise the GUI test runner will be used by
9+
default.
10+
11+
}
12+
13+
{$IFDEF CONSOLE_TESTRUNNER}
14+
{$APPTYPE CONSOLE}
15+
{$ENDIF}
16+
17+
uses
18+
Forms,
19+
TestFramework,
20+
GUITestRunner,
21+
TextTestRunner,
22+
UArraysCatSnippets in 'UArraysCatSnippets.pas',
23+
TestUArraysCatSnippets in 'TestUArraysCatSnippets.pas';
24+
25+
{$R *.RES}
26+
27+
begin
28+
Application.Initialize;
29+
if IsConsole then
30+
with TextTestRunner.RunRegisteredTests do
31+
Free
32+
else
33+
GUITestRunner.RunRegisteredTests;
34+
end.
35+

0 commit comments

Comments
 (0)