|
| 1 | +# Helper recipes |
| 2 | + |
1 | 3 | import "build.just" |
2 | 4 | import "format.just" |
3 | 5 |
|
| 6 | +# Run language tests. `BASE_FLAGS` are used by default, `ALL_CHECK_FLAGS` are used if |
| 7 | +# `--all-checks` or `+` is passed along in `EXTRA_ARGS` |
4 | 8 | [no-cd, positional-arguments, no-exit-message] |
5 | 9 | @_codeql_test LANGUAGE BASE_FLAGS ALL_CHECKS_FLAGS EXTRA_ARGS: |
6 | 10 | {{ tsx }} "{{ source_dir() }}/codeql-test-run.ts" "$@" |
7 | 11 |
|
| 12 | +# Run all language tests in ROOTS for a language. This is intended to be called by CI |
8 | 13 | [no-cd, positional-arguments, no-exit-message] |
9 | 14 | @_language_tests EXTRA_ARGS SOURCE_DIR +ROOTS: _require_semmle_code |
10 | 15 | {{ tsx }} "{{ source_dir() }}/language-tests.ts" "$@" |
11 | 16 |
|
12 | | - |
13 | | - |
| 17 | +# Run integration tests. Requires an internal repository checkout |
14 | 18 | [no-cd, no-exit-message] |
15 | 19 | _integration_test *ARGS: _require_semmle_code (_run "$SEMMLE_CODE/tools/pytest" ARGS) |
16 | 20 |
|
| 21 | +# Generic run command recipe that can be used by other recipes, with nice rendering |
17 | 22 | [no-cd] |
18 | 23 | _run +ARGS: |
19 | 24 | {{ cmd_sep }}{{ ARGS }}{{ cmd_sep }} |
20 | 25 |
|
| 26 | +# Run a command in a specific directory |
21 | 27 | [no-cd] |
22 | 28 | _run_in DIR +ARGS: |
23 | 29 | {{ cmd_sep }}cd "{{ DIR }}"; {{ ARGS }}{{ cmd_sep }} |
24 | 30 |
|
| 31 | +# Run a command in the internal repository checkout |
25 | 32 | [no-cd] |
26 | 33 | _run_in_semmle_code +ARGS: _require_semmle_code (_run_in "$SEMMLE_CODE" ARGS) |
27 | 34 |
|
| 35 | +# Run a just recipe |
28 | 36 | [no-cd, positional-arguments, no-exit-message] |
29 | 37 | @_just +ARGS: |
30 | 38 | echo "-> just $@" |
31 | 39 | "{{ JUST_EXECUTABLE }}" "$@" |
32 | 40 |
|
| 41 | +# Run a just recipe, but only if we are not on CI |
33 | 42 | [no-cd, positional-arguments] |
34 | 43 | @_if_not_on_ci_just +ARGS: |
35 | 44 | if [ "${GITHUB_ACTIONS:-}" != "true" ]; then \ |
|
0 commit comments