From fe6f1e1a44a88159117c50f1ccf7ecc800db0128 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 23 May 2012 15:05:21 -0600 Subject: [PATCH] tests: make generated test scripts read-only Make generated test scripts read-only, to avoid errors by developers editing the generated test scripts and then having them accidentally clobbered when "make" is run again. Signed-off-by: Andreas Dilger --- tests/Makefile.in | 6 +++--- tests/test_one.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index b9df3b0..058a6f5 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -20,14 +20,14 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf @echo "SRCDIR=@srcdir@" >> test_one @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one @cat $(srcdir)/test_one.in >> test_one - @chmod +x test_one + @chmod +x-w test_one test_script: test_one test_script.in Makefile mke2fs.conf @echo "Creating test_script..." @echo "#!/bin/sh" > test_script @echo "SRCDIR=@srcdir@" >> test_script @cat $(srcdir)/test_script.in >> test_script - @chmod +x test_script + @chmod +x-w test_script mke2fs.conf: $(srcdir)/mke2fs.conf.in $(CP) $(srcdir)/mke2fs.conf.in mke2fs.conf @@ -46,7 +46,7 @@ test_pre: test_post: test_pre $(TESTS) @$(srcdir)/test_post -check:: test_pre test_post test_script +check:: test_pre test_script test_post check-failed: $(basename $(wildcard *.failed)) @$(srcdir)/test_post diff --git a/tests/test_one.in b/tests/test_one.in index d053fd7..06dc05a 100644 --- a/tests/test_one.in +++ b/tests/test_one.in @@ -60,8 +60,8 @@ else else echo "$test_name: Missing test script $default_script!" fi - [ -f $test_name.failed ] && cat $test_name.failed fi +[ -f $test_name.failed ] && cat $test_name.failed if [ "$SKIP_UNLINK" != "true" ] ; then rm -f $TMPFILE -- 1.8.3.1