summaryrefslogtreecommitdiff
path: root/tests/scripts/options/dash-k
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2023-04-02 17:32:09 -0400
committerPaul Smith <psmith@gnu.org>2023-04-02 17:32:09 -0400
commit971b02d58ee2d19d8ba0c7c9813f02fa86c8fd0c (patch)
treec253dde22ed2da31a64584249a179b3e4535170a /tests/scripts/options/dash-k
parentfdd61fc06865d4393246da2ce05bad96c1aef5aa (diff)
downloadmake-git-971b02d58ee2d19d8ba0c7c9813f02fa86c8fd0c.tar.gz
tests: Run each file in a separate directory
Avoid cross-contamination between test files by creating a new working directory for each file, and setting it as the current directory before starting the tests in that file. Rename the test output as tNNN.{base,log,diff,mk} where NNN is a test number starting with 001 for the first test. It is slightly more annoying to find diff files since you can't use autocomplete directly but it is simpler to match things. Detect the source directory as the location of the test_driver.pl script, so remove the separate -srcdir option. * Makefile.am: Remove hacks to create symlinks when building out-of-tree, and remove -srcdir option from run_make_tests. * tests/test_driver.pl: Locate $srcpath based on __FILE__, then compute $toppath as its parent. Set $scriptpath under $srcpath and $workpath under the current directory. Toss $*_filename and modify get_logfile() etc. to use the suffix directly. Add a chdir() around the invocation of the test. * tests/run_make_tests.pl: Throw out the -srcdir option and use $srcpath set in test_driver.pl. The #WORK# helper is no longer useful so remove it. Set #PWD# to the current working dir. Always search the local directory and $srcpath for config-flags.pm. Use $srcpath for finding the thelp.pl script. * tests/scripts/features/vpath: Don't put things in work/ as it is no longer a subdirectory. * tests/scripts/features/vpathgpath: Ditto. * tests/scripts/features/vpathplus: Ditto. * tests/scripts/misc/general1: Ditto. * tests/scripts/misc/general2: Ditto. * tests/scripts/options/dash-k: Ditto. * tests/scripts/options/symlinks: Use $testpath as the working directory. * tests/scripts/variables/GNUMAKEFLAGS: Use the test helper to display env var values (grepping for GNUMAKEFLAGS finds extra things now that it is our current working directory).
Diffstat (limited to 'tests/scripts/options/dash-k')
-rw-r--r--tests/scripts/options/dash-k13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k
index fec630c3..05db28ac 100644
--- a/tests/scripts/options/dash-k
+++ b/tests/scripts/options/dash-k
@@ -16,7 +16,7 @@ open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE <<EOF;
-VPATH = $workdir
+VPATH = work
edit: main.o kbd.o commands.o display.o
\t\@echo cc -o edit main.o kbd.o commands.o display.o
@@ -38,11 +38,12 @@ EOF
close(MAKEFILE);
-@files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h",
- "$workdir${pathsep}command.h",
- "$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
- "$workdir${pathsep}buffer.h",
- "$workdir${pathsep}command.c");
+mkdir('work');
+@files_to_touch = ("work${pathsep}main.c","work${pathsep}defs.h",
+ "work${pathsep}command.h",
+ "work${pathsep}commands.c","work${pathsep}display.c",
+ "work${pathsep}buffer.h",
+ "work${pathsep}command.c");
&touch(@files_to_touch);