test65 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/help.txt +3 -3
- data/lib/test65/build_file_list.rb +3 -0
- data/lib/test65/enclosures/ca65.rb +7 -8
- data/lib/test65/enclosures/cc65.rb +43 -0
- data/lib/test65/perform_test.rb +9 -0
- data/lib/test65/process_files.rb +5 -2
- data/lib/test65/version.rb +1 -1
- data/t65/c_err.c65 +8 -0
- data/t65/min_fail2.rb +9 -0
- data/t65/min_fail2_c.rb +9 -0
- data/t65/min_fail_c.c65 +8 -0
- data/t65/{min_pass.rb → min_pass2.rb} +0 -0
- data/t65/min_pass2_c.rb +9 -0
- data/t65/min_pass3.asm +12 -0
- data/t65/min_pass3_c.c +8 -0
- data/t65/min_pass_c.c65 +8 -0
- data/t65/t65_pass2_c.c +8 -0
- data/t65/t65_pass_c.c65 +8 -0
- data/t65/t65_test2_cfg.asm +13 -0
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce0b53ee6e1abb5f043427d993e103352f195fc2
|
4
|
+
data.tar.gz: 8f4cb1e01eb2f3fd19d5d05f1393b744a8547b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4863b308d617644627b0727380de7c6d7a5527ad37fdb317065a358b11289d215f5296eba4e10b6da9a2b82a5e533e898eb3438a4ff0441c7e228822e8d19404
|
7
|
+
data.tar.gz: 10fad1c205776264cd83ba4d99ba654f79e6efd7bae25d389dbd233f2284b770ae2e920351082c54d385b792c1ca8ff1c3257f07a285be2bd20c7c77486f785a
|
data/help.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
test65 - Run tests of
|
1
|
+
test65 - Run tests of 65C02 C and assembler code.
|
2
2
|
|
3
3
|
Usage: test65 {options} {files}
|
4
4
|
|
@@ -19,6 +19,6 @@ Notes:
|
|
19
19
|
- By default, test files are located in a folder called "t65" in the current
|
20
20
|
folder or one of its parent folders.
|
21
21
|
- Wildcards are allowed for files but not the path.
|
22
|
-
- If no files are specified, then all files matching "t65*.
|
23
|
-
in the test folder are tested.
|
22
|
+
- If no files are specified, then all files matching "t65*.c65", "t65*.a65",
|
23
|
+
"t65*.c", "t65*.asm", or "t65*.rb" in the test folder are tested.
|
24
24
|
- If files are specified, only the specified file(s) are tested.
|
@@ -15,6 +15,9 @@ module Test65
|
|
15
15
|
# Scan the path for files to be processed.
|
16
16
|
def self.scan_files
|
17
17
|
@test_files = Dir.glob(@options[:path] + "/t65*.a65") +
|
18
|
+
Dir.glob(@options[:path] + "/t65*.asm") +
|
19
|
+
Dir.glob(@options[:path] + "/t65*.c65") +
|
20
|
+
Dir.glob(@options[:path] + "/t65*.c") +
|
18
21
|
Dir.glob(@options[:path] + "/t65*.rb")
|
19
22
|
fail "Cannot locate any test files" if @test_files.empty?
|
20
23
|
end
|
@@ -3,28 +3,27 @@ class TestScript
|
|
3
3
|
|
4
4
|
# Setup ca65
|
5
5
|
def ca65_initialize
|
6
|
-
@options[:
|
7
|
-
@options[:
|
8
|
-
@options[:objs] = []
|
6
|
+
@options[:ca65_target] = "sim65c02"
|
7
|
+
@options[:ca65_inc_paths] = ["#{@options[:gem_root]}/asminc"]
|
9
8
|
end
|
10
9
|
|
11
10
|
# Add some include paths for the assembler.
|
12
11
|
def ca65_inc_paths(*more_paths)
|
13
12
|
fail "Sequence error: ca65_inc_paths" unless @phase == :create
|
14
|
-
append_option(:
|
13
|
+
append_option(:ca65_inc_paths, more_paths)
|
15
14
|
end
|
16
15
|
|
17
16
|
# Assemble some files.
|
18
17
|
def ca65(file, options="")
|
19
18
|
fail "Sequence error: ca65" unless @phase == :create
|
20
19
|
source = File.absolute_path(@options[:path] + "/" + file)
|
21
|
-
target = "--target #{@options[:
|
22
|
-
paths = build_args("-I", @options[:
|
20
|
+
target = "--target #{@options[:ca65_target]} "
|
21
|
+
paths = build_args("-I", @options[:ca65_inc_paths])
|
23
22
|
|
24
|
-
# Convert source
|
23
|
+
# Convert source assembler files into object files.
|
25
24
|
object = change_type(source, ".o")
|
26
25
|
list = @options[:list] ? "-l " + change_type(source, ".lst") : ""
|
27
|
-
command = "ca65 #{target}#{paths}#{list}#{options} -o #{object} #{source} #{@quiet}\n"
|
26
|
+
command = "ca65 #{target}#{paths}#{list} #{options} -o #{object} #{source} #{@quiet}\n"
|
28
27
|
puts command if @options[:debug]
|
29
28
|
system(command)
|
30
29
|
fail "Error assembling #{source.localize_path}" unless $?.exitstatus == 0
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# An enclosure for the cc65 compiler.
|
2
|
+
class TestScript
|
3
|
+
|
4
|
+
# Setup cc65
|
5
|
+
def cc65_initialize
|
6
|
+
@options[:cc65_target] = "sim65c02"
|
7
|
+
@options[:cc65_inc_paths] = ["#{@options[:gem_root]}/include"]
|
8
|
+
end
|
9
|
+
|
10
|
+
# Add some include paths for the compiler.
|
11
|
+
def cc65_inc_paths(*more_paths)
|
12
|
+
fail "Sequence error: cc65_inc_paths" unless @phase == :create
|
13
|
+
append_option(:cc65_inc_paths, more_paths)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Compile some files.
|
17
|
+
def cc65(file, options="")
|
18
|
+
fail "Sequence error: cc65" unless @phase == :create
|
19
|
+
source = File.absolute_path(@options[:path] + "/" + file)
|
20
|
+
target = "--target #{@options[:cc65_target]} "
|
21
|
+
paths = build_args("--include-dir", @options[:cc65_inc_paths])
|
22
|
+
|
23
|
+
# Convert source C files into assembler files.
|
24
|
+
list = @options[:list] ? "--add-source " : " "
|
25
|
+
command = "cc65 #{target}#{list}#{paths}#{options} #{source} #{@quiet}\n"
|
26
|
+
puts command if @options[:debug]
|
27
|
+
system(command)
|
28
|
+
fail "Error compiling #{source.localize_path}" unless $?.exitstatus == 0
|
29
|
+
|
30
|
+
# Convert intermediate assembler files into object files.
|
31
|
+
temp = change_type(source, ".s")
|
32
|
+
object = change_type(source, ".o")
|
33
|
+
list = @options[:list] ? "-l " + change_type(source, ".lst") : ""
|
34
|
+
command = "ca65 #{target}#{list} -o #{object} #{temp} #{@quiet}\n"
|
35
|
+
puts command if @options[:debug]
|
36
|
+
system(command)
|
37
|
+
fail "Error assembling #{source.localize_path}" unless $?.exitstatus == 0
|
38
|
+
|
39
|
+
@options[:temps] << temp
|
40
|
+
@options[:objs] << object
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
data/lib/test65/perform_test.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Run a test script for the test65 program.
|
2
2
|
|
3
3
|
require_relative 'enclosures/utils'
|
4
|
+
require_relative 'enclosures/cc65'
|
4
5
|
require_relative 'enclosures/ca65'
|
5
6
|
require_relative 'enclosures/ld65'
|
6
7
|
require_relative 'enclosures/sim65'
|
@@ -12,6 +13,10 @@ class TestScript
|
|
12
13
|
@options = options.full_dup
|
13
14
|
@phase = :create
|
14
15
|
|
16
|
+
@options[:objs] = []
|
17
|
+
@options[:temps] = []
|
18
|
+
|
19
|
+
cc65_initialize
|
15
20
|
ca65_initialize
|
16
21
|
ld65_initialize
|
17
22
|
sim65_initialize
|
@@ -25,6 +30,10 @@ class TestScript
|
|
25
30
|
unless @options[:keep]
|
26
31
|
File.delete(@output) if File.exists?(@output)
|
27
32
|
|
33
|
+
@options[:temps].each do |file|
|
34
|
+
File.delete(file) if File.exists?(file)
|
35
|
+
end
|
36
|
+
|
28
37
|
@options[:objs].each do |file|
|
29
38
|
File.delete(file) if File.exists?(file)
|
30
39
|
end
|
data/lib/test65/process_files.rb
CHANGED
@@ -21,8 +21,11 @@ module Test65
|
|
21
21
|
def self.process_file(file)
|
22
22
|
puts file.localize_path if @options[:verbose]
|
23
23
|
|
24
|
-
case File.extname(file)
|
25
|
-
when ".
|
24
|
+
case File.extname(file).downcase
|
25
|
+
when ".c65", ".c"
|
26
|
+
script { cc65(File.basename(file)); ld65; sim65 }
|
27
|
+
|
28
|
+
when ".a65", ".asm"
|
26
29
|
script { ca65(File.basename(file)); ld65; sim65 }
|
27
30
|
|
28
31
|
when ".rb"
|
data/lib/test65/version.rb
CHANGED
data/t65/c_err.c65
ADDED
data/t65/min_fail2.rb
ADDED
data/t65/min_fail2_c.rb
ADDED
data/t65/min_fail_c.c65
ADDED
File without changes
|
data/t65/min_pass2_c.rb
ADDED
data/t65/min_pass3.asm
ADDED
data/t65/min_pass3_c.c
ADDED
data/t65/min_pass_c.c65
ADDED
data/t65/t65_pass2_c.c
ADDED
data/t65/t65_pass_c.c65
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test65
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PeterCamilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: full_dup
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/test65.rb
|
87
87
|
- lib/test65/build_file_list.rb
|
88
88
|
- lib/test65/enclosures/ca65.rb
|
89
|
+
- lib/test65/enclosures/cc65.rb
|
89
90
|
- lib/test65/enclosures/ld65.rb
|
90
91
|
- lib/test65/enclosures/sim65.rb
|
91
92
|
- lib/test65/enclosures/utils.rb
|
@@ -98,6 +99,7 @@ files:
|
|
98
99
|
- lib/test65/version.rb
|
99
100
|
- rakefile.rb
|
100
101
|
- t65/asm_err.a65
|
102
|
+
- t65/c_err.c65
|
101
103
|
- t65/callee.a65
|
102
104
|
- t65/caller.a65
|
103
105
|
- t65/foo.txt
|
@@ -105,10 +107,20 @@ files:
|
|
105
107
|
- t65/macro_err1.a65
|
106
108
|
- t65/macro_err2.a65
|
107
109
|
- t65/min_fail.a65
|
110
|
+
- t65/min_fail2.rb
|
111
|
+
- t65/min_fail2_c.rb
|
112
|
+
- t65/min_fail_c.c65
|
108
113
|
- t65/min_pass.a65
|
109
|
-
- t65/
|
114
|
+
- t65/min_pass2.rb
|
115
|
+
- t65/min_pass2_c.rb
|
116
|
+
- t65/min_pass3.asm
|
117
|
+
- t65/min_pass3_c.c
|
118
|
+
- t65/min_pass_c.c65
|
110
119
|
- t65/pass.a65
|
111
120
|
- t65/t65_min_pass.rb
|
121
|
+
- t65/t65_pass2_c.c
|
122
|
+
- t65/t65_pass_c.c65
|
123
|
+
- t65/t65_test2_cfg.asm
|
112
124
|
- t65/t65_test_cfg.a65
|
113
125
|
- t65/t65_test_macros.a65
|
114
126
|
- t65/t65_two_files.rb
|