-
-
Notifications
You must be signed in to change notification settings - Fork 23
103 lines (100 loc) · 3.04 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Tests
on:
push:
paths-ignore:
- '**/*.md'
- '**/*.txt'
branches:
- master
- next
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
branches:
- master
- next
jobs:
unit-tests:
name: Unit Tests
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
brew install ninja
python -m pip install --upgrade pip
pip install pytest poetry
poetry build
pip install $(ls dist/*.tar.gz | xargs)
- name: Build test images
run: ninja -C tests
- name: Test with pytest
run: |
PYTHONPATH="./src" pytest -s tests/unit.py
bin-tests:
name: Bin Tests
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
brew install ninja
python -m pip install --upgrade pip
pip install poetry
poetry build
pip install $(ls dist/*.tar.gz | xargs)
- name: Build test images
run: ninja -C tests
- name: Test insert
run: |
ktool insert --lc load --payload /your/mother.dylib --out tests/bins/testbin1.insert.test tests/bins/testbin1
ktool list --linked tests/bins/testbin1.insert.test | grep your/mother
- name: Test edit
run: |
ktool edit --iname your/mother.framework/Mother --out tests/bins/testlib1.dylib.edit.test tests/bins/testlib1.dylib
ktool info tests/bins/testlib1.dylib.edit.test | grep Mother
- name: Test lipo
run: |
ktool lipo --extract arm64 tests/bins/testbin1.fat
ktool file tests/bins/testbin1.fat.arm64
ktool lipo --extract x86_64 tests/bins/testbin1.fat
ktool lipo --create --out tests/bins/testbin1.fat.lipo.test tests/bins/testbin1.fat.arm64 tests/bins/testbin1.fat.x86_64
ktool file tests/bins/testbin1.fat.lipo.test | grep "0x11000"
- name: Test dump
run: |
ktool dump --headers tests/bins/testbin1 | grep "char testPropertyTwo; // ivar: _testPropertyTwo"
- name: Test dump with mmaped-IO enabled
run: |
ktool --mmap dump --headers tests/bins/testbin1 | grep "char testPropertyTwo; // ivar: _testPropertyTwo"
- name: Test symbols
run: |
ktool symbols --imports tests/bins/testbin1 | grep _OBJC_CLASS_$_NSObject