Moved tests from scripts/ to test/scripts/

This commit is contained in:
2022-11-11 14:51:47 +00:00
parent 0aa6e4063b
commit 2c143a8be5
36 changed files with 10 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ void error(char* msg) {
int main() {
{
size_t size = 0;
char* source = readFile("../scripts//test/call-from-host.toy", &size);
char* source = readFile("scripts/call-from-host.toy", &size);
unsigned char* tb = compileString(source, &size);
free((void*)source);

View File

@@ -84,7 +84,7 @@ int main() {
{
//source
size_t sourceLength = 0;
char* source = readFile("../scripts/test/sample_code.toy", &sourceLength);
char* source = readFile("scripts/sample_code.toy", &sourceLength);
//test basic compilation & collation
Lexer lexer;

View File

@@ -175,7 +175,7 @@ int main() {
}
{
//run each file in ../scripts/test/
//run each file in tests/scripts/
char* filenames[] = {
"arithmetic.toy",
"casting.toy",
@@ -206,7 +206,7 @@ int main() {
printf("Running %s\n", filenames[i]);
char buffer[128];
snprintf(buffer, 128, "../scripts/test/%s", filenames[i]);
snprintf(buffer, 128, "scripts/%s", filenames[i]);
runSourceFile(buffer);
}
@@ -216,8 +216,8 @@ int main() {
//read source
size_t dummy;
size_t exportSize, importSize;
char* exportSource = readFile("../scripts/test/separate-exports.toy", &dummy);
char* importSource = readFile("../scripts/test/separate-imports.toy", &dummy);
char* exportSource = readFile("scripts/separate-exports.toy", &dummy);
char* importSource = readFile("scripts/separate-imports.toy", &dummy);
//compile
unsigned char* exportBinary = compileString(exportSource, &exportSize);

View File

@@ -128,7 +128,7 @@ typedef struct Payload {
int main() {
{
//run each file in ../scripts/test/
//run each file in test/scripts
Payload payloads[] = {
{"interactions.toy", "standard", hookStandard}, //interactions needs standard
{"standard.toy", "standard", hookStandard},
@@ -140,7 +140,7 @@ int main() {
printf("Running %s\n", payloads[i].fname);
char fname[128];
snprintf(fname, 128, "../scripts/test/lib/%s", payloads[i].fname);
snprintf(fname, 128, "scripts/lib/%s", payloads[i].fname);
//compile the source
size_t size = 0;

View File

@@ -138,7 +138,7 @@ static int consume(Interpreter* interpreter, LiteralArray* arguments) {
int main() {
{
size_t size = 0;
char* source = readFile("../scripts/test/opaque-data-type.toy", &size);
char* source = readFile("scripts/opaque-data-type.toy", &size);
unsigned char* tb = compileString(source, &size);
free((void*)source);

View File

@@ -90,7 +90,7 @@ int main() {
{
//get the source file
size_t size = 0;
char* source = readFile("../scripts/test/sample_code.toy", &size);
char* source = readFile("scripts/sample_code.toy", &size);
//test parsing a chunk of junk (valgrind will find leaks)
Lexer lexer;