Skip to content

Commit 6751bf2

Browse files
committed
Better skips for shared cache tests
1 parent d22f4c3 commit 6751bf2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

sqlite3/test/common/database.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import 'utils.dart';
1010
void testDatabase(
1111
FutureOr<CommonSqlite3> Function() loadSqlite, {
1212
bool hasColumnMetadata = false,
13+
bool hasSharedCache = false,
1314
}) {
1415
late CommonSqlite3 sqlite3;
1516
late CommonDatabase database;
@@ -327,7 +328,7 @@ void testDatabase(
327328
final result = db2.select('SELECT * FROM tbl');
328329
expect(result, hasLength(3));
329330
},
330-
skip: 'Broken with native assets, to investigate',
331+
skip: hasSharedCache ? null : 'Test requires shared cache',
331332
);
332333

333334
test('locked exceptions', () {
@@ -343,7 +344,7 @@ void testDatabase(
343344
() => db2.execute('BEGIN EXCLUSIVE TRANSACTION'),
344345
throwsSqlError(SqlError.SQLITE_LOCKED, 262),
345346
);
346-
}, skip: 'Broken with native assets, to investigate');
347+
}, skip: hasSharedCache ? null : 'Test requires shared cache');
347348

348349
test('result sets are lists', () {
349350
final result = database.select('SELECT 1, 2 UNION ALL SELECT 3, 4;');

sqlite3/test/ffi/common_database_test.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ import '../common/session.dart';
1010
void main() {
1111
final hasColumnMeta = sqlite3.usedCompileOption('ENABLE_COLUMN_METADATA');
1212
final hasSession = sqlite3.usedCompileOption('ENABLE_SESSION');
13+
final hasSharedCache = !sqlite3.usedCompileOption('OMIT_SHARED_CACHE');
1314

14-
testDatabase(() => sqlite3, hasColumnMetadata: hasColumnMeta);
15+
testDatabase(
16+
() => sqlite3,
17+
hasColumnMetadata: hasColumnMeta,
18+
hasSharedCache: hasSharedCache,
19+
);
1520

1621
group('session', () {
1722
testSession(() => sqlite3);

0 commit comments

Comments
 (0)