• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (C) 2024 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# List all the ravenwood test modules.
17
18set -e
19
20in="$OUT/module-info.json"
21cache="$OUT/ravenwood-test-list.cached.tmp"
22cache_temp="$OUT/ravenwood-test-list.temp.tmp"
23
24if [[ "$in" -nt "$cache" ]] ; then
25    rm -f "$cache_temp" "$cache"
26
27    # First, create to a temp file, and once it's completed, rename it
28    # to the actual cache file, so that if the command failed or is interrupted,
29    # we don't update the cache.
30    jq -r 'to_entries[] | select( .value.compatibility_suites | index("ravenwood-tests") ) | .key' "$OUT/module-info.json" | sort > "$cache_temp"
31    mv "$cache_temp" "$cache"
32fi
33
34cat "$cache"
35