Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate new doctest test #28

Closed
jxxcarlson opened this issue Apr 14, 2015 · 3 comments
Closed

Can't generate new doctest test #28

jxxcarlson opened this issue Apr 14, 2015 · 3 comments

Comments

@jxxcarlson
Copy link
Contributor

Hi @jirutka , am trying to get back to writing a test suite for asciidoctor-latex.

In /asciidoctor-latex/test/examples/adoc I have the file env.adoc with contents

== Env test

[env.theorem]
--
The equation $a^2 + b^2  = c^2$
has infinitely many non-proportional
integer solutions.
--

When I try to generate a test for this example, I get the following error:

$ bundle exec rake generate PATTERN='env:*' 
(in /Users/carlson/dev/git/asciidoctor-latex)
rake aborted!
Don't know how to build task 'generate'

In Rakefile there is the text

 namespace :generate do
    DocTest::GeneratorTask.new(:latex) do |t|
      t.converter_opts[:backend_name] = :latex
      t.output_suite = DocTest::Latex::ExamplesSuite.new(examples_path: 'test/examples/tex')
      t.examples_path.unshift 'test/examples/adoc'  # extra input examples
    end

    DocTest::GeneratorTask.new(:html) do |t|
      t.converter_opts[:backend_name] = :html
      t.output_suite = DocTest::HTML::ExamplesSuite.new(examples_path: 'test/examples/html')
      t.examples_path = ['test/examples/asciidoc-html']  # input examples
    end
  end

Should this not be sufficient?

I will need you to remind me how to run just a single test since otherwise the output is overwheming.

BTW, I am in Beijing again -- till May 7 -- even more internet restrictions than before: no Google search or gmail, several things don't work here on noteshare because they use googleapis, which are blocked, and of coure no New York Times, Facebook, or Twitter. I will have to get a VPN to tunnel through the Great Firewall (as it is known here). Thank goodness Github works!

@jirutka
Copy link
Member

jirutka commented Apr 14, 2015

Please read the readme first, it’s not so long. Examples must be in a specific format, that is described here for AsciiDoc and here (or here) for LaTeX.

Before specifying your own input examples, you should generate and validate output examples for the reference examples provided by DocTest.

As you can see in in your Rakefile (or more clearly when run bundle exec rake -D), there’s no task named generate, you have two generator tasks under the generate namespacegenerate:latex and generate:html – so run one of these.

How to run only subset of the tests is described in this issue.

Ad Great Firewall: If you have an office in USA, then you can run e.g. OpenVPN server on your computer at the office and use it as a gateway – simply route all traffic from your computer in China through this VPN.

@jxxcarlson
Copy link
Contributor Author

Everything working like a charm now .. and I was able to refactor withuout fear:-) Thanks!!

@mojavelinux
Copy link
Member

Everything working like a charm now .. and I was able to refactor withuout fear:-) Thanks!!

Yeah!! \o/

Great work @jxxcarlson & @jirutka!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants