theATL 1.0.2
Loading...
Searching...
No Matches
atltest

atltest is a tool for testing the *.test files from the theATL/tests directory.

  • The test file (*.test) from the theATL/atlsh/tests directory is mirrored to the theATL/tests directory via a soft link.
    • The theATL test environment is created without changes to the atlsh distribution.
  • Massive parallel testing with the automake make check was implemented in the theATL/tests directory.
    • An adaptation to the atltest tool and the *.test files was required.
  • The largest adaptation was made to the test cases (*.test) provided by TCL.
    • By default, TCL only supports sequential testing.
    • By default, TCL uses the same temporary file name across different test cases.

atltest

atltest is a wrapper around atltest and primarily serves to provide the correct environment from
the build and source directory, as well as an automake-specific adjustment that affects the sequence of test-option* and test-case.

1#!/bin/bash
2#+
3#: @file NHI1/theATL/bin/atltest
4#: @brief tag: nhi1-release-250425
5#: @copyright (C) NHI - #1 - Project - Group
6#: This software has NO permission to copy,
7#: please contact AUTHOR for additional information
8#:
9
10# atltest ..
11#
12# This script is used to run the "atltest" tool from the Makefile.
13# The environment must be configured so that "atltest" only has access
14# to the data from the "build" and "source" directory.
15#
16# example :
17#
18# 1. options last > atltest FILE-PATTERN options..
19# 2. options first > atltest options.. FILE-PATTERN
20
21abs_local_path="$(realpath -- "$0")" || exit 1
22abs_local_dir="${abs_local_path%/*}"
23abs_atlsh_dir="${abs_local_dir%/*}/atlsh"
24
25# get "abs_top_builddir"
26if [[ -f "${NHI1_abs_top_builddir:-NHI1_abs_top_builddir_UNKNOWN}/theATL/atlsh/unix/atlBuild.sh" ]] ; then
27 # get it from the "NHI1" environment (only as subproject)
28 abs_atlsh_builddir="${NHI1_abs_top_builddir}/theATL/atlsh"
29elif [[ -f "$abs_atlsh_dir/unix/atlBuild.sh" ]] ; then
30 # get it from "in-source" build
31 abs_atlsh_builddir="$abs_atlsh_dir"
32else
33 echo "error: atlBuild.sh not found" 1>&2 ; exit 1
34fi
35
36# source build environment - setup with "configure"
37# set: TCL_TOP_SOURCE_DIR TCL_TOP_BUILD_DIR LD_LIBRARY_PATH ATL_LIBPATH ATL_LIBRARY
38source "$abs_atlsh_builddir/unix/atlBuild.sh"
39
40# if "atltest" not already build → build it
41if [[ ! -f "$TCL_TOP_BUILD_DIR/unix/atltest" ]] ; then
42 make --directory "$TCL_TOP_BUILD_DIR/unix" atltest || exit 2
43fi
44
45#set -x
46
47declare -i justone="$(( $# == 1 ))"
48
49# validate arguments
50while true ; do
51 first="$(realpath -- "$1")"
52 last="${@: -1}"
53
54 # check if test script is first - called by user
55 for a in $first ; do
56 [[ ! -f "$a" ]] && break
57 f="$first"
58 d="${f%/*}"
59 shift
60 set -- -file "${f##*/}" -testdir "$d" -tmpdir "${d/$TCL_TOP_SOURCE_DIR/$TCL_TOP_BUILD_DIR}" "$@"
61 if (( justone )) ; then
62 : set -- "$@" -verbose bpt
63 fi
64 break 2
65 done
66
67 # check if test script is last - called by 'make check'
68 for a in $last ; do
69 [[ ! -f "$a" ]] && break
70 f="$last"
71 d="${f%/*}"
72 set -- -file "${f##*/}" -testdir "$d" -tmpdir "${d/$TCL_TOP_SOURCE_DIR/$TCL_TOP_BUILD_DIR}" "${@:1:$(( $# - 1 ))}"
73 break 2
74 done
75
76 echo "error: unable to find test script in '$*'" 1>&2 ; exit 3
77
78done
79
80#ldd "$TCL_TOP_BUILD_DIR/unix/atltest"
81
82exec "$TCL_TOP_BUILD_DIR/unix/atltest" "$TCL_TOP_SOURCE_DIR/../tests/all.tcl" "$@"
83
84# vim: path+=../tests

Makefile.am

automake file to configure the local directory

1#+
2#: @file NHI1/theATL/tests/Makefile.am
3#: @brief tag: nhi1-release-250425
4#: @copyright (C) NHI - #1 - Project - Group
5#: This software has NO permission to copy,
6#: please contact AUTHOR for additional information
7#:
8
9EXTRA_DIST = README_TESTS.md $(srcdir)/*.tcl $(srcdir)/*.test
10
11# set "TEST_FILES" created by ".makefile_index.bash"
12include .index.mk
13
14TESTS = $(TEST_FILES)
15
16debug:
17 @echo TESTS=$(TESTS)
18
19# README_TESTS.md
20help:
21 less $(srcdir)/README_TESTS.md
22
23log:
24 test -f $(builddir)/test-suite.log && less -S $(builddir)/test-suite.log || true
25
26test:
27 for t in $(TESTS); do \
28 $(srcdir)/../bin/atltest "$(srcdir)/$$t" -verbose bpt $(TEST_LOG_FLAGS); \
29 done
30
31link:
32 cd "$(srcdir)" && find . -type l -delete && ln -s ../atlsh/tests/*.test .
33
34TEST_EXTENSIONS = .test
35# using: ../bin/atltest
36TEST_LOG_COMPILER = $(srcdir)/../bin/atltest
37
38#! Attention: to add your own FLAGS use "TEST_LOG_FLAGS"
39# NO test on parallel "make check" - Some tests simply do not work in parallel mode.
40AM_TEST_LOG_FLAGS = -constraints parallel -verbose e
41
42# BEGIN-MAKEFILE-INDEX
43index-local:
44 cd "$(srcdir)" && bash ./.makefile_index.bash
45# END-MAKEFILE-INDEX

atlBuild.sh

The goal of atlBuild.sh is the same as for atlConfig.sh except that atlBuild.sh only configures the build environment - using only paths from the build directory or the source directory.

1# atlBuild.sh --
2#
3# This shell script (for sh) is automatically generated by the Tcl configuration script.
4# It creates shell variables for use within the TCL build environment.
5# This script is intended for use by Tcl tools so they don't have to figure everything
6# out themselves.
7#
8# The information in this file refers to a specific platform.
9
10# Tcl's version number.
11TCL_VERSION='@TCL_VERSION@'
12TCL_MAJOR_VERSION='@TCL_MAJOR_VERSION@'
13TCL_MINOR_VERSION='@TCL_MINOR_VERSION@'
14TCL_PATCH_LEVEL='@TCL_PATCH_LEVEL@'
15
16# Must be absolute to so the corresponding atltest's tcl_library is absolute.
17TCL_TOP_SOURCE_DIR='@TCL_REAL_SOURCE_DIR@'
18TCL_TOP_BUILD_DIR='@TCL_REAL_BUILD_DIR@'
19
20# Resetting the LIB_RUNTIME_DIR below is required so that the generated
21# atltest executable gets the build directory burned into its ld search path.
22# This keeps atltest from picking up an already installed version of the Tcl
23# library.
24export @LD_LIBRARY_PATH_VAR@='@abs_builddir@:${@LD_LIBRARY_PATH_VAR@}'
25export ATL_LIBPATH='@abs_builddir@/pkgs'
26export ATL_LIBRARY='@TCL_SRC_DIR@/library'

additional information