From 5007870b52aa549971824959a55ad3bb886f09e0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Sep 2018 16:37:32 +0200 Subject: Rename .test/test{} to .testscript/testscript{} --- tests/test/script/builtin/cp.test | 376 -------------------------------------- 1 file changed, 376 deletions(-) delete mode 100644 tests/test/script/builtin/cp.test (limited to 'tests/test/script/builtin/cp.test') diff --git a/tests/test/script/builtin/cp.test b/tests/test/script/builtin/cp.test deleted file mode 100644 index e81b395..0000000 --- a/tests/test/script/builtin/cp.test +++ /dev/null @@ -1,376 +0,0 @@ -# file : tests/test/script/builtin/cp.test -# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -.include ../common.test - -: args -: -{ - : none - : - $c <'cp 2>"cp: missing arguments" == 1' && $b - - : no-source - : - $c <'cp -R a 2>"cp: missing source path" == 1' && $b - - : no-trailing-sep - : - $c <"cp: multiple source paths without trailing separator for destination directory" == 1 - EOI - - : empty - : - { - : dest - : - $c <"cp: invalid path ''" == 1 - EOI - - : src1 - : - $c <"cp: invalid path ''" == 1 - EOI - - : src2 - : - $c <"cp: invalid path ''" == 1 - EOI - } -} - -: file -: -: Test synopsis 1: make a file copy at the specified path. -: -{ - : existing - : - { - : to-non-existing - : - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b': .+% - EOE - EOI - } - - : non-existing - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b': .+% - EOE - EOI - } - - : non-file - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b': .+% - EOE - EOI - } - - : cleanup - : - { - : existing - : - : Test that copy over an existing file does not register cleanup. If it - : does then the file would be removed while leaving the embedded scope, - : and so the cleanup registered by the outer touch would fail. - : - $c <>/~%EOE% != 0 - %cp: unable to copy directory '.+/a' to '.+/b': .+% - EOE - EOI - - : to-file - : - $c <>/~%EOE% != 0 - %cp: unable to copy directory '.+/a' to '.+/b': .+% - EOE - EOI - - : recursively - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy directory '.+/a' to '.+/b': .+% - EOE - EOI - } - - : non-dir - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy directory '.+/a' to '.+/b': .+% - EOE - EOI - } -} - -: files -: -: Test synopsis 3: copy files into the specified directory. -: -{ - : existing - : - { - : into-dir - : - { - : over-non-existing - : - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b/a': .+% - EOE - EOI - - : multiple - : - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b/a': .+% - EOE - EOI - } - - : into-non-dir - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b/a': .+% - EOE - EOI - } - } - - : non-existing - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b/a': .+% - EOE - EOI - } - - : non-file - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy file '.+/a' to '.+/b/a': .+% - EOE - EOI - } -} - -: filesystem-entries -: -: Test synopsis 4: copy filesystem entries into the specified directory. -: -{ - : file - : - { - $c <>/~%EOE% != 0 - %cp: unable to copy directory '.+/a' to '.+/b/a': .+% - EOE - EOI - } -} - -: attrs -: -if ($cxx.target.class != 'windows') -{ - fs = 's/.+ (\S+\s+\S+\s+\S+)\s+cp-file/\1/p' - ds = 's/.+ (\S+\s+\S+\s+\S+)\s+cp-dir/\1/p' - - : copy - : - { - : file - : - { - $c <<"EOI" && $b - ls -l $src_base/cp-dir | sed -n -e '$fs' | \ - set t; - - cp -p $src_base/cp-dir/cp-file ./; - ls -l | sed -n -e '$fs' >"\$t" - EOI - } - - : dir - : - { - $c <<"EOI" && $b - ls -l $src_base | sed -n -e '$ds' | \ - set t; - - cp -p -r $src_base/cp-dir ./; - ls -l | sed -n -e '$ds' >"\$t" - EOI - } - } - - : no-copy - : - { - : file - : - { - $c <<"EOI" && $b 2>>~%EOE% != 0 - ls -l $src_base/cp-dir | sed -n -e '$fs' | \ - set t; - - cp $src_base/cp-dir/cp-file ./; - ls -l | sed -n -e '$fs' >"\$t" - EOI - %.+ error: sed stdout doesn't match expected% - %.+ - EOE - } - - : dir - : - { - $c <<"EOI" && $b 2>>~%EOE% != 0 - ls -l $src_base | sed -n -e '$ds' | \ - set t; - - cp -r $src_base/cp-dir ./; - ls -l | sed -n -e '$ds' >"\$t" - EOI - %.+ error: sed stdout doesn't match expected% - %.+ - EOE - } - } -} -- cgit v1.1