mirror of https://github.com/AMT-Cheif/drift.git
Run the integration tests on the VM backend
This commit is contained in:
parent
05b84a21ef
commit
7ab63c0862
|
@ -0,0 +1,11 @@
|
|||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.packages
|
||||
# Remove the following pattern if you wish to check in your lock file
|
||||
pubspec.lock
|
||||
|
||||
# Conventional directory for build outputs
|
||||
build/
|
||||
|
||||
# Directory created by dartdoc
|
||||
doc/api/
|
|
@ -0,0 +1,15 @@
|
|||
name: vm
|
||||
description: A sample command-line application.
|
||||
# version: 1.0.0
|
||||
# homepage: https://www.example.com
|
||||
# author: Simon Binder <oss@simonbinder.eu>
|
||||
|
||||
environment:
|
||||
sdk: '>=2.4.0 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
tests:
|
||||
path: ../tests
|
||||
|
||||
dev_dependencies:
|
||||
test: ^1.5.0
|
|
@ -0,0 +1,27 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:moor/moor_vm.dart';
|
||||
import 'package:tests/tests.dart';
|
||||
|
||||
import 'package:path/path.dart' show join;
|
||||
|
||||
class VmExecutor extends TestExecutor {
|
||||
static String fileName = 'moor-vm-tests-${DateTime.now().toIso8601String()}';
|
||||
final file = File(join(Directory.systemTemp.path, fileName));
|
||||
|
||||
@override
|
||||
QueryExecutor createExecutor() {
|
||||
return VMDatabase(file);
|
||||
}
|
||||
|
||||
@override
|
||||
Future deleteData() async {
|
||||
if (await file.exists()) {
|
||||
await file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
runAllTests(VmExecutor());
|
||||
}
|
Loading…
Reference in New Issue