From 926ac280e067d95e7c19a7749507686e3b5c919c Mon Sep 17 00:00:00 2001 From: njelich <12912633+njelich@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:46:33 +0100 Subject: [PATCH] wip darwin makefile --- .github/workflows/darwin-x86.yml | 3 ++ casr/tests/casr_tests/darwin_Makefile | 45 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 casr/tests/casr_tests/darwin_Makefile diff --git a/.github/workflows/darwin-x86.yml b/.github/workflows/darwin-x86.yml index a5491dc2..5178df96 100644 --- a/.github/workflows/darwin-x86.yml +++ b/.github/workflows/darwin-x86.yml @@ -34,6 +34,9 @@ jobs: rustup install nightly export PATH=/root/.cargo/bin:$PATH cargo install cargo-fuzz + + - name: Build C tests + run: - name: Run tests run: | cargo test --release --verbose --lib -- --test-threads 1 diff --git a/casr/tests/casr_tests/darwin_Makefile b/casr/tests/casr_tests/darwin_Makefile new file mode 100644 index 00000000..2cd2b220 --- /dev/null +++ b/casr/tests/casr_tests/darwin_Makefile @@ -0,0 +1,45 @@ +all: test_returnAv test_segFaultOnPc test_abort test_destAv test_destAvNearNull test_sourceAv test_sourceAvNearNull test_callAv test_callAvTainted test_heapError test_canary test_badInstruction test_safeFunc test_stackOverflow test_destAvTainted test_DivByZero test_sigbus test_sig_me + +test_returnAv: test_returnAv.c + gcc -g -O0 -fno-stack-protector test_returnAv.c -o ./arm_bin/test_returnAv +test_segFaultOnPc: test_segFaultOnPc.c + gcc -g -O0 -fno-stack-protector test_segFaultOnPc.c -o ./arm_bin/test_segFaultOnPc +test_abort: test_abort.c + gcc -g -O0 -D_FORTIFY_SOURCE=2 test_abort.c -o ./arm_bin/test_abort +test_destAv: test_destAv.c + gcc -g -O0 test_destAv.c -o ./arm_bin/test_destAv +test_destAvNearNull: + gcc -g test_destAvNearNull.c -o ./arm_bin/test_destAvNearNull +test_sourceAv: test_sourceAv.c + gcc -g test_sourceAv.c -o ./arm_bin/test_sourceAv +test_sourceAvNearNull: test_sourceAvNearNull.c + gcc -g test_sourceAvNearNull.c -o ./arm_bin/test_sourceAvNearNull +test_callAvTainted: test_callAv.c + gcc -g -O0 test_callAv.c -o ./arm_bin/test_callAvTainted +test_callAv: test_callAv.c + gcc -g -O2 test_callAv.c -o ./arm_bin/test_callAv +test_heapError: test_heapError.c + gcc -g -O0 test_heapError.c -o ./arm_bin/test_heapError +test_canary: test_returnAv.c + gcc -g -O0 -fstack-protector-all test_returnAv.c -o ./arm_bin/test_canary +test_safeFunc: test_returnAv.c + gcc -g -O2 test_returnAv.c -o ./arm_bin/test_safeFunc +test_badInstruction: test_badInstruction.c + gcc -O0 ./test_badInstruction.c -o ./arm_bin/test_badInstruction +test_stackOverflow: test_stackOverflow.c + gcc -O0 ./test_stackOverflow.c -o ./arm_bin/./test_stackOverflow +test_destAvTainted: test_destAvTainted.c + gcc -O0 ./test_destAvTainted.c -o ./arm_bin/./test_destAvTainted +test_DivByZero: + gcc -g test_DivByZero.c -o ./arm_bin/test_DivByZero +test_sigbus: + gcc -g test_sigbus.c -o ./arm_bin/test_sigbus +test_sig_me: + gcc -g test_sig_me.c -o ./arm_bin/test_sig_me + +clean: + cd arm_bin && rm -f test_stackOverflow \ + test_badInstruction test_safeFunc test_returnAv test_segFaultOnPc \ + test_abort test_destAv test_destAvNearNull test_sourceAv \ + test_sourceAvNearNull test_callAv test_heapError \ + test_canary test_callAvTainted test_DivByZero test_destAvTainted