Skip to content

Commit

Permalink
make: fix too lax loops in make cli-test and make examples (#140)
Browse files Browse the repository at this point in the history
* fix too lax `make cli-test` and `make examples` (make them fail, if any of the steps in their loops fail)
* fix notice in vsql/sql_test.v
* panic instead of continue, when connection_name is not found in connections
  • Loading branch information
spytheman authored Feb 12, 2023
1 parent 47b87bf commit 0b6acad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ sql-test:

cli-test: bin/vsql
for f in `ls cmd/tests/*.sh`; do \
VSQL=bin/vsql ./$$f ; \
echo $$f; VSQL=bin/vsql ./$$f || exit 1; \
done

cmd/tests/%: bin/vsql
Expand All @@ -73,7 +73,7 @@ cmd/tests/%: bin/vsql

examples:
for f in `ls examples/*.v`; do \
v run $$f ; \
echo $$f; v run $$f || exit 1; \
done

examples/%:
Expand Down
4 changes: 3 additions & 1 deletion cmd/tests/missing-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

set -e

$VSQL && exit 0
$VSQL || exit 0

exit 1
4 changes: 3 additions & 1 deletion cmd/tests/unknown-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

set -e

$VSQL no-such-command && exit 0
$VSQL no-such-command || exit 0

exit 1
2 changes: 1 addition & 1 deletion vsql/sql_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ fn run_single_test(test SQLTest, query_cache &QueryCache, verbose bool, filter_l
connections[connection_name] = conn
}

db = connections[connection_name]
db = connections[connection_name] or { panic('unknown connection: ${connection_name}') }
current_connection_name = connection_name
continue
}
Expand Down

0 comments on commit 0b6acad

Please sign in to comment.