Skip to content

Commit cc766d1

Browse files
committed
Merge branch 'master' into issue1007
# Conflicts: # tests/SQLite.Tests.csproj
2 parents 2ed9c77 + f8e0195 commit cc766d1

Some content is hidden

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

53 files changed

+514
-179
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,39 @@ jobs:
1313

1414
- name: Restore NuGets
1515
run: nuget restore SQLite.sln
16-
17-
- name: Build and Test
18-
run: make test
1916

17+
- name: Build and Test
18+
run: |
19+
set -e
20+
cd tests/SQLite.Tests
21+
dotnet test /p:AltCover=true /p:AltCoverForce=true "/p:AltCoverTypeFilter=SQLite.Tests.*"
22+
23+
- name: Generate Code Coverage Report
24+
uses: danielpalme/[email protected]
25+
with:
26+
reports: 'tests/SQLite.Tests/coverage.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
27+
targetdir: 'CoverageReport' # REQUIRED # The directory where the generated report should be saved.
28+
reporttypes: 'HtmlInline;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
29+
sourcedirs: '' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
30+
historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution.
31+
plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon).
32+
assemblyfilters: '+SQLite.Tests;-NUnit3.TestAdapter' # Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.
33+
classfilters: '+*;-SQLite.Tests.*' # Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.
34+
filefilters: '+*' # Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.
35+
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
36+
title: '' # Optional title.
37+
tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version.
38+
customSettings: '' # Optional custom settings (separated by semicolon). See: https://github.com/danielpalme/ReportGenerator/wiki/Settings.
39+
40+
- name: Deploy Code Coverage Report
41+
uses: peaceiris/actions-gh-pages@v3
42+
if: github.event_name == 'push'
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: CoverageReport
46+
destination_dir: coverage
47+
enable_jekyll: true
48+
2049
- name: Package
2150
run: |
2251
make nuget

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
coverage.*
2+
CoverageReport
13
.DS_Store
24
.dropbox.attr
35
test-results

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ basenuget: nuget/SQLite-net-base/SQLite-net-base.csproj $(SRC)
2626

2727
sqlciphernuget: nuget/SQLite-net-sqlcipher/SQLite-net-sqlcipher.csproj $(SRC)
2828
dotnet pack -c Release -o $(PACKAGES_OUT) $<
29+
30+
codecoverage:
31+
cd tests/SQLite.Tests && dotnet test /p:AltCover=true /p:AltCoverForce=true "/p:AltCoverTypeFilter=SQLite.Tests.*" && reportgenerator -reports:coverage.xml -targetdir:./CoverageReport

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# SQLite-net
33

