yanglint TEST tcl tests work on Windows
diff --git a/tools/lint/tests/common.tcl b/tools/lint/tests/common.tcl
index ed60463..0cebd0d 100644
--- a/tools/lint/tests/common.tcl
+++ b/tools/lint/tests/common.tcl
@@ -5,12 +5,25 @@
# the script is not run via 'ctest' so paths must be set
set ::env(TESTS_DIR) "../"
set ::env(YANG_MODULES_DIR) "../modules"
- set ::env(YANGLINT) "../../../../build/yanglint"
+ set ::env(YANGLINT) "../../../../build"
::tcltest::testConstraint ctest false
} else {
::tcltest::testConstraint ctest true
}
+# Complete the path for yanglint. For example, on Windows, yanglint can be located in the Debug or Release subdirectory.
+# Note that Release build takes precedence over Debug.
+set conftypes {{} Release Debug E}
+foreach i $conftypes {
+ if { [file executable "$::env(YANGLINT)/$i/yanglint"] || [file executable "$::env(YANGLINT)/$i/yanglint.exe"] } {
+ append ::env(YANGLINT) "/$i/yanglint"
+ break
+ }
+}
+if { $i == "E" } {
+ error "yanglint executable not found"
+}
+
# prompt of error message
set error_prompt ">>>"
# the beginning of error message