all files now have an implicit empty actor, even if there is no actor statement present
All checks were successful
Build / build-linux (push) Successful in 39s
Build / build-linux (release) Successful in 41s
Build / build-windows (release) Successful in 41s
Build / package-dist (release) Successful in 12s
Build / build-windows (push) Successful in 43s
Build / package-dist (push) Has been skipped

This commit is contained in:
2025-02-18 19:38:24 -06:00
parent bff39b0e9f
commit dcd767e5f9
3 changed files with 30 additions and 14 deletions

View File

@@ -126,6 +126,19 @@ jobs:
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true --cross-file mingw32.cross meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true --cross-file mingw32.cross
meson compile -C build meson compile -C build
- name: Test Prosperon
env:
TRACY_NO_INVARIANT_CHECK: 1
run: |
meson test --print-errorlogs -C build
- name: Upload Test Log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: testlog-linux
path: build/meson-logs/testlog.txt
- name: Create package folder - name: Create package folder
run: | run: |
mkdir _pack mkdir _pack

View File

@@ -207,6 +207,6 @@ tests = [
] ]
foreach file : tests foreach file : tests
test(file, prosperon, args:['tests/' + file + '.js'], depends:copy_tests) test(file, prosperon_raw, args:['tests/' + file + '.js'], depends:copy_tests)
endforeach endforeach

View File

@@ -14,22 +14,22 @@ void free_zip(void)
zip_buffer_global = NULL; zip_buffer_global = NULL;
} }
void prosperon_mount_core() int prosperon_mount_core()
{ {
size_t size; size_t size;
FILE *f = fopen(prosperon, "rb"); FILE *f = fopen(prosperon, "rb");
if (!f) { perror("fopen"); return; } if (!f) { perror("fopen"); return 0; }
if (fseek(f, 0, SEEK_END) != 0) { perror("fseek"); fclose(f); return; } if (fseek(f, 0, SEEK_END) != 0) { perror("fseek"); fclose(f); return 0; }
size = ftell(f); size = ftell(f);
if (size < 0) { perror("ftell"); fclose(f); return; } if (size < 0) { perror("ftell"); fclose(f); return 0; }
zip_buffer_global = malloc(size); zip_buffer_global = malloc(size);
if (!zip_buffer_global) { perror("malloc"); fclose(f); return; } if (!zip_buffer_global) { perror("malloc"); fclose(f); return 0; }
rewind(f); rewind(f);
if (fread(zip_buffer_global, 1, size, f) != (size_t)size) { if (fread(zip_buffer_global, 1, size, f) != (size_t)size) {
perror("fread"); perror("fread");
free(zip_buffer_global); free(zip_buffer_global);
fclose(f); fclose(f);
return; return 0;
} }
fclose(f); fclose(f);
// Search backwards for the EOCD signature "PK\x05\x06". // Search backwards for the EOCD signature "PK\x05\x06".
@@ -49,7 +49,7 @@ fclose(f);
if (eocd_pos < 0) { if (eocd_pos < 0) {
fprintf(stderr, "EOCD not found\n"); fprintf(stderr, "EOCD not found\n");
free(zip_buffer_global); free(zip_buffer_global);
return; return 0;
} }
// Parse the EOCD record. // Parse the EOCD record.
@@ -79,15 +79,17 @@ fclose(f);
if (zip_offset < 0 || zip_offset >= size) { if (zip_offset < 0 || zip_offset >= size) {
fprintf(stderr, "Invalid zip offset computed: %ld\n", zip_offset); fprintf(stderr, "Invalid zip offset computed: %ld\n", zip_offset);
free(zip_buffer_global); free(zip_buffer_global);
return; return 0;
} }
int ret = PHYSFS_mountMemory(zip_buffer_global + zip_offset, appended_zip_size, free_zip, "core.zip", NULL, 0); int ret = PHYSFS_mountMemory(zip_buffer_global + zip_offset, appended_zip_size, free_zip, "core.zip", NULL, 0);
if (!ret) { if (!ret) {
printf("COULD NOT MOUNT! Reason: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); printf("COULD NOT MOUNT! Reason: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
return; return 0;
} }
return 1;
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
@@ -98,13 +100,14 @@ int main(int argc, char **argv) {
PHYSFS_setWriteDir(base); PHYSFS_setWriteDir(base);
PHYSFS_mount(base, "/", 0); PHYSFS_mount(base, "/", 0);
prosperon_mount_core(); int mounted = prosperon_mount_core();
/* int mounted = PHYSFS_mount("core.zip", NULL, 0); if (!mounted)
mounted = PHYSFS_mount("core.zip", NULL, 0);
if (!mounted) { if (!mounted) {
printf("Could not mount core. Reason: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); printf("Could not mount core. Reason: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
return 1; return 1;
} }
*/
script_startup(argc, argv); // runs engine.js script_startup(argc, argv); // runs engine.js
return 0; return 0;
} }