1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <QtCore/QCoreApplication>
#include "lint.h"
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
char datapath[PATH_MAX], fullpath[PATH_MAX], filename[PATH_MAX];
FILE *fp = fopen("jslist.txt", "r");
if (!fp)
{
fprintf(stderr, "%s: Failed to open list file\n", argv[0]);
return -1;
}
if (getenv("srcdir"))
{
strcpy(datapath, getenv("srcdir"));
}
strcat(datapath, "/../data/");
while (!feof(fp))
{
if (fscanf(fp, "%254s\n", filename) != 1)
{
fprintf(stderr, "%s: Failed to fscanf jslist.txt.\n", argv[0]);
return -1;
}
printf("Testing script: %s\n", filename);
strcpy(fullpath, datapath);
strcat(fullpath, filename);
testGlobalScript(fullpath);
}
fclose(fp);
return 0;
}
|