|
1 | | -# 128spec |
| 1 | +# 128spec - 8502/Commodore128 Testing Framework for KickAssembler |
2 | 2 |
|
3 | | -6502/Commodore128 Testing Framework for KickAssembler |
| 3 | +## Installation |
4 | 4 |
|
5 | | -## Video introduction |
| 5 | +### Gradle way |
6 | 6 |
|
7 | | -[](http://64bites.com/episodes/022-tdd-with-128spec/) |
8 | | -## Installation |
| 7 | +Edit your <code>build.gradle</code> file and add a <code>libFromGitHub</code> to specify 128spec dependency. |
| 8 | +Be sure to add also a <code>viceExecutable = 'x128.exe'</code> because retro-assembler plugin default emulator is c64. |
| 9 | + |
| 10 | +```gradle |
| 11 | +retroProject { |
| 12 | + viceExecutable = 'x128.exe' |
| 13 | +
|
| 14 | + libFromGitHub "c128lib/128spec", "0.7.2" |
| 15 | +} |
| 16 | +``` |
9 | 17 |
|
10 | | -### Recommended way |
| 18 | +### Other way |
11 | 19 |
|
12 | 20 | 1. Create a dir for libraries that your KickAssembler projects use. |
13 | 21 | 2. Get the current version of the 128spec.asm file and put it in this dir along with other libraries. |
14 | | -3. Import it in your spec files as <code>.import source "128spec.asm"</code> |
| 22 | +3. Import it in your spec files as <code>#import "128spec.asm"</code> |
15 | 23 | 4. Make sure to pass option <code>-libdir <path-to-your-libraries-dir></code> when compiling with KickAssembler. |
16 | 24 |
|
17 | 25 | ### If you just want to try it out |
18 | 26 |
|
19 | 27 | 1. Get the current version of the 128spec.asm file and put it in the same directory as your spec files. |
20 | | -2. Import it in your spec files as <code>.import source "128spec.asm"</code> |
| 28 | +2. Import it in your spec files as <code>#import "128spec.asm"</code> |
21 | 29 |
|
22 | 30 | ## Quick Start |
23 | 31 |
|
24 | 32 | #### 1. Create file example_spec.asm |
25 | 33 |
|
26 | 34 | ``` asm |
27 | | -.import source "128spec.asm" |
| 35 | +#import "128spec.asm" |
28 | 36 |
|
29 | | -sfspec: :init_spec() |
| 37 | +sfspec: init_spec() |
30 | 38 | |
31 | 39 | // TODO: Add assertions here |
32 | 40 |
|
33 | | - :finish_spec() |
| 41 | + finish_spec() |
34 | 42 | ``` |
35 | 43 |
|
36 | 44 |  |
37 | 45 |
|
38 | 46 | #### 2. Add first failing assertion. |
39 | 47 |
|
40 | 48 | ``` asm |
41 | | -.import source "128spec.asm" |
| 49 | +#import "128spec.asm" |
42 | 50 |
|
43 | | -sfspec: :init_spec() |
| 51 | +sfspec: init_spec() |
44 | 52 | |
45 | | - :assert_a_equal #42 |
| 53 | + lda #0 |
| 54 | + assert_a_equal #42 |
46 | 55 |
|
47 | | - :finish_spec() |
| 56 | + finish_spec() |
48 | 57 | ``` |
49 | 58 |
|
50 | | - |
| 59 | + |
51 | 60 |
|
52 | 61 | #### 3. Make it pass |
53 | 62 |
|
54 | 63 | ``` asm |
55 | | -.import source "128spec.asm" |
| 64 | +#import "128spec.asm" |
56 | 65 |
|
57 | | -sfspec: :init_spec() |
| 66 | +sfspec: init_spec() |
58 | 67 |
|
59 | 68 | lda #42 |
60 | | - :assert_a_equal #42 |
| 69 | + assert_a_equal #42 |
61 | 70 | |
62 | | - :finish_spec() |
| 71 | + finish_spec() |
63 | 72 | ``` |
64 | 73 |
|
65 | | - |
| 74 | + |
66 | 75 |
|
67 | 76 | ## License |
68 | 77 | The MIT License (MIT) |
|
0 commit comments