Quantcast

how to run the SQLite test suite ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to run the SQLite test suite ?

Jason Vas Dias
Good day -

I just downloaded & built sqlite-autoconf-3180000 on Linux x86_64 .

Now I would like run some some 'test suite' that will allow me to
determine if the build is OK - but there appears to be none :

$ make check
make: Nothing to be done for 'check'.

(no test runs are done - this appears to be an alias for 'check-am', to check
 that automake generation succeeeded) .

$ make test
make: *** No rule to make target 'test'.  Stop.

In SQLite source directory:
$   find . -iname '*test*'
$
There is no SQLite source file with the word 'Test' in the name, ignoring case .


You have put up a page on the web called 'How SQLite is Tested' :
https://sqlite.org/testing.html

But no-where on that page is described 'How to Test SQLite'  ,
nor are there any links to the test-suite source code, which
evidently is not shipped in the SQLite source code, but which
apparently exists, since the page states:
" As of version 3.16.2 (2017-01-06), the SQLite library consists of
approximately
  122.9 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or,
  in other words, lines of code excluding blank lines and comments.) By
  comparison, the project has 745 times as much test code and test
scripts - 91596.1
  KSLOC.
" .

Where is this 91596.1 KSLOC of test code ?

It does not appear to be shipped with SQLite .

How do I run the tests ?

There appears to be no documentation for this
online or in the source tarball .

Thanks & Regards,
Jason
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to run the SQLite test suite ?

Simon Slavin-3

On 10 May 2017, at 2:26pm, Jason Vas Dias <[hidden email]> wrote:

> I just downloaded & built sqlite-autoconf-3180000 on Linux x86_64 .
>
> Now I would like run some some 'test suite' that will allow me to
> determine if the build is OK - but there appears to be none :

What you have there is the amalgamation source code: just enough source code to be able to include SQLite in your programming projects.  The one you want is the complete source tree at the bottom of the page, under the heading _Alternative Source Code Formats_.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to run the SQLite test suite ?

Richard Hipp-3
In reply to this post by Jason Vas Dias
On 5/10/17, Jason Vas Dias <[hidden email]> wrote:
>
> Now I would like run some some 'test suite' that will allow me to
> determine if the build is OK - but there appears to be none :
>

As Simon already pointed out, you have download the pre-compiled
"amalgamation" sources.  That tarball does not include any tests, in
as much as the source code to the amalgamation has already been
thoroughly tested.

The TCL tests are available in the canonical source tree at
https://sqlite.org/src

The SQLLOGICTEST suite is available in a separate repository at
https://sqlite.org/sqllogictest

Both of the test suites above are designed to test the source code,
not machine code. By this I mean that both of the test suites above
compile SQLite separately and either build SQLite into a test
application, or use non-standard compile-time options to facilitate
testing.  Machine code is generated for the test suites above, but it
is not exactly the same machine code that will be generated for your
application.  The tests above are very powerful for verifying the
correctness of the SQLite source code, but since they are not "fly
what you test and test what you fly" they do not qualify as tests for
the generated machine code.  In other words, the test suites above
assume there are no bugs in your C compiler.

The source code in "sqlite3.c" has already been thoroughly tested for
you.  So if you trust your compiler to correctly convert C source code
into machine code, no further testing should be necessary.

If you do not trust your compiler and/or you want to independently
verify that the generated machine code you are actually shipping is
correct, that requires the TH3 test suite, which is not open source.

Note that most people explicitly trust their C compilers.  In fact,
both Apple and Google do their own builds of SQLite for MacOS/iOS and
Android that use the SQLITE_UNTESTABLE
(https://www.sqlite.org/compile.html#untestable) compile-time option,
thereby preventing you from completely testing the machine code even
if you wanted to and have access to TH3.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...