Skip to content

Update macos-unit-tests.yml #103

Update macos-unit-tests.yml

Update macos-unit-tests.yml #103

Workflow file for this run

name: Linux Build & Unit Tests
on: [push]
jobs:
build:
name: unit-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install tools
run: |
sudo apt install cmake
sudo apt install lcov
- name: build & run tests
run: |
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 | grep -Po '(errors)="\K[^"]*')
failures=$(cat TE-junit.xml | grep -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 -DTE_POW_FROM_RIGHT=1 ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=TE-junit2.xml
cat TE-junit2.xml
errors=$(cat TE-junit2.xml | grep -Po '(errors)="\K[^"]*')
failures=$(cat TE-junit2.xml | grep -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 -DTE_FLOAT=1 ./
make -j4
cd bin
./TETestRunner --reporter JUnit::out=TE-junit2.xml
cat TE-junit2.xml
errors=$(cat TE-junit2.xml | grep -Po '(errors)="\K[^"]*')
failures=$(cat TE-junit2.xml | grep -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