fakecore

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fakecore builds real shared libraries for tests of what happens when a core is added: one that works, and several that misbehave in the ways a hostile or broken file can. It is only imported by tests.

The working one is the test core (package testcore) as a libretro library: the same game, the same .wittytest "ROM". With a C compiler it comes from fake_core.c.txt, on any platform. Windows machines rarely have one, so there this package writes the DLL byte by byte, which needs no tools and gives a real file for LoadLibrary to open. That one reports and loads like the others, but draws nothing.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCompiler = errors.New("no C compiler here, and no hand-written core for this platform")

ErrNoCompiler means this machine can't build a core for this test.

Functions

func Build

func Build(dir, name string, v Variant) (string, error)

Build writes a core into dir, named name plus this platform's extension.

func Ext

func Ext() string

Ext is this platform's library extension.

func Foreign

func Foreign(dir, name string) (string, error)

Foreign writes a library for a platform this server isn't, with a header real enough to be believed. It holds no code: the server must refuse it on its header.

Types

type Variant

type Variant string

Variant is a way for a core to behave.

const (
	Good           Variant = "good"
	CrashAtInit    Variant = "crash-init"    // crashes when it is started
	CrashAtOpen    Variant = "crash-open"    // crashes the moment the library opens
	HangAtInit     Variant = "hang-init"     // never comes back from starting
	HangAtOpen     Variant = "hang-open"     // never finishes opening
	MissingSymbols Variant = "missing"       // a library, but not a libretro core
	WrongAPI       Variant = "wrong-api"     // a libretro version nobody speaks
	ChattyName     Variant = "hostile-names" // reports control characters and absurd lengths
)

Directories

Path Synopsis
cmd
fakecore command
Command fakecore writes one of the test cores to a folder, for trying the custom core pages by hand without any third-party code:
Command fakecore writes one of the test cores to a folder, for trying the custom core pages by hand without any third-party code:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL