Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Don't enable USE_ADDRESS_SANITIZE by default #189

Don't enable USE_ADDRESS_SANITIZE by default

Don't enable USE_ADDRESS_SANITIZE by default #189

name: macOS Build & Unit Tests
on: [push,pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: unit-tests
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: build & run tests
run: |
brew install grep
cd ..
git clone https://github.com/catchorg/Catch2.git
cd tinyexpr-plusplus/tests
cmake ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=te-junit.xml
cat te-junit.xml
errors=$(cat te-junit.xml | ggrep -Po '(errors)="\K[^"]*')
failures=$(cat te-junit.xml | ggrep -Po '(failures)="\K[^"]*')
echo "Error count is: ${errors}"
echo "Failure count is: ${failures}"
if [ "$errors" -gt 0 ]; then
exit 1
fi
if [ "$failures" -gt 0 ]; then
exit 1
fi
cd ..
cmake --build . --target clean
rm ./CMakeCache.txt
cmake -DTE_POW_FROM_RIGHT=1 -DUSE_ADDRESS_SANITIZE=1 ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=te-junit-pow-from-right.xml
cat te-junit-pow-from-right.xml
errors=$(cat te-junit-pow-from-right.xml | ggrep -Po '(errors)="\K[^"]*')
failures=$(cat te-junit-pow-from-right.xml | ggrep -Po '(failures)="\K[^"]*')
echo "Error count is: ${errors}"
echo "Failure count is: ${failures}"
if [ "$errors" -gt 0 ]; then
exit 1
fi
if [ "$failures" -gt 0 ]; then
exit 1
fi
cd ..
cmake --build . --target clean
rm ./CMakeCache.txt
cmake -DTE_FLOAT=1 -DUSE_ADDRESS_SANITIZE=1 ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=te-junit-float.xml
cat te-junit-float.xml
errors=$(cat te-junit-float.xml | ggrep -Po '(errors)="\K[^"]*')
failures=$(cat te-junit-float.xml | ggrep -Po '(failures)="\K[^"]*')
echo "Error count is: ${errors}"
echo "Failure count is: ${failures}"
if [ "$errors" -gt 0 ]; then
exit 1
fi
if [ "$failures" -gt 0 ]; then
exit 1
fi
cd ..
cmake --build . --target clean
rm ./CMakeCache.txt
cmake -DTE_LONG_DOUBLE=1 -DUSE_ADDRESS_SANITIZE=1 ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=te-junit-long-double.xml
cat te-junit-long-double.xml
errors=$(cat te-junit-long-double.xml | ggrep -Po '(errors)="\K[^"]*')
failures=$(cat te-junit-long-double.xml | ggrep -Po '(failures)="\K[^"]*')
echo "Error count is: ${errors}"
echo "Failure count is: ${failures}"
if [ "$errors" -gt 0 ]; then
exit 1
fi
if [ "$failures" -gt 0 ]; then
exit 1
fi
cd ..
cmake --build . --target clean
rm ./CMakeCache.txt
cmake -DTE_BITWISE_OPERATORS=1 -DUSE_ADDRESS_SANITIZE=1 ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=te-junit-bitwise.xml
cat te-junit-bitwise.xml
errors=$(cat te-junit-bitwise.xml | ggrep -Po '(errors)="\K[^"]*')
failures=$(cat te-junit-bitwise.xml | ggrep -Po '(failures)="\K[^"]*')
echo "Error count is: ${errors}"
echo "Failure count is: ${failures}"
if [ "$errors" -gt 0 ]; then
exit 1
fi
if [ "$failures" -gt 0 ]; then
exit 1
fi
- name: Archive test results
uses: actions/upload-artifact@v4
with:
name: macOS unit tests
path: ${{ github.workspace }}/tests/bin/*.xml
Morty Proxy This is a proxified and sanitized view of the page, visit original site.