Skip to content

Commit

Permalink
Add autofonce configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Feb 8, 2023
1 parent d4f364e commit b63bf71
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .autofonce
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[project]
# name to use to infer config
name = "gnucobol"

# files used to locate the project top directory
# and to set the AUTOFONCE_SOURCE_DIR
source_anchors = [ "tests/testsuite.at", "!" ]

# files used to locate the project build directory
# where the _autofonce/ directory will be created
# and to set the AUTOFONCE_BUILD_DIR
# use "!" to trigger an error if build dir is mandatory
build_anchors = [ "cobc/cobc", "!" ]

# paths in project sources that are good candidates to
# be tested as build dirs. Useful to run autofonce
# from outside the build directory
build_dir_candidates = [ "_build" ]

[testsuites]
# alias = "path-from-topdir"
[testsuites.testsuite]
file = "tests/testsuite.at"
path = [ "tests/testsuite.src"]
env = "testsuite"
[testsuites.nist]
file = "tests/cobol85/nist.at"
path = [ "tests/cobol85/nistrun.src"]
env = "testsuite"

[envs]
# env_name = """..."""
# env_name = "<local-path-to-env-file"
testsuite = "<tests/autofonce.env.sh"

19 changes: 19 additions & 0 deletions tests/autofonce.env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# look at 'build_anchors' to see how the build dir is detected among upper dirs

abs_builddir=${AUTOFONCE_BUILD_DIR}/tests

# these files are generated during configure or first `make check`

. ${abs_builddir}/atconfig
. ${abs_builddir}/atlocal

# the following flags are needed for the NIST testsuite

if test "x$AUTOFONCE_TESTSUITE" = "xnist"; then
export COB_DISABLE_WARNINGS=Y
export COB_SWITCH_1=ON
export COB_SWITCH_2=OFF
export COMPILE85="$COMPILE -std=cobol85 -Wno-goto-different-section -Wno-goto-section -I copy"
export COMPILE_MODULE85="$COMPILE_MODULE -std=cobol85 -Wno-goto-different-section -Wno-goto-section -I copy"
export GREP="$GREP --text"
fi

0 comments on commit b63bf71

Please sign in to comment.