xref: /aosp_15_r20/external/flatbuffers/tests/LuaTest.sh (revision 890232f25432b36107d06881e0a25aaa6b473652)
1*890232f2SAndroid Build Coastguard Worker#!/bin/bash -eu
2*890232f2SAndroid Build Coastguard Worker#
3*890232f2SAndroid Build Coastguard Worker# Copyright 2019 Google Inc. All rights reserved.
4*890232f2SAndroid Build Coastguard Worker#
5*890232f2SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
6*890232f2SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
7*890232f2SAndroid Build Coastguard Worker# You may obtain a copy of the License at
8*890232f2SAndroid Build Coastguard Worker#
9*890232f2SAndroid Build Coastguard Worker#     http://www.apache.org/licenses/LICENSE-2.0
10*890232f2SAndroid Build Coastguard Worker#
11*890232f2SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
12*890232f2SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
13*890232f2SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*890232f2SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
15*890232f2SAndroid Build Coastguard Worker# limitations under the License.
16*890232f2SAndroid Build Coastguard Worker
17*890232f2SAndroid Build Coastguard Workerpushd "$(dirname $0)" >/dev/null
18*890232f2SAndroid Build Coastguard Workertest_dir="$(pwd)"
19*890232f2SAndroid Build Coastguard Worker
20*890232f2SAndroid Build Coastguard Workerdeclare -a versions=(luajit lua5.1 lua5.2 lua5.3 lua5.4)
21*890232f2SAndroid Build Coastguard Worker
22*890232f2SAndroid Build Coastguard Workerfor i in "${versions[@]}"
23*890232f2SAndroid Build Coastguard Workerdo
24*890232f2SAndroid Build Coastguard Worker    if command -v $i &> /dev/null
25*890232f2SAndroid Build Coastguard Worker    then
26*890232f2SAndroid Build Coastguard Worker        echo "[$i]"
27*890232f2SAndroid Build Coastguard Worker        $i luatest.lua
28*890232f2SAndroid Build Coastguard Worker    fi
29*890232f2SAndroid Build Coastguard Workerdone
30