1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00

The first ever attempts to do pure libcurl test cases

This commit is contained in:
Daniel Stenberg 2002-12-12 12:11:16 +00:00
parent 0f0aaf51e0
commit 7196d784d3
5 changed files with 56 additions and 0 deletions

20
tests/libtest/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
#
# $Id$
#
AUTOMAKE_OPTIONS = foreign nostdinc
INCLUDES = -I$(top_srcdir)/include
LIBDIR = ../../lib
# here are all tools used for running libcurl tests
bin_PROGRAMS = lib500 lib501
lib500_SOURCES = lib500.c
lib500_LDADD = $(LIBDIR)/libcurl.la
lib500_DEPENDENCIES = $(LIBDIR)/libcurl.la
lib501_SOURCES = lib501.c
lib501_LDADD = $(LIBDIR)/libcurl.la
lib501_DEPENDENCIES = $(LIBDIR)/libcurl.la

10
tests/libtest/first.c Normal file
View File

@ -0,0 +1,10 @@
#include <curl/curl.h>
int main(int argc, char **argv)
{
if(argc< 2 ) {
fprintf(stderr, "Pass URL as argument please\n");
return 1;
}
curl_memdebug("memdump");

1
tests/libtest/last.c Normal file
View File

@ -0,0 +1 @@
}

12
tests/libtest/lib500.c Normal file
View File

@ -0,0 +1,12 @@
#include "first.c"
fprintf(stderr, "URL: %s\n", argv[1]);
CURL *curl;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE);
curl_easy_perform(curl);
curl_easy_cleanup(curl);
#include "last.c"

13
tests/libtest/lib501.c Normal file
View File

@ -0,0 +1,13 @@
#include "first.c"
fprintf(stderr, "URL: %s\n", argv[1]);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
return res;
#include "last.c"