Skip to content

Commit

Permalink
Merge branch 'flavorjones-add-test-lldb-and-update-docs' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Mar 7, 2021
2 parents 9e7e733 + a0c372c commit f1aeb9e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -20,14 +20,14 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA
* [JRuby] Update the algorithm used to calculate `Node#line` to be wrong less-often. The underlying parser, Xerces, does not track line numbers, and so we've always used a hacky solution for this method. [[#1223](https://github.com/sparklemotion/nokogiri/issues/1223)]


## v1.11.1 / 2021-01-06
## 1.11.1 / 2021-01-06

### Fixed

* [CRuby] If `libxml-ruby` is loaded before `nokogiri`, the SAX and Push parsers no longer call `libxml-ruby`'s handlers. Instead, they defensively override the libxml2 global handler before parsing. [[#2168](https://github.com/sparklemotion/nokogiri/issues/2168)]


## v1.11.0 / 2021-01-03
## 1.11.0 / 2021-01-03

### Notes

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -47,6 +47,8 @@ Nokogiri supports both CRuby and JRuby, and has native code specific to each (th
- Whenever possible, implement shared behavior as shared Ruby code (i.e., write as little native code as reasonable).
- Whenever possible, write tests that are not platform-specific (which includes skipping).

Notably, despite all parsers being standards-compliant, there are behavioral inconsistencies between the parsers used in the CRuby and JRuby implementations, and Nokogiri does not and should not attempt to remove these inconsistencies. Instead, we surface these differences in the test suite when they are important/semantic; or we intentionally write tests to depend only on the important/semantic bits (omitting whitespace from regex matchers on results, for example).


Nokogiri is widely used in the Ruby ecosystem, and so extra care should be taken to avoid introducing breaking changes. Please read our [Semantic Versioning Policy](https://nokogiri.org/index.html#semantic-versioning-policy) to understand what we consider to be a breaking change.

Expand Down
2 changes: 1 addition & 1 deletion ext/nokogiri/extconf.rb
Expand Up @@ -470,7 +470,7 @@ def process_recipe(name, version, static_p, cross_p)
instead, then abort this installation process and install nokogiri as
instructed at:
https://nokogiri.org/tutorials/installing_nokogiri.html#install-with-system-libraries
https://nokogiri.org/tutorials/installing_nokogiri.html#installing-using-standard-system-libraries
EOM

Expand Down
6 changes: 3 additions & 3 deletions lib/nokogiri/extension.rb
Expand Up @@ -2,11 +2,11 @@

# load the C or Java extension
begin
RUBY_VERSION =~ /(\d+\.\d+)/
require "nokogiri/#{$1}/nokogiri"
::RUBY_VERSION =~ /(\d+\.\d+)/
require "nokogiri/#{Regexp.last_match(1)}/nokogiri"
rescue LoadError => e
if e.message =~ /GLIBC/
warn <<~EOM
warn(<<~EOM)
ERROR: It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17:
Expand Down
4 changes: 2 additions & 2 deletions lib/nokogiri/version/info.rb
Expand Up @@ -82,8 +82,8 @@ def to_hash
unless jruby?
cppflags = ["-I#{header_directory.shellescape}"]
if libxml2_using_packaged?
cppflags << "-I#{File.join(header_directory, "include").shellescape}"
cppflags << "-I#{File.join(header_directory, "include/libxml2").shellescape}"
cppflags << "-I#{File.join(header_directory, 'include').shellescape}"
cppflags << "-I#{File.join(header_directory, 'include/libxml2').shellescape}"
end
nokogiri["cppflags"] = cppflags
end
Expand Down
11 changes: 11 additions & 0 deletions rakelib/test.rake
Expand Up @@ -64,6 +64,13 @@ class GdbTestTask < ValgrindTestTask
end
end

class LldbTestTask < ValgrindTestTask
def ruby(*args, **options, &block)
command = "lldb #{RUBY} -- #{args.join(' ')}"
sh(command, **options, &block)
end
end

def nokogiri_test_task_configuration(t)
t.libs << "test"
t.test_files = FileList["test/**/test_*.rb"]
Expand All @@ -82,4 +89,8 @@ namespace "test" do
GdbTestTask.new("gdb") do |t|
nokogiri_test_task_configuration(t)
end

LldbTestTask.new("lldb") do |t|
nokogiri_test_task_configuration(t)
end
end

0 comments on commit f1aeb9e

Please sign in to comment.