forked from google/XNNPACK
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmicrokernel_lists_test.sh
executable file
·44 lines (37 loc) · 1.13 KB
/
microkernel_lists_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Copyright 2024 Google LLC
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#
# Checks that the generated *_microkernel.bzl and *_microkernel.cmake files are
# up to date.
ERROR_MESSAGE='
Generated bzl/cmake files do not match the source files.
Please run the following command in your source directory to update them:
./tools/update-microkernels.py
'
function test_microkernel_lists {
BASE_DIR=${RUNFILES_DIR}/xnnpack
# Check generated .bzl files.
for filename in $(ls ${BASE_DIR}/testdata/gen); do
echo "Checking ${filename}..."
cmp "${BASE_DIR}/testdata/gen/${filename}" \
"${BASE_DIR}/gen/${filename}"
if [ "$?" == "1" ]; then
echo "${ERROR_MESSAGE}"
exit 1
fi
done
# Check generated .cmake files.
for filename in $(ls ${BASE_DIR}/testdata/cmake/gen); do
echo "Checking ${filename}..."
cmp "${BASE_DIR}/testdata/cmake/gen/${filename}" \
"${BASE_DIR}/cmake/gen/${filename}"
if [ "$?" == "1" ]; then
echo "${ERROR_MESSAGE}"
exit 1
fi
done
}
test_microkernel_lists