Skip to content

[Draft] Filesystem tests#8

Draft
marecl wants to merge 24 commits intops4emulation:mainfrom
marecl:fstest
Draft

[Draft] Filesystem tests#8
marecl wants to merge 24 commits intops4emulation:mainfrom
marecl:fstest

Conversation

@marecl
Copy link

@marecl marecl commented Dec 17, 2025

Tests for filesystem support
Basic functions + some nasty edge cases

Draft because I need to remake how results are presented, as reported by several testers
Otherwise, fully functional on real HW 12.02 and shadps4

Re-uploaded for a dedicated branch

@marecl marecl marked this pull request as draft December 17, 2025 18:23
@igor725
Copy link
Collaborator

igor725 commented Jan 11, 2026

We fixed sceKernelCheckReachability declaration for this PR, in the meantime the quickest way to make it compiling is to switch bundled OpenOrbis version to v0.5.4-4 in CMakeLists.txt:

  FetchContent_Declare(
    openorbis
    URL https://github.com/ps4emulation/OpenOrbis-PS4-Toolchain/releases/download/0.5.4-4/v0.5.4-4.tar.gz
    URL_HASH SHA256=53fcaa7d25c200738968bb55b9a99ac03718c38713efd7261845ab2c45641b18 # optional, hash of zip
  )

Later when Ray gonna merge his #11 fetchcontent declaration will be moved into a toolchain file.

@marecl
Copy link
Author

marecl commented Jan 11, 2026

We fixed sceKernelCheckReachability declaration for this PR, in the meantime the quickest way to make it compiling is to switch bundled OpenOrbis version to v0.5.4-4 in CMakeLists.txt:

  FetchContent_Declare(
    openorbis
    URL https://github.com/ps4emulation/OpenOrbis-PS4-Toolchain/releases/download/0.5.4-4/v0.5.4-4.tar.gz
    URL_HASH SHA256=53fcaa7d25c200738968bb55b9a99ac03718c38713efd7261845ab2c45641b18 # optional, hash of zip
  )

Later when Ray gonna merge his #11 fetchcontent declaration will be moved into a toolchain file.

Thank you for heads-up. I'd wait with merging into main, as I don't have access to my main dev device. I have to refactor a lot of those tests too, but these can be done once it's in main, otherwise results are kind of unreadable (for everyone who's not me).
Cheers

@igor725
Copy link
Collaborator

igor725 commented Jan 28, 2026

Hi again! I just merged final fixes to the new CMake architecture. You can merge those into your branch now and it should work. The only thing you have to do with your current code is to adjust CMakeLists.txt in accordance with either template or memory_test variant, both are fine.

@marecl
Copy link
Author

marecl commented Feb 18, 2026

Hi again! I just merged final fixes to the new CMake architecture. You can merge those into your branch now and it should work. The only thing you have to do with your current code is to adjust CMakeLists.txt in accordance with either template or memory_test variant, both are fine.

I've just updated to latest build system; CMake and all that but it doesn't want to compile anymore :(
So far I'm out of ideas (repeats for all 3), I'll look into this later

build] ld.lld: error: undefined symbol: main
[build] >>> referenced by crt1.c
[build] >>>               /home/user/.local/PS4Toolchain/lib/crt1.o:(_start_ps4_c)
[build] clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[build] [3/3 100% :: 0.036] Linking CXX executable code/filesystem_dirents/TEST12345/eboot.elf
[build] FAILED: code/filesystem_dirents/TEST12345/eboot.elf 
[build] : && /usr/lib64/ccache/clang++ --target=x86_64-pc-freebsd12-elf --sysroot=/home/user/.local/PS4Toolchain -nostdinc++ -g -nostartfiles -nodefaultlibs -lc -lc++ -lkernel -fuse-ld=lld -Wl,-m,elf_x86_64 -Wl,--eh-frame-hdr -Wl,--script,/home/user/.local/PS4Toolchain/link.x -pie /home/user/.local/PS4Toolchain/lib/crt1.o -o code/filesystem_dirents/TEST12345/eboot.elf -L/home/user/.local/PS4Toolchain/lib -Wl,-rpath,/lib  _deps/cpputest-build/src/CppUTest/libCppUTest.a  -lSceSystemService && cd /home/user/github/integration_tests/build/tests/code/filesystem_dirents && /usr/bin/cmake -E env OO_PS4_TOOLCHAIN=/home/user/.local/PS4Toolchain /home/user/.local/PS4Toolchain/bin/linux/create-fself -in /home/user/github/integration_tests/build/tests/code/filesystem_dirents/TEST12345/eboot.elf --out /home/user/github/integration_tests/build/tests/code/filesystem_dirents/TEST12345/eboot.oelf --eboot /home/user/github/integration_tests/build/tests/code/filesystem_dirents/TEST12345/eboot.bin --paid 0x3800000000000011 --sdkver 285212672 --fwversion 18691697672192

