BaseX command-line arguments relevant for running XSpec tests?
Sunday, 9 August 2026 · 6 messages · last reply 12 Aug 2026
AG
Amanda Galtman9 Aug 2026 23:39 #
Hi, BaseX users.
In the XSpec repo, a contributor is working on improving support for running XSpec tests for XQuery using BaseX as the XQuery processor.[1]
A question that came up in the discussion is whether XSpec should support a way for users to specify command-line arguments to BaseX when executing a particular XSpec test suite. Does that sound useful? If so, is there any particular command-line argument or particular use case you'd like to mention?
XSpec has something like that when Saxon is the XQuery processor. But command-line arguments vary by processor, so we wanted to check whether there were real user situations to motivate the argument-passing capability with BaseX.
Thanks,
Amanda
[1] https://github.com/xspec/xspec/issues/2320
CG
Christian Grün12 Aug 2026 13:39 #
Hi Amanda,
Would it be possible to simply support all command-line options of BaseX [1], or do you think it would be better to offer a choice?
Best,
Christian
PS: If your post didn’t reach everyone, I hope it works this time.
[1] https://docs.basex.org/13/Command-Line_Options
Quoted text · Amanda Galtman · 11 lines
Von: Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> Gesendet: Sonntag, 9. August 2026 23:39 An: basex-talk at mailman.uni-konstanz.de Betreff: [basex-talk] BaseX command-line arguments relevant for running XSpec tests? Hi, BaseX users. In the XSpec repo, a contributor is working on improving support for running XSpec tests for XQuery using BaseX as the XQuery processor.[1] A question that came up in the discussion is whether XSpec should support a way for users to specify command-line arguments to BaseX when executing a particular XSpec test suite. Does that sound useful? If so, is there any particular command-line argument or particular use case you'd like to mention? XSpec has something like that when Saxon is the XQuery processor. But command-line arguments vary by processor, so we wanted to check whether there were real user situations to motivate the argument-passing capability with BaseX. Thanks, Amanda [1] https://github.com/xspec/xspec/issues/2320
GS
Graydon Saunders12 Aug 2026 14:34 #
In general, if I don't have to remember which options are supported, that's preferable to having to remember which options are supported.
I would generally expect to want the options; anything with "bind" in the description in particular, but it's a relatively short list of options and it's not obvious there's one which would never be wanted.
thanks!
Graydon
Quoted text · Christian Grün · 31 lines
On Wed, Aug 12, 2026, at 07:39, Christian Grün via BaseX-Talk wrote: > Hi Amanda, > > Would it be possible to simply support all command-line options of BaseX [1], or do you think it would be better to offer a choice? > > Best, > Christian > > PS: If your post didn’t reach everyone, I hope it works this time. > > [1] https://docs.basex.org/13/Command-Line_Options > ________________________________________ > > Von: Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> > Gesendet: Sonntag, 9. August 2026 23:39 > An: basex-talk at mailman.uni-konstanz.de > Betreff: [basex-talk] BaseX command-line arguments relevant for running XSpec tests? > > Hi, BaseX users. > > In the XSpec repo, a contributor is working on improving support for running XSpec tests for XQuery using BaseX as the XQuery processor.[1] > > A question that came up in the discussion is whether XSpec should support a way for users to specify command-line arguments to BaseX when executing a particular XSpec test suite. Does that sound useful? If so, is there any particular command-line argument or particular use case you'd like to mention? > > XSpec has something like that when Saxon is the XQuery processor. But command-line arguments vary by processor, so we wanted to check whether there were real user situations to motivate the argument-passing capability with BaseX. > > Thanks, > Amanda > > [1] https://github.com/xspec/xspec/issues/2320 >
AG
Amanda Galtman12 Aug 2026 17:59 #
Christian and Graydon,
Thanks for your replies. As long as there is some command-line option that's useful in the context of running an XSpec test, it's possible to provide a mechanism by which the user can specify any combination of options.
The caveat would be that some options might not really make sense or accomplish much when the purpose of a particular BaseX invocation is to run the main module that XSpec generated to run your test suite. For instance, the -t option is for BaseX-style tests, which are different from XSpec-style tests.
Graydon, your comment about the "binding" options is a good hint. I can understand the use case of binding a value to an external query variable that you defined in the library module that you're testing with XSpec. Binding data to the context seems like more of a stretch to connect with the XSpec situation, though, because the XSpec-generated module that executes your test suite doesn't use a context item.
Best regards,
Amanda
Quoted text · Graydon Saunders · 39 lines
On Wednesday, August 12th, 2026 at 8:33 AM, Graydon Saunders <graydonish at fastmail.com> wrote: > In general, if I don't have to remember which options are supported, that's preferable to having to remember which options are supported. > > I would generally expect to want the options; anything with "bind" in the description in particular, but it's a relatively short list of options and it's not obvious there's one which would never be wanted. > > thanks! > Graydon > > On Wed, Aug 12, 2026, at 07:39, Christian Grün via BaseX-Talk wrote: > >> Hi Amanda, >> >> Would it be possible to simply support all command-line options of BaseX [1], or do you think it would be better to offer a choice? >> >> Best, >> Christian >> >> PS: If your post didn’t reach everyone, I hope it works this time. >> >> [1] https://docs.basex.org/13/Command-Line_Options >> ________________________________________ >> >> Von: Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> >> Gesendet: Sonntag, 9. August 2026 23:39 >> An: basex-talk at mailman.uni-konstanz.de >> Betreff: [basex-talk] BaseX command-line arguments relevant for running XSpec tests? >> >> Hi, BaseX users. >> >> In the XSpec repo, a contributor is working on improving support for running XSpec tests for XQuery using BaseX as the XQuery processor.[1] >> >> A question that came up in the discussion is whether XSpec should support a way for users to specify command-line arguments to BaseX when executing a particular XSpec test suite. Does that sound useful? If so, is there any particular command-line argument or particular use case you'd like to mention? >> >> XSpec has something like that when Saxon is the XQuery processor. But command-line arguments vary by processor, so we wanted to check whether there were real user situations to motivate the argument-passing capability with BaseX. >> >> Thanks, >> Amanda >> >> [1] https://github.com/xspec/xspec/issues/2320
GS
Graydon Saunders12 Aug 2026 18:28 #
Hi Amanda,
Sometimes I've got a chain of queries; the first one creates the db, adjusting the source as it does so, and a subsequent query will take that db (or dbs) and do something with them. Being able to test just the "do something with it" query in a standalone way by passing in "use this db" as context in some way would be useful. (Sometimes the db is named; sometimes it's now the context db. Nearly always in the more data-extensive cases I don't want to take the fifteen minutes to regenerate the db again to test the next step.)
So having access to
-i<input> Bind file or database to context
would be desirable from this corner. (By no means critical, but desirable.)
Thanks!
Graydon
Quoted text · Amanda Galtman · 53 lines
On Wed, Aug 12, 2026, at 11:59, Amanda Galtman wrote: > Christian and Graydon, > > Thanks for your replies. As long as there is some command-line option that's useful in the context of running an XSpec test, it's possible to provide a mechanism by which the user can specify any combination of options. > > The caveat would be that some options might not really make sense or accomplish much when the purpose of a particular BaseX invocation is to run the main module that XSpec generated to run your test suite. For instance, the -t option is for BaseX-style tests, which are different from XSpec-style tests. > > Graydon, your comment about the "binding" options is a good hint. I can understand the use case of binding a value to an external query variable that you defined in the library module that you're testing with XSpec. Binding data to the context seems like more of a stretch to connect with the XSpec situation, though, because the XSpec-generated module that executes your test suite doesn't use a context item. > > Best regards, > Amanda > > > On Wednesday, August 12th, 2026 at 8:33 AM, Graydon Saunders <graydonish at fastmail.com> wrote: >> In general, if I don't have to remember which options are supported, that's preferable to having to remember which options are supported. >> >> I would generally expect to want the options; anything with "bind" in the description in particular, but it's a relatively short list of options and it's not obvious there's one which would never be wanted. >> >> thanks! >> Graydon >> >> On Wed, Aug 12, 2026, at 07:39, Christian Grün via BaseX-Talk wrote: >>> Hi Amanda, >>> >>> Would it be possible to simply support all command-line options of BaseX [1], or do you think it would be better to offer a choice? >>> >>> Best, >>> Christian >>> >>> PS: If your post didn’t reach everyone, I hope it works this time. >>> >>> [1] https://docs.basex.org/13/Command-Line_Options >>> ________________________________________ >>> >>> Von: Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> >>> Gesendet: Sonntag, 9. August 2026 23:39 >>> An: basex-talk at mailman.uni-konstanz.de >>> Betreff: [basex-talk] BaseX command-line arguments relevant for running XSpec tests? >>> >>> Hi, BaseX users. >>> >>> In the XSpec repo, a contributor is working on improving support for running XSpec tests for XQuery using BaseX as the XQuery processor.[1] >>> >>> A question that came up in the discussion is whether XSpec should support a way for users to specify command-line arguments to BaseX when executing a particular XSpec test suite. Does that sound useful? If so, is there any particular command-line argument or particular use case you'd like to mention? >>> >>> XSpec has something like that when Saxon is the XQuery processor. But command-line arguments vary by processor, so we wanted to check whether there were real user situations to motivate the argument-passing capability with BaseX. >>> >>> Thanks, >>> Amanda >>> >>> [1] https://github.com/xspec/xspec/issues/2320 >>> >>
AG
Amanda Galtman12 Aug 2026 23:30 #
Hi, Graydon.
Thanks for the more concrete use case. I think what you want to do could be done in XSpec, but only with some refactoring and not actually involving the command-line option for default context.
As background, the support in XSpec for testing XQuery code is limited to testing functions.
So, if your "do something with it" query is a main module that depends on a db for context, then to make it XSpec-testable, you'd have to refactor the query into a function. Because the function body can't depend on a context item, you'd use function parameter(s) to help provide the context for the code of the function body. In that case, the XSpec test scenario could invoke your "do something with it, refactored as a function" code using something like
<x:call function="my:do-something">
<x:param select="'db-name'"/>
<!-- more x:param elements can go here for additional function arguments -->
</x:call>When the arguments are part of the XSpec test scenario itself, the "-i" command-line option for invoking BaseX wouldn't be the mechanism for specifying which db you want to use for testing. On the other hand, the "-O" command-line option might be relevant for providing a
DBPATH value. Maybe when we work on the BaseX support in XSpec, we should include a test case for the "-O" option.
It's possible that BaseX has another way to do things than what I'm imagining now, but in any case an XSpec test for XQuery can call only functions, not main modules.
Best,
AmandaQuoted text · Graydon Saunders · 65 lines
On Wednesday, August 12th, 2026 at 12:28 PM, Graydon Saunders <graydonish at fastmail.com> wrote: > Hi Amanda, > > Sometimes I've got a chain of queries; the first one creates the db, adjusting the source as it does so, and a subsequent query will take that db (or dbs) and do something with them. Being able to test just the "do something with it" query in a standalone way by passing in "use this db" as context in some way would be useful. (Sometimes the db is named; sometimes it's now the context db. Nearly always in the more data-extensive cases I don't want to take the fifteen minutes to regenerate the db again to test the next step.) > So having access to > -i<input> Bind file or database to context > > would be desirable from this corner. (By no means critical, but desirable.) > > Thanks! > Graydon > > On Wed, Aug 12, 2026, at 11:59, Amanda Galtman wrote: > >> Christian and Graydon, >> >> Thanks for your replies. As long as there is some command-line option that's useful in the context of running an XSpec test, it's possible to provide a mechanism by which the user can specify any combination of options. >> >> The caveat would be that some options might not really make sense or accomplish much when the purpose of a particular BaseX invocation is to run the main module that XSpec generated to run your test suite. For instance, the -t option is for BaseX-style tests, which are different from XSpec-style tests. >> >> Graydon, your comment about the "binding" options is a good hint. I can understand the use case of binding a value to an external query variable that you defined in the library module that you're testing with XSpec. Binding data to the context seems like more of a stretch to connect with the XSpec situation, though, because the XSpec-generated module that executes your test suite doesn't use a context item. >> >> Best regards, >> Amanda >> >> On Wednesday, August 12th, 2026 at 8:33 AM, Graydon Saunders <graydonish at fastmail.com> wrote: >> >>> In general, if I don't have to remember which options are supported, that's preferable to having to remember which options are supported. >>> >>> I would generally expect to want the options; anything with "bind" in the description in particular, but it's a relatively short list of options and it's not obvious there's one which would never be wanted. >>> >>> thanks! >>> Graydon >>> >>> On Wed, Aug 12, 2026, at 07:39, Christian Grün via BaseX-Talk wrote: >>> >>>> Hi Amanda, >>>> >>>> Would it be possible to simply support all command-line options of BaseX [1], or do you think it would be better to offer a choice? >>>> >>>> Best, >>>> Christian >>>> >>>> PS: If your post didn’t reach everyone, I hope it works this time. >>>> >>>> [1] https://docs.basex.org/13/Command-Line_Options >>>> ________________________________________ >>>> >>>> Von: Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> >>>> Gesendet: Sonntag, 9. August 2026 23:39 >>>> An: basex-talk at mailman.uni-konstanz.de >>>> Betreff: [basex-talk] BaseX command-line arguments relevant for running XSpec tests? >>>> >>>> Hi, BaseX users. >>>> >>>> In the XSpec repo, a contributor is working on improving support for running XSpec tests for XQuery using BaseX as the XQuery processor.[1] >>>> >>>> A question that came up in the discussion is whether XSpec should support a way for users to specify command-line arguments to BaseX when executing a particular XSpec test suite. Does that sound useful? If so, is there any particular command-line argument or particular use case you'd like to mention? >>>> >>>> XSpec has something like that when Saxon is the XQuery processor. But command-line arguments vary by processor, so we wanted to check whether there were real user situations to motivate the argument-passing capability with BaseX. >>>> >>>> Thanks, >>>> Amanda >>>> >>>> [1] https://github.com/xspec/xspec/issues/2320
Written for BaseX 12.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery