Skip to content

Commit a48659d

Browse files
committed
Update for new test suite locations.
1 parent 8c579c6 commit a48659d

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

script/tc

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def earl_preamble(options)
3131
end
3232

3333
def run_tc(tc, **options)
34-
STDERR.write "run #{tc.name}"
34+
STDERR.write "run #{tc.name} "
3535

3636
if options[:verbose]
3737
puts "\nTestCase: #{tc.inspect}"
@@ -41,9 +41,13 @@ def run_tc(tc, **options)
4141

4242
begin
4343
puts "open #{tc.action}" if options[:verbose]
44-
options = {base_uri: tc.base}.merge(options)
44+
options = {
45+
base_uri: tc.base,
46+
validate: tc.syntax?,
47+
logger: tc.logger
48+
}.merge(options)
4549

46-
reader = RDF::Reader.for(tc.action).new(tc.input, base_uri: tc.base, validate: tc.syntax?, logger: options[:logger])
50+
reader = RDF::Reader.for(tc.action).new(tc.input, **options)
4751

4852
graph = RDF::Repository.new
4953
result = nil
@@ -84,7 +88,7 @@ def run_tc(tc, **options)
8488
end
8589
end
8690

87-
options[:output].puts("\nOutput:\n" + graph.dump(:ntriples, validate: false)) unless options[:quiet]
91+
options[:output].puts("\nOutput:\n" + graph.dump(:ntriples, validate: false)) if options[:verbose]
8892

8993
if options[:earl]
9094
options[:output].puts %{
@@ -147,16 +151,20 @@ opts.each do |opt, arg|
147151
end
148152
end
149153

150-
manifest = Fixtures::SuiteTest::BASE + "manifest.ttl"
154+
manifests = [Fixtures::SuiteTest::BASE + "rdf11/rdf-xml/"].map {|m| "#{m}manifest.ttl"}
151155

152156
earl_preamble(options) if options[:earl]
153157

154158
result_count = {}
155159

156-
Fixtures::SuiteTest::Manifest.open(manifest) do |m|
157-
m.entries.each do |tc|
158-
next unless ARGV.empty? || ARGV.any? {|n| tc.name.match(/#{n}/)}
159-
run_tc(tc, **options.merge(result_count: result_count))
160+
begin
161+
manifests.each do |manifest|
162+
Fixtures::SuiteTest::Manifest.open(manifest) do |m|
163+
m.entries.each do |tc|
164+
next unless ARGV.empty? || ARGV.any? {|n| tc.name.match(/#{n}/)}
165+
run_tc(tc, result_count: result_count, **options)
166+
end
167+
end
160168
end
161169
end
162170

spec/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/uri-cache/
2+
/w3c-rdf-tests

spec/suite_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# For now, override RDF::Utils::File.open_file to look for the file locally before attempting to retrieve it
77
module RDF::Util
88
module File
9-
REMOTE_PATH = "http://www.w3.org/2013/RDFXMLTests/"
10-
LOCAL_PATH = ::File.expand_path("../w3c-rdf/rdf-xml", __FILE__) + '/'
9+
REMOTE_PATH = "https://w3c.github.io/rdf-tests/rdf/"
10+
LOCAL_PATH = ::File.expand_path("../w3c-rdf-tests/rdf/", __FILE__) + '/'
1111

1212
class << self
1313
alias_method :original_open_file, :open_file
@@ -72,7 +72,7 @@ def self.open_file(filename_or_url, **options, &block)
7272

7373
module Fixtures
7474
module SuiteTest
75-
BASE = "http://www.w3.org/2013/RDFXMLTests/"
75+
BASE = "https://w3c.github.io/rdf-tests/rdf/"
7676
FRAME = JSON.parse(%q({
7777
"@context": {
7878
"xsd": "http://www.w3.org/2001/XMLSchema#",
@@ -124,7 +124,7 @@ class Entry < JSON::LD::Resource
124124
attr_accessor :logger
125125

126126
def base
127-
"http://www.w3.org/2013/RDFXMLTests/" + action.split('/')[-2,2].join("/")
127+
RDF::URI(action)
128128
end
129129

130130
# Alias data and query

spec/suite_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
describe "w3c rdfcore tests" do
77
require_relative 'suite_helper'
88

9-
%w(manifest.ttl).each do |man|
9+
%w(rdf11/rdf-xml/manifest.ttl).each do |man|
1010
Fixtures::SuiteTest::Manifest.open(Fixtures::SuiteTest::BASE + man) do |m|
1111
describe m.comment do
1212
m.entries.each do |t|

spec/writer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ class FOO < RDF::Vocabulary("http://foo/"); end
684684
# W3C RDF/XML Test suite from https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-xml/tests/
685685
describe "w3c RDF/XML tests" do
686686
require 'suite_helper'
687-
%w(manifest.ttl).each do |man|
687+
%w(rdf11/rdf-xml/manifest.ttl).each do |man|
688688
Fixtures::SuiteTest::Manifest.open(Fixtures::SuiteTest::BASE + man) do |m|
689689
describe m.comment do
690690
m.entries.each do |t|

0 commit comments

Comments
 (0)