SQLite Forum

Automated Tests

Automated Tests

(1) By swdev1 on 2020-06-08 11:25:17 [link] [source]

Hi there

My environment : Linux XX 5.6.15-arch1-1 #1 SMP PREEMPT Wed, 27 May 2020 23:42:26 +0000 x86_64 GNU/Linux

I downloaded sqlite-autoconf-3320200.tar.gz from your downloads page.

I de-compressed the file and cd'ed into the newly created directory.

I ran ./configure followed by make.

I got the following warning

sqlite3.c: In function ‘sqlite3SelectNew’:
sqlite3.c:129018:10: warning: function may return address of local variable [-Wreturn-local-addr]
129018 |   return pNew;
       |          ^~~~
sqlite3.c:128978:10: note: declared here
128978 |   Select standin;
       |          ^~~~~~~

I assume that this is not a problem.

I then tried to run make test to run any automated tests, and I got the message that there was no 'test' rule.
Are there any tests that I can run so I can make sure that I have correctly built sqlite?
The reason that I am doing this is so that I can run the PVStudio static analyser on your code to see if there are any errors and help you to fix them.


(2) By Warren Young (wyoung) on 2020-06-08 11:41:14 in reply to 1 [source]

First web search result for “SQLite test”: https://sqlite.org/testing.html

(3) By swdev1 on 2020-06-08 13:05:55 in reply to 2 [link] [source]

Thanks for your reply. It pointed me i the right direction.

I realised that I should not have downloaded the amalgam file, but cloned the repository via fossil e.g. fossil clone https://www.sqlite.org/src sqlite.fossil

This I have now done and am building the test files.

(4) By Richard Hipp (drh) on 2020-06-08 13:27:21 in reply to 1 [link] [source]

This is a false-positive warning that has first started appearing with GCC 10. There was a [previous thread] on this forum about the problem. A patch is now on the SQLite trunk that placates GCC and suppresses the warning.

Your take-away is that the warning is a false-positive and can be safely ignored.