Run the integration tests on the VM backend

This commit is contained in:
Simon Binder 2019-07-24 22:21:52 +02:00
parent 05b84a21ef
commit 7ab63c0862
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
3 changed files with 53 additions and 0 deletions

11
extras/integration_tests/vm/.gitignore vendored Normal file
View File

@ -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/

View File

@ -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

View File

@ -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());
}