Flutter 驱动程序:找不到测试文件

Flutter Driver: Test file not found

我正在尝试 运行 flutter drive --target=test_driver/app.dart,但出现错误:

Target file "test_driver/app.dart" not found.

所以我将路径更改为 flutter drive --target=lib/test_driver/app.dart,但出现错误:

Using device sdk gphone x86 arm.
Test file not found: /home/user/Documents/dev/flutter-app/test_driver/test_driver/app_test.dart.

这是我的项目结构:

flutter-app/
  lib/
    test_driver/
      app.dart
      app_test.dart

为什么找不到测试文件?

Flutter 驱动程序期望 test_driver 目录是项目根目录的直接子目录。所以我将它移到了 lib/ 之外,并解决了这个问题。