Giter Club home page Giter Club logo

Comments (6)

strager avatar strager commented on June 14, 2024 1

Answered in person: Run the quick-lint-js-test executable directly to see output.

from quick-lint-js.

brandoncc avatar brandoncc commented on June 14, 2024

Hi @strager,

I would like to work on this issue, but I can't figure out how to run the tests. Can you give me any pointers? I did install the googletest library, and I also installed https://github.com/alepez/vim-gtest in vim. When I try to run the test file using that plugin, vim tells me permission is denied for ./test. Am I on the right track?

from quick-lint-js.

strager avatar strager commented on June 14, 2024

For instructions on building and running the test suite, see this documentation: https://github.com/strager/quick-lint-js/blob/master/docs/BUILDING.md Specifically step 3 Run. The test suite is a single executable you can run from a command line.

I did install the googletest library

You don't need to install googletest yourself. It's packaged in quick-lint-js' repository.

I also installed https://github.com/alepez/vim-gtest in vim.

I haven't used or heard of this plugin, so I don't know if it will work with quick-lint-js. I'd run the tests without this plugin first to ensure quick-lint-js' build system is configured correctly.

from quick-lint-js.

brandoncc avatar brandoncc commented on June 14, 2024

Thank you for the help. I looked around but I guess I didn't find the building file earlier.

I look forward to contributing 👍

from quick-lint-js.

brandoncc avatar brandoncc commented on June 14, 2024

Is there any way to make the test failure output more descriptive?

I'm not all that familiar with C++, so I started by copying another test that should be very similar (I have not changed the assertion at all yet):

TEST(test_lex, lex_number_with_double_underscore) {
  {
    error_collector v;
    padded_string input(u8"123__000");
    lexer l(&input, &v);
    EXPECT_EQ(l.peek().type, token_type::number);
    l.skip();
    EXPECT_EQ(l.peek().type, token_type::end_of_file);

    EXPECT_THAT(v.errors, ElementsAre(ERROR_TYPE_FIELD(
                              error_unexpected_characters_in_number, characters,
                              offsets_matcher(&input, 3, 7))));
  }
}

And this is the failing output:

ninja: Entering directory `build'
ninja: no work to do.
ninja: Entering directory `build'
[0/1] Running tests...
Test project /Users/brandoncc/dev/quick-lint-js/build
    Start 1: quick-lint-js-test
1/1 Test #1: quick-lint-js-test ...............***Failed    0.04 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.04 sec

The following tests FAILED:
          1 - quick-lint-js-test (Failed)
Errors while running CTest
FAILED: CMakeFiles/test.util
cd /Users/brandoncc/dev/quick-lint-js/build && /usr/local/Cellar/cmake/3.17.3/bin/ctest --force-new-ctest-process
ninja: build stopped: subcommand failed.

Is there any way to make it say what the failure was, and why? Since I don't know C++ well, I am hoping to write this in a TDD fashion so it will lead me to the correct answer.

from quick-lint-js.

strager avatar strager commented on June 14, 2024

In commit da23683 I reworded the documentation. Hopefully it should be easier to follow.

from quick-lint-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.