4-
[![Build Status](https://app.bitrise.io/app/bf752c26c31aec6c/status.svg?token=puU-yHhMNdAwJUusm9swlA&branch=master)](https://app.bitrise.io/app/bf752c26c31aec6c)
4+
[[GitHub Action](https://github.com/praeclarum/sqlite-net/actions)] [[Code Coverage Report](https://praeclarum.org/sqlite-net/coverage/)]
55

66
Use one of these packages:
77

SQLite.sln

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
Microsoft Visual Studio Solution File, Format Version 11.00
33
# Visual Studio 2010
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Tests", "tests\SQLite.Tests.csproj", "{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}"
5-
EndProject
64
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A0E59A10-7BD0-4554-B133-66FA850159BE}"
75
ProjectSection(SolutionItems) = preProject
86
sqlite-net-pcl.nuspec = sqlite-net-pcl.nuspec
@@ -25,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-base", "nuget\SQ
2523
EndProject
2624
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-sqlcipher", "nuget\SQLite-net-sqlcipher\SQLite-net-sqlcipher.csproj", "{59DB03EF-E28D-431E-9058-74AF316800EE}"
2725
EndProject
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Tests", "tests\SQLite.Tests\SQLite.Tests.csproj", "{80B66A43-B358-4438-BF06-6351B86B121A}"
27+
EndProject
2828
Global
2929
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3030
Debug|Any CPU = Debug|Any CPU
@@ -35,18 +35,6 @@ Global
3535
Debug|iPhone = Debug|iPhone
3636
EndGlobalSection
3737
GlobalSection(ProjectConfigurationPlatforms) = postSolution
38-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
40-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
41-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Release|Any CPU.Build.0 = Release|Any CPU
42-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
43-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
44-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Release|iPhone.ActiveCfg = Release|Any CPU
45-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Release|iPhone.Build.0 = Release|Any CPU
46-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
47-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
48-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Debug|iPhone.ActiveCfg = Debug|Any CPU
49-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2}.Debug|iPhone.Build.0 = Debug|Any CPU
5038
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
5139
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
5240
{81850129-71C3-40C7-A48B-AA5D2C2E365E}.Release|Any CPU.ActiveCfg = Release|iPhone
@@ -107,11 +95,23 @@ Global
10795
{59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
10896
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
10997
{59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.Build.0 = Debug|Any CPU
98+
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
99+
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.Build.0 = Debug|Any CPU
100+
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.ActiveCfg = Release|Any CPU
101+
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.Build.0 = Release|Any CPU
102+
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
103+
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
104+
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhone.ActiveCfg = Release|Any CPU
105+
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhone.Build.0 = Release|Any CPU
106+
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
107+
{80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
108+
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.ActiveCfg = Debug|Any CPU
109+
{80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.Build.0 = Debug|Any CPU
110110
EndGlobalSection
111111
GlobalSection(NestedProjects) = preSolution
112-
{6947A8F1-99BE-4DD1-AD4D-D89425CE67A2} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
113112
{81850129-71C3-40C7-A48B-AA5D2C2E365E} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
114113
{1DEF735C-B973-4ED9-8446-7FFA6D0B410B} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
114+
{80B66A43-B358-4438-BF06-6351B86B121A} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}
115115
EndGlobalSection
116116
GlobalSection(MonoDevelopProperties) = preSolution
117117
StartupItem = tests\SQLite.Tests.csproj

src/SQLite.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ public CreateTablesResult CreateTables (CreateFlags createFlags = CreateFlags.No
714714
/// <param name="tableName">Name of the database table</param>
715715
/// <param name="columnNames">An array of column names to index</param>
716716
/// <param name="unique">Whether the index should be unique</param>
717+
/// <returns>Zero on success.</returns>
717718
public int CreateIndex (string indexName, string tableName, string[] columnNames, bool unique = false)
718719
{
719720
const string sqlFormat = "create {2} index if not exists \"{3}\" on \"{0}\"(\"{1}\")";
@@ -728,6 +729,7 @@ public int CreateIndex (string indexName, string tableName, string[] columnNames
728729
/// <param name="tableName">Name of the database table</param>
729730
/// <param name="columnName">Name of the column to index</param>
730731
/// <param name="unique">Whether the index should be unique</param>
732+
/// <returns>Zero on success.</returns>
731733
public int CreateIndex (string indexName, string tableName, string columnName, bool unique = false)
732734
{
733735
return CreateIndex (indexName, tableName, new string[] { columnName }, unique);
@@ -739,6 +741,7 @@ public int CreateIndex (string indexName, string tableName, string columnName, b
739741
/// <param name="tableName">Name of the database table</param>
740742
/// <param name="columnName">Name of the column to index</param>
741743
/// <param name="unique">Whether the index should be unique</param>
744+
/// <returns>Zero on success.</returns>
742745
public int CreateIndex (string tableName, string columnName, bool unique = false)
743746
{
744747
return CreateIndex (tableName + "_" + columnName, tableName, columnName, unique);
@@ -750,6 +753,7 @@ public int CreateIndex (string tableName, string columnName, bool unique = false
750753
/// <param name="tableName">Name of the database table</param>
751754
/// <param name="columnNames">An array of column names to index</param>
752755
/// <param name="unique">Whether the index should be unique</param>
756+
/// <returns>Zero on success.</returns>
753757
public int CreateIndex (string tableName, string[] columnNames, bool unique = false)
754758
{
755759
return CreateIndex (tableName + "_" + string.Join ("_", columnNames), tableName, columnNames, unique);
@@ -762,6 +766,7 @@ public int CreateIndex (string tableName, string[] columnNames, bool unique = fa
762766
/// <typeparam name="T">Type to reflect to a database table.</typeparam>
763767
/// <param name="property">Property to index</param>
764768
/// <param name="unique">Whether the index should be unique</param>
769+
/// <returns>Zero on success.</returns>
765770
public int CreateIndex<T> (Expression<Func<T, object>> property, bool unique = false)
766771
{
767772
MemberExpression mx;

src/SQLiteAsync.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ public Task<int> DropTableAsync (TableMapping map)
402402
/// <param name="tableName">Name of the database table</param>
403403
/// <param name="columnName">Name of the column to index</param>
404404
/// <param name="unique">Whether the index should be unique</param>
405+
/// <returns>Zero on success.</returns>
405406
public Task<int> CreateIndexAsync (string tableName, string columnName, bool unique = false)
406407
{
407408
return WriteAsync (conn => conn.CreateIndex (tableName, columnName, unique));
@@ -414,6 +415,7 @@ public Task<int> CreateIndexAsync (string tableName, string columnName, bool uni
414415
/// <param name="tableName">Name of the database table</param>
415416
/// <param name="columnName">Name of the column to index</param>
416417
/// <param name="unique">Whether the index should be unique</param>
418+
/// <returns>Zero on success.</returns>
417419
public Task<int> CreateIndexAsync (string indexName, string tableName, string columnName, bool unique = false)
418420
{
419421
return WriteAsync (conn => conn.CreateIndex (indexName, tableName, columnName, unique));
@@ -425,6 +427,7 @@ public Task<int> CreateIndexAsync (string indexName, string tableName, string co
425427
/// <param name="tableName">Name of the database table</param>
426428
/// <param name="columnNames">An array of column names to index</param>
427429
/// <param name="unique">Whether the index should be unique</param>
430+
/// <returns>Zero on success.</returns>
428431
public Task<int> CreateIndexAsync (string tableName, string[] columnNames, bool unique = false)
429432
{
430433
return WriteAsync (conn => conn.CreateIndex (tableName, columnNames, unique));
@@ -437,6 +440,7 @@ public Task<int> CreateIndexAsync (string tableName, string[] columnNames, bool
437440
/// <param name="tableName">Name of the database table</param>
438441
/// <param name="columnNames">An array of column names to index</param>
439442
/// <param name="unique">Whether the index should be unique</param>
443+
/// <returns>Zero on success.</returns>
440444
public Task<int> CreateIndexAsync (string indexName, string tableName, string[] columnNames, bool unique = false)
441445
{
442446
return WriteAsync (conn => conn.CreateIndex (indexName, tableName, columnNames, unique));
@@ -449,6 +453,7 @@ public Task<int> CreateIndexAsync (string indexName, string tableName, string[]
449453
/// <typeparam name="T">Type to reflect to a database table.</typeparam>
450454
/// <param name="property">Property to index</param>
451455
/// <param name="unique">Whether the index should be unique</param>
456+
/// <returns>Zero on success.</returns>
452457
public Task<int> CreateIndexAsync<T> (Expression<Func<T, object>> property, bool unique = false)
453458
{
454459
return WriteAsync (conn => conn.CreateIndex (property, unique));

tests/SQLite.Tests.csproj

Lines changed: 0 additions & 94 deletions
This file was deleted.

tests/SQLite.Tests.iOS/SQLiteTestsiOS.csproj

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -101,58 +101,13 @@
101101
<ItemGroup>
102102
<Compile Include="Main.cs" />
103103
<Compile Include="UnitTestAppDelegate.cs" />
104-
<Compile Include="..\AsyncTests.cs" />
105-
<Compile Include="..\BooleanTest.cs" />
106-
<Compile Include="..\ByteArrayTest.cs" />
107-
<Compile Include="..\CollateTest.cs" />
108-
<Compile Include="..\ContainsTest.cs" />
109-
<Compile Include="..\CreateTableImplicitTest.cs" />
110-
<Compile Include="..\CreateTableTest.cs" />
111-
<Compile Include="..\DateTimeOffsetTest.cs" />
112-
<Compile Include="..\DateTimeTest.cs" />
113-
<Compile Include="..\DeleteTest.cs" />
114-
<Compile Include="..\DropTableTest.cs" />
115-
<Compile Include="..\EnumCacheTest.cs" />
116-
<Compile Include="..\EnumTest.cs" />
117-
<Compile Include="..\EqualsTest.cs" />
118-
<Compile Include="..\ExceptionAssert.cs" />
119-
<Compile Include="..\GuidTests.cs" />
120-
<Compile Include="..\IgnoreTest.cs" />
121-
<Compile Include="..\InheritanceTest.cs" />
122-
<Compile Include="..\InsertTest.cs" />
123-
<Compile Include="..\JoinTest.cs" />
124-
<Compile Include="..\LinqTest.cs" />
125-
<Compile Include="..\MappingTest.cs" />
126-
<Compile Include="..\MigrationTest.cs" />
127-
<Compile Include="..\NotNullAttributeTest.cs" />
128-
<Compile Include="..\NullableTest.cs" />
129-
<Compile Include="..\OpenTests.cs" />
130-
<Compile Include="..\ScalarTest.cs" />
131-
<Compile Include="..\SkipTest.cs" />
132-
<Compile Include="..\StringQueryTest.cs" />
133-
<Compile Include="..\TableChangedTest.cs" />
134-
<Compile Include="..\TestDb.cs" />
135-
<Compile Include="..\TransactionTest.cs" />
136-
<Compile Include="..\UnicodeTest.cs" />
137-
<Compile Include="..\UniqueTest.cs" />
138-
<Compile Include="..\ConcurrencyTest.cs">
139-
<Link>ConcurrencyTest.cs</Link>
140-
</Compile>
141104
<Compile Include="..\..\src\SQLite.cs">
142105
<Link>SQLite.cs</Link>
143106
</Compile>
144107
<Compile Include="..\..\src\SQLiteAsync.cs">
145108
<Link>SQLiteAsync.cs</Link>
146109
</Compile>
147-
<Compile Include="..\BackupTest.cs">
148-
<Link>BackupTest.cs</Link>
149-
</Compile>
150-
<Compile Include="..\ReadmeTest.cs">
151-
<Link>ReadmeTest.cs</Link>
152-
</Compile>
153-
<Compile Include="..\QueryTest.cs">
154-
<Link>QueryTest.cs</Link>
155-
</Compile>
110+
<Compile Include="..\..\tests\SQLite.Tests\*.cs" />
156111
</ItemGroup>
157112
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
158113
</Project>

0 commit comments

Comments
 (0)