| |
@@ -0,0 +1,31 @@
|
| |
+ #!/usr/bin/bash
|
| |
+
|
| |
+ function run() {
|
| |
+ # Function to show the command line it will execute,
|
| |
+ # otherwise it only shows command output
|
| |
+ if [[ -z $1 ]]; then
|
| |
+ echo "run() requires command as argument"
|
| |
+ return 1
|
| |
+ fi
|
| |
+ echo "Running: $1"
|
| |
+ eval $1
|
| |
+ return $?
|
| |
+ }
|
| |
+
|
| |
+ test_path=$(readlink -f $0)
|
| |
+ tests_dir=$(dirname $test_path)
|
| |
+ # Use the directory above tests to search for yaml files
|
| |
+ source_dir=$(dirname $tests_dir)
|
| |
+
|
| |
+ # We can make it more strict later, like yamllint -d '{extends: default, rules: {line-length: {max: 120}, indentation: disable, document-start: {level: error}}}'
|
| |
+ cmd="yamllint -d '{extends: default, rules: {line-length: {max: 120}, indentation: disable}}' ${source_dir}"
|
| |
+
|
| |
+ run "${cmd}"
|
| |
+ error=$?
|
| |
+
|
| |
+ if [[ ${error} -ne 0 ]]; then
|
| |
+ echo "FAIL: problem with yaml syntax"
|
| |
+ exit 1
|
| |
+ fi
|
| |
+
|
| |
+ exit 0
|
| |