munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.75k stars 1.03k forks source link

Using test.dart results in "Unhandled exception" error. #1003

Closed cm1776 closed 1 year ago

cm1776 commented 2 years ago

When I run any of the following commands, I get an "Unhandled exception" error:

` D:\ci>dart tool\bin\test.dart clox --interpreter custom\clox.exe

Passed: 0 Failed: 0 Skipped: 0 (.\test\assignment\associativity.lox)Unhandled exception: Unknown test state for '.\test\assignment\associativity.lox'.

0 Test.parse (file:///D:/ci/tool/bin/test.dart:224:7)

1 _runTest (file:///D:/ci/tool/bin/test.dart:160:13)

2 _runSuite (file:///D:/ci/tool/bin/test.dart:121:5)

3 main (file:///D:/ci/tool/bin/test.dart:87:15)

4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:281:32)

5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

D:\ci>dart tool\bin\test.dart clox --interpreter custom\

Passed: 0 Failed: 0 Skipped: 0 (.\test\assignment\associativity.lox)Unhandled exception: Unknown test state for '.\test\assignment\associativity.lox'.

0 Test.parse (file:///D:/ci/tool/bin/test.dart:224:7)

1 _runTest (file:///D:/ci/tool/bin/test.dart:160:13)

2 _runSuite (file:///D:/ci/tool/bin/test.dart:121:5)

3 main (file:///D:/ci/tool/bin/test.dart:87:15)

4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:281:32)

5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

D:\ci>dart tool\bin\test.dart clox --interpreter custom

Passed: 0 Failed: 0 Skipped: 0 (.\test\assignment\associativity.lox)Unhandled exception: Unknown test state for '.\test\assignment\associativity.lox'.

0 Test.parse (file:///D:/ci/tool/bin/test.dart:224:7)

1 _runTest (file:///D:/ci/tool/bin/test.dart:160:13)

2 _runSuite (file:///D:/ci/tool/bin/test.dart:121:5)

3 main (file:///D:/ci/tool/bin/test.dart:87:15)

4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:281:32)

5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

D:\ci> `

Dart Version Information D:\ci>dart --version Dart SDK version: 2.14.1 (stable) (Wed Sep 8 13:33:08 2021 +0200) on "windows_x64"

Operating System Windows 10 Version 21H1

Important Note: I am running the canonical clox (not my own implementation) and when I run it against one of the test programs, I have no problems. For example:

` D:\ci>custom\clox test\assignment\associativity.lox c c c

D:\ci> `

imaculate commented 2 years ago

I'm running into the same issue when I run make test_jlox or make test_clox

cm1776 commented 1 year ago

Got around the problem by Installing Ubuntu 20.04 under Windows Subsystem for Linux (WSL2) and doing all the following in the Ubuntu environment:

  1. Installed GCC (gnu c compiler). For details, do a search on "Installing GCC on Ubuntu 20.04"
  2. Installed OpenJDK 17.
  3. Followed, line by line, all the instructions at Building Stuff.
  4. Followed, line by line, all the instructions at Testing

All the tests on the canonical implementations of jlox and clox ran OK (all tests passed).

In consequence of all the above, I am closing this issue.