mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Moved tests from scripts/ to test/scripts/
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user