Skip to content

Commit

Permalink
Fix lint and add missing test script
Browse files Browse the repository at this point in the history
Reviewed By: alexmalyshev

Differential Revision: D57316246

fbshipit-source-id: dcba7ea1cfd907c56c333ffbec56df73bebdb0a9
  • Loading branch information
jbower-fb authored and facebook-github-bot committed May 14, 2024
1 parent c1cbb05 commit 63018a4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cinderx/TestScripts/test_build_modes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -xe
set -o pipefail

cd "$(dirname $(readlink -f $0))"/../

# # Only debug builds have sys.gettotalrefcount()
buck2 run @fbcode//mode/dbg fbcode//cinderx:python3.10 -- -c 'import sys; sys.gettotalrefcount()'
buck2 run @fbcode//mode/dev fbcode//cinderx:python3.10 -- -c 'import sys; sys.gettotalrefcount()'
! buck2 run @fbcode//mode/opt fbcode//cinderx:python3.10 -- -c 'import sys; sys.gettotalrefcount()'

# # Only ASAN builds should have the ASAN API avilable through ctypes
! buck2 run @fbcode//mode/dbg fbcode//cinderx:python3.10 -- -c 'import ctypes; ctypes.pythonapi.__asan_default_options()'
buck2 run @fbcode//mode/dev fbcode//cinderx:python3.10 -- -c 'import ctypes; ctypes.pythonapi.__asan_default_options()'
! buck2 run @fbcode//mode/opt fbcode//cinderx:python3.10 -- -c 'import ctypes; ctypes.pythonapi.__asan_default_options()'

# We embed build flags in our objects
strings $(buck2 run @//mode/dev fbcode//cinderx:dist-path)/lib/libpython3.10.so | ( ! grep -- "-O3 -fno-omit-frame-pointer" > /dev/null )
strings $(buck2 run @//mode/dbg fbcode//cinderx:dist-path)/lib/libpython3.10.so | ( ! grep -- "-O3 -fno-omit-frame-pointer" > /dev/null )
strings $(buck2 run @//mode/opt fbcode//cinderx:dist-path)/lib/libpython3.10.so | grep -- "-O3 -fno-omit-frame-pointer" > /dev/null

echo All tests passed!

0 comments on commit 63018a4

Please sign in to comment.