aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-01 14:46:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-01 14:46:45 +0200
commit10fd2aface4486fc7f873dd2b54a1c2073c0b434 (patch)
tree5133810cf33b3e4ba4dfe78f659ee65599c31ffd /tests
parent7996c2bfc2d7e998e2f9f1236d457ec7bea8ad8a (diff)
Reimplement define as dynamic derivation rather than alias
New syntax: define cli: file The rationale is we need to be able to assign the file extension (using type/pattern-specific variables). And if it is an alias, we will assign it to the original target type. Note that we could still support aliases if we need to. Will need to bring back the id member in target_type that would normally point to itself but for an alias would point to the origin.
Diffstat (limited to 'tests')
-rw-r--r--tests/define/buildfile22
-rw-r--r--tests/define/buildfile.alias16
2 files changed, 26 insertions, 12 deletions
diff --git a/tests/define/buildfile b/tests/define/buildfile
index d3b9fc4..55b9e92 100644
--- a/tests/define/buildfile
+++ b/tests/define/buildfile
@@ -1,16 +1,14 @@
-#define # expected name
-#define foo # expected =
-#define foo= # expected name
-#define foo=bar # unknown target type
+#define # expected name
+#define foo # expected :
+#define foo: # expected name
+#define foo: bar # unknown target type
-define foo=file
-foo{FOO}: # verify name is foo{FOO} and not file{FOO} with --verbose 6
+define foo: file
+foo{FOO}: # verify name is foo{FOO} and not file{FOO} with --verbose 6
-#define foo=dir # already define in this scope
+#define foo: dir # already define in this scope
-define bar=foo
-bar{FOO}: # verify name is foo{FOO} and not bar{FOO} with --verbose 6
-bar{BAR}: # verify name is bar{BAR}
+define bar: foo
+bar{BAR}: # verify name is bar{FOO} with --verbose 6
-define folder=dir
-folder{./}: # verify prints "folder{} is up to date"
+./:
diff --git a/tests/define/buildfile.alias b/tests/define/buildfile.alias
new file mode 100644
index 0000000..d3b9fc4
--- /dev/null
+++ b/tests/define/buildfile.alias
@@ -0,0 +1,16 @@
+#define # expected name
+#define foo # expected =
+#define foo= # expected name
+#define foo=bar # unknown target type
+
+define foo=file
+foo{FOO}: # verify name is foo{FOO} and not file{FOO} with --verbose 6
+
+#define foo=dir # already define in this scope
+
+define bar=foo
+bar{FOO}: # verify name is foo{FOO} and not bar{FOO} with --verbose 6
+bar{BAR}: # verify name is bar{BAR}
+
+define folder=dir
+folder{./}: # verify prints "folder{} is up to date"