| <!DOCTYPE html> |
| <html> |
| <meta charset=utf-8> |
| <meta name="timeout" content="long"> |
| <title>Test the WHLSL test harness.</title> |
| <script src="js/test-harness.js"></script> |
| <script src="../js/webgpu-functions.js"></script> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script> |
| |
| const whlslTests = {}; |
| |
| whlslTests.typeMismatchReturn = async () => |
| { |
| await checkFail( |
| ` |
| int foo() |
| { |
| return 10.5; |
| } |
| `); |
| } |
| |
| whlslTests.typeMismatchVariableDecl = async () => |
| { |
| await checkFail( |
| ` |
| void foo(uint x) |
| { |
| int y = x; |
| } |
| `); |
| } |
| |
| whlslTests.typeMismatchAssignment = async () => |
| { |
| await checkFail( |
| ` |
| void foo(uint x) |
| { |
| int y; |
| y = x; |
| } |
| `); |
| } |
| |
| whlslTests.typeMismatchReturnParam = async () => |
| { |
| await checkFail( |
| ` |
| int foo(uint x) |
| { |
| return x; |
| } |
| `); |
| } |
| |
| runTests(whlslTests); |
| |
| </script> |
| </html> |