Code Monkey home page Code Monkey logo

Comments (7)

Shatur avatar Shatur commented on June 1, 2024 1

Opened: nvim-lua/plenary.nvim#331

from neovim-cmake.

shrkamat avatar shrkamat commented on June 1, 2024 1

No issues, thanks for the plugin. It makes nvim much closer to IDE like experience. Appreciate it. Thanks.

from neovim-cmake.

Shatur avatar Shatur commented on June 1, 2024

Thanks for the report! I noticed that it works correctly (exists with code 1) if I comment out this part:

TEST(NvimCMakePlugin, ReportsFailedTestCorrectly) {
    int divisor = 0;
    ASSERT_EQ(10, 100/divisor);
}

The following program is also exits with the expected exit code:

int main()
{
    return 1;
}

I use exit codes that returned by Plenary.Job, so I assume that it's an upstream issue.

from neovim-cmake.

shrkamat avatar shrkamat commented on June 1, 2024

Thanks @Shatur. This fixes the issue, but I don't see complete crash log in CMake build_and_run output.

In shell I see this extra info Floating point exception (core dumped) , so it's not super explicit about crash. (exit code 136 vs crashed exit 136).

exception

from neovim-cmake.

Shatur avatar Shatur commented on June 1, 2024

In shell I see this extra info Floating point exception (core dumped)

Not sure why it not displayed... I catching all stdout and stderr.

from neovim-cmake.

shrkamat avatar shrkamat commented on June 1, 2024

Yes indeed both stderr and stdout is captures. Looks like is something to do with the shell (see last arg to subprocess.Popen).

#!/bin/python3

import subprocess


def print_lines(lines):
    if lines:
        print(lines.decode('utf-8'))
    else:
        print('None\n')

p = subprocess.Popen('./build/bin/nvim-cmake-plugin-test', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, start_new_session=False, shell=True)
stdout, stderror = p.communicate()
p.wait();

print('shell=True-------------------------------')
print_lines (stdout)
print_lines (stderror)
print ('shell=True exit code', p.returncode)
print('-----------------------------------------')


p = subprocess.Popen('./build/bin/nvim-cmake-plugin-test', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, start_new_session=False, shell=False)
stdout, stderror = p.communicate()
p.wait();

print('shell=False-------------------------------')
print_lines (stdout)
print_lines (stderror)
print ('exit code', p.returncode)
print('-----------------------------------------')

Output

shell=True-------------------------------
update : 0
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from NvimCMakePlugin
[ RUN      ] NvimCMakePlugin.ReportsNonZeroValueForFailedTest
/home/skamath/Projects/NVimCMakePluginTests/test.cpp:4: Failure
Value of: false
  Actual: false
Expected: true
[  FAILED  ] NvimCMakePlugin.ReportsNonZeroValueForFailedTest (0 ms)
[ RUN      ] NvimCMakePlugin.ReportsCrashedTestIncorrectly
Floating point exception (core dumped)

None

shell=True exit code 136
-----------------------------------------


shell=False-------------------------------
update : 0
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from NvimCMakePlugin
[ RUN      ] NvimCMakePlugin.ReportsNonZeroValueForFailedTest
/home/skamath/Projects/NVimCMakePluginTests/test.cpp:4: Failure
Value of: false
  Actual: false
Expected: true
[  FAILED  ] NvimCMakePlugin.ReportsNonZeroValueForFailedTest (0 ms)
[ RUN      ] NvimCMakePlugin.ReportsCrashedTestIncorrectly

None

exit code -8
-----------------------------------------

With shell=False even the exit code looks very different. Not sure what to infer from this.

from neovim-cmake.

Shatur avatar Shatur commented on June 1, 2024

Can't help you here, Plenary don't have such option: https://github.com/nvim-lua/plenary.nvim/blob/9069d14a120cadb4f6825f76821533f2babcab92/lua/plenary/job.lua#L6

from neovim-cmake.

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.