Commit Graph

10 Commits

Author SHA1 Message Date
Ben Clayton a70c14dbce main: Replace --dawn-validation with --validate
Performs output validation with spirv-val for SPIR-V (as before), HLSL
validation with DXC, and MSL validation with the Metal Shader Compiler.

Disable HLSL tests that fail to validate

Bug: tint:812
Change-Id: If78c351b4e23c7fb50d333eacf9ee7cc81d18564
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51280
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-06-02 21:02:34 +00:00
James Price b39d776506 tools/test-all.sh: Fix usage info
Change-Id: I7807cb372e5b278397a37fe3e685a6a919b278e4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51380
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-05-18 17:06:18 +00:00
Ben Clayton 57b2a06ba7 tools/test-all.sh: Reimplement in golang
Makes future development easier.

New features:
* A more compact and cleaner results view
* Concurrent testing, much quicker across multiple cores
* Supports comparing output against an expected file, including a text diff of differences. Also has a flag for updating the expected outputs
* Advanced file-globbing support, including scanning for files in subdirectories
* Skip lists are now no longer hidden away in the tool, but defined as a SKIP header in the *.expected.* file

Change-Id: I4fac80bb084a720ec9a307b4acf9f73792973a1d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50903
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-05-14 19:48:43 +00:00
David Neto 7e55817552 test-all.sh: Rework use of directory argument
If a directory is specified, then check shader source files there.
Otherwise, use shader source files in the same directory as the test
script.

Enhance error checking and messages.

Change-Id: I6ea40e2a44128ba3ce103faaad5326b89bbf4ed7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49841
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-05-07 17:42:34 +00:00
David Neto 01c3ce7c03 test-all: allow specification of one output format
It's the second argument
This moves the subdirectory argument to the third position.

Change-Id: I91f7a8171f6de51e697a04c1407a1992b5c1c0db
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49642
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-05-05 15:45:42 +00:00
David Neto 58a3624935 Add --dump-spirv option to tint_unittests
The --dump-spirv option tells tint_unittests to output the
SPIR-V assembly text for a module which did not make the SPIR-V reader
fail.  This lets us get extract a corpus of SPIR-V modules, and
lets us more easily verify that the test shaders are valid in the first
place.

Also:
- Add test/extract-spvasm.py to split that output to separate SPIR-V
  assembly files
- Add optional second argument test/test-all.sh to specify a directory
  look for input files.
- BUILD.gn:  Add dependency from //test:tint_unittests_main to
  //test:tint_unittests_config to pick up source dependency on
  the internal header of the SPIRV-Tools optimizer, needed by
  the indirection through src/reader/spirv/parser_impl_test_helper.h

This is useful for bulk testing

Fixed: tint:756
Change-Id: I4fe232ac736003f7d9be35544328302d652381ea
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49605
Auto-Submit: David Neto <dneto@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-05-05 09:46:31 +00:00
David Neto 77a7518c95 Add fallback when realpath doesn't exist
Fixed: tint:763
Change-Id: Id5b687faea82d3e77b8e98607913640fffef6af7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49620
Auto-Submit: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-04-30 19:49:39 +00:00
Ben Clayton 275eb7e4e4 reader/spirv: Clean up disjoint AST nodes
Perform a program clone at the end of parsing to remove any unreachable AST nodes.
Actually fixing the parser to never create these looks like a huge amount of work.

Fixed: tint:749
Change-Id: Ib956634257e0933c9702d6be22f79942f7cf4c51
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49520
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-04-30 10:43:19 +00:00
Ben Clayton 6e2ed30be3 test: Add simple_vertex.spvasm
Update test-all.sh to grep for and test spvasm files.

Bug: tint:740
Change-Id: Ic43faeda35b0b1fd98e42dac2f8a515f118c5ce7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48690
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-04-26 10:46:55 +00:00
Ben Clayton 8b53104c20 Add test/test-all.sh
Checks that all the .wgsl test files actually compile with tint

Change-Id: Iea31f0f58fe0580fca55b07cf3b3ffc24cebcf9d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44870
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2021-03-17 18:49:03 +00:00