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

Added test_case related to anonymous namespace. #75

Conversation

bveldhoen
Copy link

Added a unit test to try and reproduce a suspected issue. I'm running into a problem when executing tests. What am I doing wrong?

bramv@WS01:~/src/projects/clang-uml/debug/tests$ ./test_cases
[info] [tid 24231] [generator.h:460] Generating diagram t00002_class.puml
LLVM ERROR: Cannot chdir into "/home/bramv/src/projects/clang-uml/debug/tests"!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_cases is a Catch v2.13.8 host application.
Run with -? for options

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
t00002
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/home/bramv/src/projects/clang-uml/tests/t00002/test_case.h:19
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

/home/bramv/src/projects/clang-uml/tests/t00002/test_case.h:19: FAILED:
  {Unknown expression after the reported line}
due to a fatal error condition:
  SIGABRT - Abort (abnormal termination) signal

===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
test cases: 1 | 1 failed
assertions: 5 | 4 passed | 1 failed

Aborted (core dumped)

@codecov-commenter
Copy link

Codecov Report

Merging #75 (aaac13a) into master (c7d201e) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #75   +/-   ##
=======================================
  Coverage   86.43%   86.43%           
=======================================
  Files          80       80           
  Lines        6346     6346           
=======================================
  Hits         5485     5485           
  Misses        861      861           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bkryza
Copy link
Owner

bkryza commented Jan 14, 2023

@bveldhoen Thanks for the PR.

First of all, please note that there is already a test case for anonymous namespace:
https://github.com/bkryza/clang-uml/blob/master/docs/test_cases/t00015.md

Also your new test case does not crash or fail - my suspicion was that you had an anonymous namespace in the root namespace?

As to the issue with running the test cases on your system, the error says:

LLVM ERROR: Cannot chdir into "/home/bramv/src/projects/clang-uml/debug/tests"!

Could it be a permissions issue?

in any case - can you try make test and see if that works?

@bveldhoen
Copy link
Author

make test output:

[100%] Built target clang-uml
make[2]: Leaving directory '/home/bramv/src/projects/clang-uml/debug'
make[1]: Leaving directory '/home/bramv/src/projects/clang-uml/debug'
CTEST_OUTPUT_ON_FAILURE=1 make -C debug test
make[1]: Entering directory '/home/bramv/src/projects/clang-uml/debug'
Running tests...
Test project /home/bramv/src/projects/clang-uml/debug
    Start 1: test_util
1/7 Test #1: test_util ........................   Passed    0.07 sec
    Start 2: test_decorator_parser
2/7 Test #2: test_decorator_parser ............   Passed    0.04 sec
    Start 3: test_config
3/7 Test #3: test_config ......................   Passed    0.07 sec
    Start 4: test_model
4/7 Test #4: test_model .......................   Passed    0.04 sec
    Start 5: test_thread_pool_executor
5/7 Test #5: test_thread_pool_executor ........   Passed    1.06 sec
    Start 6: test_cases
6/7 Test #6: test_cases .......................Subprocess aborted***Exception:   0.12 sec
[info] [tid 155145] [generator.h:460] Generating diagram t00002_class.puml
LLVM ERROR: Cannot chdir into "/home/bramv/src/projects/clang-uml/debug/tests"!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_cases is a Catch v2.13.8 host application.
Run with -? for options

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
t00002
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/home/bramv/src/projects/clang-uml/tests/t00002/test_case.h:19
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

/home/bramv/src/projects/clang-uml/tests/t00002/test_case.h:19: FAILED:
  {Unknown expression after the reported line}
due to a fatal error condition:
  SIGABRT - Abort (abnormal termination) signal

===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
test cases: 1 | 1 failed
assertions: 5 | 4 passed | 1 failed


    Start 7: test_filters
7/7 Test #7: test_filters .....................   Passed    0.11 sec

86% tests passed, 1 tests failed out of 7

Total Test time (real) =   1.52 sec

The following tests FAILED:
          6 - test_cases (Subprocess aborted)
Errors while running CTest
make[1]: *** [Makefile:91: test] Error 8
make[1]: Leaving directory '/home/bramv/src/projects/clang-uml/debug'
make: *** [Makefile:72: test] Error 2

@bveldhoen
Copy link
Author

Abandoning because this scenario is already covered.

@bveldhoen bveldhoen closed this Jan 15, 2023
@bveldhoen
Copy link
Author

bveldhoen commented Jan 15, 2023

I suspect the error has something to do with installed clang versions. On another machine, I didn't get this error while running the tests (without modifications). Also, on the machine on which I was getting the error, I needed to specifically use clang-cpp12 in order to get it to build (see change to CMakeLists.txt file in this PR). I probably need to compare the differences in installed clang packages on both machines. Will do so when I have the time.

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

Successfully merging this pull request may close these issues.

4 participants