Added hop, fixes for sample_test
diff --git a/pubspec.yaml b/pubspec.yaml
index a396681..8fa754f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -9,5 +9,6 @@
http_parser: '>=0.0.2 <0.1.0'
shelf: '>=0.5.0 <0.6.0'
dev_dependencies:
+ hop: '>=0.30.4 <0.31.0'
path: '>=1.1.0 <2.0.0'
scheduled_test: '>=0.11.0 <0.12.0'
diff --git a/test/alternative_root_test.dart b/test/alternative_root_test.dart
index 9de8c85..3acf750 100644
--- a/test/alternative_root_test.dart
+++ b/test/alternative_root_test.dart
@@ -1,4 +1,4 @@
-library shelf_static.basic_file_test;
+library shelf_static.alternative_root_test;
import 'dart:io';
import 'package:scheduled_test/descriptor.dart' as d;
diff --git a/test/harness_console.dart b/test/harness_console.dart
new file mode 100644
index 0000000..98a0821
--- /dev/null
+++ b/test/harness_console.dart
@@ -0,0 +1,14 @@
+library shelf_static.harness_console;
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import 'alternative_root_test.dart' as alternative_root;
+import 'basic_file_test.dart' as basic_file;
+import 'sample_test.dart' as sample;
+
+void main() {
+ groupSep = ' - ';
+ group('alternative_root', alternative_root.main);
+ group('basic_file', basic_file.main);
+ group('sample', sample.main);
+}
diff --git a/test/sample_test.dart b/test/sample_test.dart
index 3332dc6..a91931c 100644
--- a/test/sample_test.dart
+++ b/test/sample_test.dart
@@ -1,4 +1,4 @@
-library shelf_static.basic_file_test;
+library shelf_static.sample_test;
import 'dart:async';
import 'dart:io';
@@ -55,8 +55,7 @@
}
String get _samplePath {
- var scriptDir = p.dirname(p.fromUri(Platform.script));
- var sampleDir = p.join(scriptDir, 'sample_files');
+ var sampleDir = p.join(p.current, 'test', 'sample_files');
assert(FileSystemEntity.isDirectorySync(sampleDir));
return sampleDir;
}
diff --git a/tool/hop_runner.dart b/tool/hop_runner.dart
new file mode 100644
index 0000000..10cc17b
--- /dev/null
+++ b/tool/hop_runner.dart
@@ -0,0 +1,28 @@
+library hop_runner;
+
+import 'dart:async';
+import 'dart:io';
+import 'package:hop/hop.dart';
+import 'package:hop/hop_tasks.dart';
+import '../test/harness_console.dart' as test_console;
+
+void main(List<String> args) {
+ addTask('test', createUnitTestTask(test_console.main));
+
+ //
+ // Analyzer
+ //
+ addTask('analyze_libs', createAnalyzerTask(_getLibs));
+
+ addTask('analyze_test_libs', createAnalyzerTask(
+ ['test/harness_console.dart']));
+
+ runHop(args);
+}
+
+Future<List<String>> _getLibs() {
+ return new Directory('lib').list()
+ .where((FileSystemEntity fse) => fse is File)
+ .map((File file) => file.path)
+ .toList();
+}