Prolog flag for embedded

It is not possible to detect if a prolog process is running as an embedded prolog (i.e., not swipl), or is it? I can create a prolog flag myself on startup using -Dembedded, but it would be nice to have an “official” prolog flag (which could be used in the code).

My use case are unit tests again. The unit tests for saved states determine swipl from “me(X)” and use it to create a saved state. In my case, me(X) returns the R statistics program which cannot, of course, create these states. So these tests would be skipped if current_prolog_flag(embedded, true).

I admit that this is a bit of a special use case; on the other hand, unit tests are a nice thing, also for embedded prolog programs. It would probably still be necessary to add this flag manually at startup. Autodetection from the filename of the executable seems a bit dirty.

An alternative any maybe even better solution is to allow extra command line arguments for the unit tests. In src/, swipl is invoked with -f none -t halt --no-packs -p <tempdir>. I’ll submit a little patch that adds another option to test_installation/1 that allows for some custom extra arguments.