lvc / api-sanity-checker

An automatic generator of basic unit tests for a C/C++ library
https://lvc.github.io/api-sanity-checker/
GNU Lesser General Public License v2.1
85 stars 13 forks source link

Missing dump1.i #17

Closed miranska closed 11 years ago

miranska commented 11 years ago

Hi Andrey, I am trying to install api-sanity-checker on SuSe 11.2. Tests are generated successfully, but their compilation fails due to absence of dump1.i. Could you please tell me how to fix this?

Thank you, Andriy

$> cat /etc/SuSE-release SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 2

$> api-sanity-checker -version API Sanity Checker 1.98.4

$> ctags --version Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert

$> gcc --version gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revision 150839]

$> abi-compliance-checker --version ABI Compliance Checker (ACC) 1.99.8.2

$> ./api-sanity-checker.pl --test --debug

testing C library API run perl ./api-sanity-checker.pl -l libsample_c -d libsample_c/descriptor.xml -gen -build -run -show-retval -debug running abi-compliance-checker -l libsample_c -dump "libsample_c/descriptor.xml" -dump-path "debug/libsample_c/1.0/ABI.dump" -extra-info "debug/libsample_c/1.0/extra-info" -extra-dump -debug Using GCC 4.4 (x86_64-suse-linux) checking header(s) 1.0 ... Detected code: "operator();" Using C++ compatibility mode creating library ABI dump ... library ABI has been dumped to: debug/libsample_c/1.0/ABI.dump you can transfer this dump everywhere and use instead of the 1.0 version descriptor generating tests: 9/9 [100.00%], success/fail: 9/0

  1. see generated test suite in the directory 'tests/libsample_c/1.0/'
  2. for viewing tests use 'tests/libsample_c/1.0/view_tests.html'
  3. use -build option for building tests

building tests: 9/9 [100.00%], success/fail: 0/9
ERROR: tests were not built yet ERROR: analysis has failed

$> cat logs/libsample_c/1.0/log.txt Temporary header file '/tmp/drVFA0O60C/dump1.h' with the following content will be compiled to create GCC translation unit dump:

// add includes

include "/root/api-sanity-checker-1.98.4/libsample_c/libsample.h"

The GCC parameters: gcc -fdump-translation-unit -fkeep-inline-functions -c -fpreprocessed -x c++-header -fpermissive -w "/tmp/drVFA0O60C/dump1.i"

$> cat tests/libsample_c/1.0/groups/libsample/functions/create_out_param/build_log test.c:2:19: error: dump1.i: No such file or directory make: *\ [test] Error 1

aponomarenko commented 11 years ago

Hi,

Thank you for the detailed issue report. Could you please also cat tests/libsample_c/1.0/groups/libsample/functions/create_out_param/test.c?

aponomarenko commented 11 years ago

Could you please also zip the ./debug subdirectory and share the package anywhere or send it to aponomarenko@rosalab.ru

Thank you.

miranska commented 11 years ago

Thank you for fast reply! You can find tar of dump and test directories at https://docs.google.com/file/d/0B-qVvwvWFqV3M2NlREJGX09ydU0/edit?usp=sharing

$> cat tests/libsample_c/1.0/groups/libsample/functions/create_out_param/test.c
#include <libsample.h>
#include <dump1.i>
int main(int argc, char *argv[])
{
    struct out_opaque_struct* out = 0;
    create_out_param((struct out_opaque_struct**)&out); //target call
    return 0;
}
aponomarenko commented 11 years ago

Thank you. The bug has been fixed in 1.98.5. Please update and check it:

https://github.com/lvc/api-sanity-checker/releases

miranska commented 11 years ago

Wow, that was fast! I am now able to run 8 test cases out of 9. However, 9th one still has #include <dump1.i> in it. I uploaded debug and tests dirs to https://docs.google.com/file/d/0B-qVvwvWFqV3NnRCQjBKdmZzR0E/edit?usp=sharing

./api-sanity-checker.pl --test --debug

testing C library API
run perl ./api-sanity-checker.pl -l libsample_c -d libsample_c/descriptor.xml -gen -build -run -show-retval -debug
running abi-compliance-checker -l libsample_c -dump "libsample_c/descriptor.xml" -dump-path "debug/libsample_c/1.0/ABI.dump" -extra-info "debug/libsample_c/1.0/extra-info" -extra-dump -debug
Using GCC 4.4 (x86_64-suse-linux)
checking header(s) 1.0 ...
Detected code: "operator();"
Using C++ compatibility mode
creating library ABI dump ...
library ABI has been dumped to:
  debug/libsample_c/1.0/ABI.dump
you can transfer this dump everywhere and use instead of the 1.0 version descriptor
generating tests: 9/9 [100.00%], success/fail: 9/0    

1. see generated test suite in the directory 'tests/libsample_c/1.0/'
2. for viewing tests use 'tests/libsample_c/1.0/view_tests.html'
3. use -build option for building tests

building tests: 9/9 [100.00%], success/fail: 8/1    
running tests: 8/8 [100.00%], success/fail: 7/1    
creating report ...
see test results in the file:
  test_results/libsample_c/1.0/test_results.html
result: SUCCESS (8 test cases, 7 passed, 1 failed)

testing C++ library API
run perl ./api-sanity-checker.pl -l libsample_cpp -d libsample_cpp/descriptor.xml -gen -build -run -show-retval -debug
running abi-compliance-checker -l libsample_cpp -dump "libsample_cpp/descriptor.xml" -dump-path "debug/libsample_cpp/1.0/ABI.dump" -extra-info "debug/libsample_cpp/1.0/extra-info" -extra-dump -debug
Using GCC 4.4 (x86_64-suse-linux)
checking header(s) 1.0 ...
creating library ABI dump ...
library ABI has been dumped to:
  debug/libsample_cpp/1.0/ABI.dump
you can transfer this dump everywhere and use instead of the 1.0 version descriptor
generating tests: 29/29 [100.00%], success/fail: 29/0    

1. see generated test suite in the directory 'tests/libsample_cpp/1.0/'
2. for viewing tests use 'tests/libsample_cpp/1.0/view_tests.html'
3. use -build option for building tests

building tests: 29/29 [100.00%], success/fail: 29/0    
running tests: 29/29 [100.00%], success/fail: 28/1    
creating report ...
see test results in the file:
  test_results/libsample_cpp/1.0/test_results.html
result: SUCCESS (29 test cases, 28 passed, 1 failed)
$> cat ./tests/libsample_c/1.0/groups/libsample/functions/func_simple_parameters/test.c 
#include <libsample.h>
#include <dump1.i>
int main(int argc, char *argv[])
{
    char i [] = {
        'B',
        'C',
        'D',
        'E',
        '\0'};
    unsigned char j [] = {
        'F',
        'G',
        'H',
        'I',
        '\0'};
    char* k = 0;
    func_simple_parameters(
        1,
        1.5f,
        2.5,
        3.5L,
        2LL,
        'A',
        3,
        "h",
        i,
        j,
        (char**)&k); //target call
    return 0;
} 
aponomarenko commented 11 years ago

Thank you. Please check 1.98.6:

https://github.com/lvc/api-sanity-checker/releases

miranska commented 11 years ago

Thank you! Sorry for delay -- I stopped receiving notifications (don't know why). Now the tests are passing. Does the output look right to you?

perl api-sanity-checker.pl -test

testing C library API
Using GCC 4.4 (x86_64-suse-linux)
checking header(s) 1.0 ...
Using C++ compatibility mode
creating library ABI dump ...
library ABI has been dumped to:
  /tmp/6sfJdiYSDj/ABI.dump
you can transfer this dump everywhere and use instead of the 1.0 version descriptor
generating tests: 9/9 [100.00%], success/fail: 9/0    

1. see generated test suite in the directory 'tests/libsample_c/1.0/'
2. for viewing tests use 'tests/libsample_c/1.0/view_tests.html'
3. use -build option for building tests

building tests: 9/9 [100.00%], success/fail: 9/0    
running tests: 9/9 [100.00%], success/fail: 8/1    
creating report ...
see test results in the file:
  test_results/libsample_c/1.0/test_results.html
result: SUCCESS (9 test cases, 8 passed, 1 failed)

testing C++ library API
Using GCC 4.4 (x86_64-suse-linux)
checking header(s) 1.0 ...
creating library ABI dump ...
library ABI has been dumped to:
  /tmp/Blc4n7XUgb/ABI.dump
you can transfer this dump everywhere and use instead of the 1.0 version descriptor
generating tests: 29/29 [100.00%], success/fail: 29/0    

1. see generated test suite in the directory 'tests/libsample_cpp/1.0/'
2. for viewing tests use 'tests/libsample_cpp/1.0/view_tests.html'
3. use -build option for building tests

building tests: 29/29 [100.00%], success/fail: 29/0    
running tests: 29/29 [100.00%], success/fail: 28/1    
creating report ...
see test results in the file:
  test_results/libsample_cpp/1.0/test_results.html
result: SUCCESS (29 test cases, 28 passed, 1 failed)
aponomarenko commented 11 years ago

Yes, it does. Exactly. One test is intended to fail to verify that the framework is able to catch problems.

Please comment on this issue if you'll encounter this problem again on "real" libraries.

Thank you.