[tools][run-cts] Improve error diagnostics when npx is not found
Change-Id: I1ec200c25ef4d8915b7c41bb4c764ab0a2134ac9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/187500
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
diff --git a/tools/src/cmd/run-cts/common/builder.go b/tools/src/cmd/run-cts/common/builder.go
index 7f4b904..14bc5b9 100644
--- a/tools/src/cmd/run-cts/common/builder.go
+++ b/tools/src/cmd/run-cts/common/builder.go
@@ -47,7 +47,7 @@
// BuildIfRequired calls Build() if the CTS sources have been modified since the last build.
func (b *Builder) BuildIfRequired(verbose bool) error {
- name := fmt.Sprintf("CTS-%v", b.Name)
+ name := fmt.Sprintf("cts %v", b.Name)
// Scan the CTS source to determine the most recent change to the CTS source
mostRecentSourceChange, err := scanSourceTimestamps(filepath.Join(b.Out, "../src"), verbose)
@@ -117,6 +117,10 @@
return err
}
+ if !fileutils.IsExe(b.npx) {
+ return fmt.Errorf("cannot find npx at '%v'", b.npx)
+ }
+
for _, action := range []string{"run:generate-version", b.Name} {
cmd := exec.Command(b.npx, "grunt", action)
cmd.Dir = b.CTS