Skip to content

Add CI job for buildind and testing on 32bit big endian #3

Add CI job for buildind and testing on 32bit big endian

Add CI job for buildind and testing on 32bit big endian #3

Workflow file for this run

name: MIPSBE32 Tests
on: [push, pull_request]
# Stop previous runs on the same branch on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
jobs:
mipsbe32:
name: MIPS BE 32 QEMU
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Install MIPS BE toolchain
run: |
sudo apt-get update
sudo apt-get install -y \
binutils-mips-linux-gnu \
gcc-mips-linux-gnu \
g++-mips-linux-gnu \
libc6-dev-mips-cross \
make \
qemu-user-static
- name: Build MIPS BE test binaries
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCAPSTONE_BUILD_STATIC_LIBS=ON \
-DCAPSTONE_BUILD_CSTEST=ON \
-DCAPSTONE_BUILD_DIET=OFF \
-DCMAKE_TOOLCHAIN_FILE=cross_configs/linux_mips_ubuntu24.cmake
cmake --build build --config Debug --parallel
- name: Verify MIPS BE target
run: |
mips-linux-gnu-readelf -h build/suite/cstest/cstest > cstest.elf.txt
cat cstest.elf.txt
grep -q "Class:.*ELF32" cstest.elf.txt
grep -q "Data:.*big endian" cstest.elf.txt
grep -q "Machine:.*MIPS" cstest.elf.txt
qemu-mips-static -L /usr/mips-linux-gnu/ build/suite/cstest/cstest suite/cstest/test/min_valid_test_file.yaml | grep -q "All tests succeeded"
- name: Unit tests
run: |
ctest --test-dir build --output-on-failure -R '^unit_'
- name: Integration tests
run: |
ctest --test-dir build --output-on-failure -R '^integration_c_'
- name: Cstest integration tests
run: |
python3 suite/cstest/test/integration_tests.py "qemu-mips-static -L /usr/mips-linux-gnu/ build/suite/cstest/cstest"
- name: Cstest negative tests
run: |
status=0
for testcase in tests/negative/should_fail_*.yaml; do
if qemu-mips-static -L /usr/mips-linux-gnu/ build/suite/cstest/cstest "$testcase"; then
echo "Expected negative test to fail: $testcase"
status=1
fi
done
exit $status
- name: Cstest MC
run: |
ctest --test-dir build --output-on-failure -R '^MCTests$'
- name: Cstest details
run: |
ctest --test-dir build --output-on-failure -R '^DetailTests$'
- name: Cstest issues
run: |
ctest --test-dir build --output-on-failure -R '^IssueTests$'
- name: Cstest features
run: |
ctest --test-dir build --output-on-failure -R '^FeaturesTests$'
- name: Legacy integration tests
run: |
ctest --test-dir build --output-on-failure -R '^legacy'