@igor725
Copy link
Collaborator

igor725 commented Feb 18, 2026

Hi again! I just merged final fixes to the new CMake architecture. You can merge those into your branch now and it should work. The only thing you have to do with your current code is to adjust CMakeLists.txt in accordance with either template or memory_test variant, both are fine.

I've just updated to latest build system; CMake and all that but it doesn't want to compile anymore :( So far I'm out of ideas (repeats for all 3), I'll look into this later

build] ld.lld: error: undefined symbol: main
[build] >>> referenced by crt1.c
[build] >>>               /home/user/.local/PS4Toolchain/lib/crt1.o:(_start_ps4_c)
[build] clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[build] [3/3 100% :: 0.036] Linking CXX executable code/filesystem_dirents/TEST12345/eboot.elf
[build] FAILED: code/filesystem_dirents/TEST12345/eboot.elf 
[build] : && /usr/lib64/ccache/clang++ --target=x86_64-pc-freebsd12-elf --sysroot=/home/user/.local/PS4Toolchain -nostdinc++ -g -nostartfiles -nodefaultlibs -lc -lc++ -lkernel -fuse-ld=lld -Wl,-m,elf_x86_64 -Wl,--eh-frame-hdr -Wl,--script,/home/user/.local/PS4Toolchain/link.x -pie /home/user/.local/PS4Toolchain/lib/crt1.o -o code/filesystem_dirents/TEST12345/eboot.elf -L/home/user/.local/PS4Toolchain/lib -Wl,-rpath,/lib  _deps/cpputest-build/src/CppUTest/libCppUTest.a  -lSceSystemService && cd /home/user/github/integration_tests/build/tests/code/filesystem_dirents && /usr/bin/cmake -E env OO_PS4_TOOLCHAIN=/home/user/.local/PS4Toolchain /home/user/.local/PS4Toolchain/bin/linux/create-fself -in /home/user/github/integration_tests/build/tests/code/filesystem_dirents/TEST12345/eboot.elf --out /home/user/github/integration_tests/build/tests/code/filesystem_dirents/TEST12345/eboot.oelf --eboot /home/user/github/integration_tests/build/tests/code/filesystem_dirents/TEST12345/eboot.bin --paid 0x3800000000000011 --sdkver 285212672 --fwversion 18691697672192

It looks like commit history is broken now too. Try to save your changes externally (outside of git repo) and reroll back to 5bd11ed with git reset --hard 5bd11ed. After that do a main merge into your branch using git merge origin/main, then you can put your changes back and commit them. After all those manipulations you have to do git push --force into your fstest branch, so it override current broken commit history.

@igor725
Copy link
Collaborator

igor725 commented Feb 18, 2026

I'll check whats wrong after the commit history will be ok, it created a lot of duplicated commits because of wrong merge

@igor725
Copy link
Collaborator

igor725 commented Feb 18, 2026

One problem that I see so far is that you put header files in SRC_FILES, those are shouldn't be here, this section for the actual code only, header files are included by cpp code later anyways, so compiled picks them up

image

@igor725
Copy link
Collaborator

igor725 commented Feb 18, 2026

Changing create_pkg call to create_pkg(TEST00666 5 50 "code/main.cpp;code/log.cpp;code/fs_test_tools.cpp;code/fs_test.cpp") for all tests fixed the issue for me. For some reason CMake won't treat SRC_FILES as a list of files and just passes it to the function as separate arguments, that's the reason some why some files were ignored and the compilation failed

@igor725
Copy link
Collaborator

igor725 commented Feb 18, 2026

Here's the patch file to fix it all, you can apply it using git apply "/home/path/to/this/fix.patch"
fix.patch

@marecl
Copy link
Author

marecl commented Feb 18, 2026

Changing create_pkg call to create_pkg(TEST00666 5 50 "code/main.cpp;code/log.cpp;code/fs_test_tools.cpp;code/fs_test.cpp") for all tests fixed the issue for me. For some reason CMake won't treat SRC_FILES as a list of files and just passes it to the function as separate arguments, that's the reason some why some files were ignored and the compilation failed

out of all combinations I've tried... thank you, thank you, thank you

@igor725
Copy link
Collaborator

igor725 commented Feb 18, 2026

The sce_module and sce_sys directories are not needed too, I removed them in my patch file. I only left your icon0.png files untouched, but they're not used for now as the CMake function I wrote doesn't really copy those files into the final directory, I will fix that a little bit later.

better logs
cleanup
removed unused files
dumping with cursed buffers and offsets
marecl and others added 6 commits February 26, 2026 21:25
Removed error counter from ly log util
Moved Enderman to UTests
even more annoying files
might not crash the console after running more than once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants