summaryrefslogtreecommitdiff
path: root/libcutl/tests/fs
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:46 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:46 +0100
commit372a0e99c2f61543d9e14d9933b59d9d1f4cb26e (patch)
treebbadf39aed0610c8f8f7b41fefff47773b8ac205 /libcutl/tests/fs
parent23d41842168ac1a1580111b9c5c73500ceee3d57 (diff)
parent4538829ab86b5a1cd4e845e7eab165029c9d6d46 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'libcutl/tests/fs')
-rw-r--r--libcutl/tests/fs/makefile17
-rw-r--r--libcutl/tests/fs/path/driver.cxx144
-rw-r--r--libcutl/tests/fs/path/makefile69
3 files changed, 0 insertions, 230 deletions
diff --git a/libcutl/tests/fs/makefile b/libcutl/tests/fs/makefile
deleted file mode 100644
index 9bf1523..0000000
--- a/libcutl/tests/fs/makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# file : tests/fs/makefile
-# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
-# license : MIT; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
-
-tests := path
-
-default := $(out_base)/
-test := $(out_base)/.test
-clean := $(out_base)/.clean
-
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests)))
-$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests)))
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests)))
-
-$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile))
diff --git a/libcutl/tests/fs/path/driver.cxx b/libcutl/tests/fs/path/driver.cxx
deleted file mode 100644
index 6c77e67..0000000
--- a/libcutl/tests/fs/path/driver.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-// file : tests/fs/path/driver.cxx
-// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
-// license : MIT; see accompanying LICENSE file
-
-#include <cassert>
-#include <iostream>
-
-#include <cutl/fs/path.hxx>
-
-using std::cerr;
-using std::endl;
-
-using namespace cutl::fs;
-
-int
-main ()
-{
- assert (path ("/").string () == "/");
- assert (path ("//").string () == "/");
- assert (path ("/tmp/foo/").string () == "/tmp/foo");
-#ifdef _WIN32
- assert (path ("\\\\").string () == "\\");
- assert (path ("/\\").string () == "/");
- assert (path ("C:").string () == "C:");
- assert (path ("C:\\").string () == "C:");
- assert (path ("C:\\tmp\\foo\\").string () == "C:\\tmp\\foo");
-#endif
-
- // abslote/relative/root
- //
-#ifndef _WIN32
- assert (path ("/").root ());
- assert (path ("//").root ());
- assert (path ("/").absolute ());
- assert (path ("/foo/bar").absolute ());
- assert (path ("bar/baz").relative ());
-#else
- assert (path ("C:").root ());
- assert (path ("C:\\").root ());
- assert (path ("C:\\").absolute ());
- assert (path ("C:\\foo\\bar").absolute ());
- assert (path ("bar\\baz").relative ());
-#endif
-
-
- // leaf
- //
-#ifndef _WIN32
- assert (path ("/").leaf ().string () == "");
- assert (path ("/tmp").leaf ().string () == "tmp");
- assert (path ("//tmp").leaf ().string () == "tmp");
-#else
- assert (path ("C:").leaf ().string () == "C:");
- assert (path ("C:\\tmp").leaf ().string () == "tmp");
- assert (path ("C:\\\\tmp").leaf ().string () == "tmp");
-#endif
-
- // directory
- //
-#ifndef _WIN32
- assert (path ("/").directory ().string () == "");
- assert (path ("/tmp").directory ().string () == "/");
- assert (path ("//tmp").directory ().string () == "/");
-#else
- assert (path ("C:").directory ().string () == "");
- assert (path ("C:\\tmp").directory ().string () == "C:");
- assert (path ("C:\\\\tmp").directory ().string () == "C:");
-#endif
-
- // base
- //
- assert (path ("/").base ().string () == "/");
- assert (path ("/foo.txt").base ().string () == "/foo");
- assert (path (".txt").base ().string () == ".txt");
- assert (path ("/.txt").base ().string () == "/.txt");
- assert (path ("foo.txt.orig").base ().string () == "foo.txt");
-#ifdef _WIN32
- assert (path ("C:").base ().string () == "C:");
- assert (path ("C:\\foo.txt").base ().string () == "C:\\foo");
-#endif
-
- // operator/
- //
-#ifndef _WIN32
- assert ((path ("/") / path ("tmp")).string () == "/tmp");
- assert ((path ("foo") / path ("bar")).string () == "foo/bar");
-#else
- assert ((path ("\\") / path ("tmp")).string () == "\\tmp");
- assert ((path ("C:\\") / path ("tmp")).string () == "C:\\tmp");
- assert ((path ("foo") / path ("bar")).string () == "foo\\bar");
-#endif
-
- // normalize
- //
-#ifndef _WIN32
- assert (path ("../foo").normalize ().string () == "../foo");
- assert (path ("..///foo").normalize ().string () == "../foo");
- assert (path ("../../foo").normalize ().string () == "../../foo");
- assert (path (".././foo").normalize ().string () == "../foo");
- assert (path (".").normalize ().string () == "");
- assert (path ("./..").normalize ().string () == "..");
- assert (path ("../.").normalize ().string () == "..");
- assert (path ("foo/./..").normalize ().string () == "");
- assert (path ("/foo/./..").normalize ().string () == "/");
- assert (path ("./foo").normalize ().string () == "foo");
-#else
- assert (path ("../foo").normalize ().string () == "..\\foo");
- assert (path ("..///foo").normalize ().string () == "..\\foo");
- assert (path ("..\\../foo").normalize ().string () == "..\\..\\foo");
- assert (path (".././foo").normalize ().string () == "..\\foo");
- assert (path (".").normalize ().string () == "");
- assert (path ("./..").normalize ().string () == "..");
- assert (path ("../.").normalize ().string () == "..");
- assert (path ("foo/./..").normalize ().string () == "");
- assert (path ("C:/foo/./..").normalize ().string () == "c:");
- assert (path ("./foo").normalize ().string () == "foo");
-
- assert (path ("C:").normalize ().string () == "c:");
- assert (path ("C:\\Foo12//Bar").normalize ().string () == "c:\\foo12\\bar");
-#endif
-
- // posix_string
- //
- assert (path ("foo/bar/../baz").posix_string () == "foo/bar/../baz");
-#ifdef _WIN32
- assert (path ("foo\\bar\\..\\baz").posix_string () == "foo/bar/../baz");
- try
- {
- path ("c:\\foo\\bar\\..\\baz").posix_string ();
- assert (false);
- }
- catch (const invalid_path&) {}
-#endif
-
- /*
- path p ("../foo");
- p.complete ();
-
- cerr << path::current () << endl;
- cerr << p << endl;
- p.normalize ();
- cerr << p << endl;
- */
-}
diff --git a/libcutl/tests/fs/path/makefile b/libcutl/tests/fs/path/makefile
deleted file mode 100644
index 184510b..0000000
--- a/libcutl/tests/fs/path/makefile
+++ /dev/null
@@ -1,69 +0,0 @@
-# file : tests/fs/path/makefile
-# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
-# license : MIT; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
-
-cxx_tun := driver.cxx
-
-#
-#
-cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o))
-cxx_od := $(cxx_obj:.o=.o.d)
-
-cutl.l := $(out_root)/cutl/cutl.l
-cutl.l.cpp-options := $(out_root)/cutl/cutl.l.cpp-options
-
-driver := $(out_base)/driver
-test := $(out_base)/.test
-clean := $(out_base)/.clean
-
-# Build.
-#
-$(driver): $(cxx_obj) $(cutl.l)
-$(cxx_obj) $(cxx_od): $(cutl.l.cpp-options)
-
-
-$(call include-dep,$(cxx_od))
-
-
-# Alias for default target.
-#
-$(out_base)/: $(driver)
-
-
-# Test.
-#
-$(test): $(driver)
- $(call message,test $<,$<)
-
-
-# Clean.
-#
-$(clean): \
- $(driver).o.clean \
- $(addsuffix .cxx.clean,$(cxx_obj)) \
- $(addsuffix .cxx.clean,$(cxx_od))
-
-
-# Generated .gitignore.
-#
-ifeq ($(out_base),$(src_base))
-$(driver): | $(out_base)/.gitignore
-
-$(out_base)/.gitignore: files := driver
-$(clean): $(out_base)/.gitignore.clean
-
-$(call include,$(bld_root)/git/gitignore.make)
-endif
-
-
-# How to.
-#
-$(call include,$(bld_root)/cxx/o-e.make)
-$(call include,$(bld_root)/cxx/cxx-o.make)
-$(call include,$(bld_root)/cxx/cxx-d.make)
-
-# Dependencies.
-#
-$(call import,$(src_root)/cutl/makefile)