File tree Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -77,16 +77,11 @@ install_sccache() {
77
77
78
78
export PATH=" ${SCCACHE_PATH} :${PATH} "
79
79
80
- # Create temp directory for sccache shims
81
- TMP_DIR=$( mktemp -d)
82
- trap ' rm -rfv ${TMP_DIR}' EXIT
83
-
84
80
write_sccache_stub " ${TMP_DIR} /c++"
85
81
write_sccache_stub " ${TMP_DIR} /cc"
86
82
write_sccache_stub " ${TMP_DIR} /clang++"
87
83
write_sccache_stub " ${TMP_DIR} /clang"
88
84
89
- export PATH=" ${TMP_DIR} :$PATH "
90
85
sccache --zero-stats || true
91
86
}
92
87
Original file line number Diff line number Diff line change 41
41
42
42
macos :
43
43
uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
44
- strategy :
45
- matrix :
46
- include :
47
- - build-tool : buck2
48
44
with :
49
45
runner : macos-m1-stable
50
46
python-version : ' 3.11'
@@ -53,18 +49,21 @@ jobs:
53
49
script : |
54
50
set -eux
55
51
56
- BUILD_TOOL=${{ matrix.build-tool }}
57
-
58
52
bash .ci/scripts/setup-conda.sh
59
53
54
+ # Create temp directory for sccache shims
55
+ export TMP_DIR=$(mktemp -d)
56
+ export PATH="${TMP_DIR}:$PATH"
57
+ trap 'rm -rfv ${TMP_DIR}' EXIT
58
+
60
59
# Setup MacOS dependencies as there is no Docker support on MacOS atm
61
60
PYTHON_EXECUTABLE=python \
62
61
EXECUTORCH_BUILD_PYBIND=ON \
63
62
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
64
63
${CONDA_RUN} --no-capture-output \
65
- .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
64
+ .ci/scripts/setup-macos.sh cmake
66
65
67
66
# Run pytest with coverage
68
67
${CONDA_RUN} pytest -n auto --cov=./ --cov-report=xml
69
68
# Run gtest
70
- ${CONDA_RUN} buck2 test runtime/core/... runtime/platform/...
69
+ ${CONDA_RUN} test/run_oss_cpp_tests.sh
Original file line number Diff line number Diff line change @@ -17,15 +17,26 @@ set -ex
17
17
build_executorch () {
18
18
cmake . \
19
19
-DCMAKE_INSTALL_PREFIX=cmake-out \
20
- -DEXECUTORCH_BUILD_GTESTS=ON \
21
20
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
22
21
-Bcmake-out
23
22
cmake --build cmake-out -j9 --target install
24
23
}
25
24
25
+ build_gtest () {
26
+ mkdir -p third-party/googletest/build
27
+ pushd third-party/googletest/build
28
+ cmake .. -DCMAKE_INSTALL_PREFIX=.
29
+ make -j4
30
+ make install
31
+ popd
32
+ }
33
+
26
34
build_and_run_test () {
27
35
local test_dir=$1
28
- cmake " ${test_dir} " -Bcmake-out/" ${test_dir} " -DCMAKE_INSTALL_PREFIX=cmake-out
36
+ cmake " ${test_dir} " \
37
+ -DCMAKE_INSTALL_PREFIX=cmake-out \
38
+ -DCMAKE_PREFIX_PATH=" $( pwd) /third-party/googletest/build" \
39
+ -Bcmake-out/" ${test_dir} "
29
40
cmake --build cmake-out/" ${test_dir} " -j9
30
41
31
42
for t in cmake-out/" ${test_dir} " /* test; do
@@ -56,6 +67,7 @@ probe_tests() {
56
67
}
57
68
58
69
build_executorch
70
+ build_gtest
59
71
60
72
if [ -z " $1 " ]; then
61
73
echo " Running all directories:"
You can’t perform that action at this time.
0 commit comments