Directory Level Configuration

Each directory that contains code that you want Glotter2 to recognize requires a file named testinfo.yml. This file contains settings pertinent only to the current directory but does not affect child directories.

There are these root level sections.

Language Display Name

language_display_name is the actual name of the language. If omitted, this field is derived from the name of the directory. For example:

Directory Name

Language Display Name

python

Python

go

Go

objective-c

Objective C

visual-basic

Visual Basic

c-plus-plus

C++

c-sharp

C#

c-star

C*

Folder

folder is data about the files in the directory that helps Glotter2 find them.

It has the following settings.

Extension

extension is the file extension of files that Glotter2 will recognize in this directory.

Naming

naming refers to the naming scheme that Glotter2 will use to find files in this directory.

The following are valid values.

Name

Example

Description

hyphen

hello-world

Hyphen-separated

underscore

hello_world

Underscore-separated

camel

helloWorld

Each word starts with a capital excluding the first, no separation

pascal

HelloWorld

Each word starts with a capital including the first, no separation

lower

helloworld

Lowercase, no separation

Container

container contains settings that help Glotter2 know how to build and run sources in this directory. If omitted, then this indicates that the language is untestable.

It has the following settings.

Image

image is the docker image to use to run the source file.

Tag

tag is the specific tag of the docker image to use to run the source file.

Build

build is command that is run inside of docker in order to build the source. This setting is optional as not all languages require a build step.

Cmd

cmd is the command that is run inside of docker in order to run the source (after it is built if necessary).

Templating

Jinja templating can be used in the build or cmd setting of container in order to refer to the source by name or extension.

The following values are available.

Jinja Format

Description

source.name

The name of the source file excluding extension

source.extension

The extension of the source file

source.path

The path to the source file excluding the name of the source and its extension

source.full_path

The full path to the source file including its name and extension

Notes

notes is a list of notes for the language.

Example

The following is an example testinfo.yml file for a directory containing sources in go.

folder:
  extension: ".go"
  naming: "hyphen"

container:
  image: "golang"
  tag: "1.12-alpine"
  build: "go build -o {{ source.name }} {{ source.name }}{{ source.extension }}"
  cmd: "./{{ source.name }}"

The following is an example testinfo.yml for a directory containing sources in php.

language_display_name: "PHP"
folder:
  extension: ".php"
  naming: "hyphen"

container:
  image: "php"
  tag: "8.4-alpine"
  cmd: "php {{ source.name }}{{ source.extension }}"

The following is an example testinfo.yml for a directory containing sources in m4.

language_display_name: "m4"

folder:
  extension: ".m4"
  naming: "hyphen"

container:
  image: "m4"
  tag: "latest-alpine"
  cmd: "run-m4 {{ source.name }}{{ source.extension }}"

notes:
  - "m4 takes all of the command-line arguments and encloses them in a backtick (`) and single quote (')"

The following is an example testinfo.yml for a directory containing sources for an untestable language such as Mathematica.

folder:
  extension: ".nb"
  naming: "hyphen"

notes:
  - "Mathematica is untestable because it requires a commercial license"