42 Generate the Common Include File for the Test Cases
This Perl script is intended to generate the file include/testcases.as. It
takes the project name (myalps) as an arguments, i. e., the value of the variable
projectname as specified in Makefile.def.nw. The script outputs to standard
output.
Test cases are built on top of the AldorUnit library which should be installed in
ALDORROOT.
After giving a copyright notice we include the library of the project and the
AldorUnit library.
According to whether or not the compiler directive DontNeedLibraryTestCases
is set, we import an appropriate variant of the library. The variant depends on
whether the assertion DEBUG is set.
This file relies on the fact that TCLIBRARYNAME is set to testcases.
This script is called from include/Makefile.nw.
554⟨* 21⟩+
≡ ⊲539 559 ⊳
#------------------------------------------------------------------
#---
#--- ALLPROSE
#--- Copyright (C) Ralf Hemmecke (ralf@hemmecke.de)
#--- http://www.hemmecke.de/aldor
#---
#------------------------------------------------------------------
if (scalar(@ARGV) < 1) {
print STDERR "Usage: $0 projectname\n";
die "";
}
$projectname=$ARGV[0];
print <<EOF;
-------------------------------------------------------------------
----
---- ALLPROSE
---- Copyright (C) Ralf Hemmecke (ralf\@hemmecke.de)
---- http://www.hemmecke.de/aldor
----
-------------------------------------------------------------------
#include "$projectname"
#include "aldorunit"
#if DontNeedLibraryTestCases
-- Library is not needed, so don’t load it
#else
-- Selection of the appropriate portable object library
#if GMP
#library LibraryTestCases "testcases-gmp"
#elseif DEBUG
#library LibraryTestCases "testcasesd"
#else
#library LibraryTestCases "testcases"
#endif
import from LibraryTestCases;
inline from LibraryTestCases;
#endif
EOF
Defines:
DontNeedLibraryTestCases, used in chunk 190.
Uses projectname 124.