From 0ed86c76239d4f2904ea4ae1a77902a9e0db2a6d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2016 12:07:18 +0200 Subject: Move old tests to old-tests/ --- old-tests/.gitignore | 6 + old-tests/amalgam/config/build/bootstrap.build | 3 + old-tests/amalgam/config/build/root.build | 1 + old-tests/amalgam/config/buildfile | 3 + old-tests/amalgam/libtest/build/bootstrap.build | 2 + old-tests/amalgam/libtest/build/export.build | 6 + old-tests/amalgam/libtest/buildfile | 3 + old-tests/amalgam/libtest/test.cxx | 4 + old-tests/amalgam/test/build/bootstrap.build | 2 + old-tests/amalgam/test/buildfile | 5 + old-tests/amalgam/test/driver.cxx | 4 + old-tests/amalgam/unnamed/build/bootstrap.build | 3 + old-tests/amalgam/unnamed/buildfile | 3 + .../amalgam/unnamed/sub/build/bootstrap.build | 2 + old-tests/amalgam/unnamed/sub/buildfile | 2 + old-tests/amalgam/unnamed/test.out | 2 + old-tests/amalgam/unnamed/test.sh | 3 + old-tests/attribute/buildfile | 21 ++ old-tests/cli/lib/libtest/build/bootstrap.build | 3 + old-tests/cli/lib/libtest/build/export.build | 6 + old-tests/cli/lib/libtest/build/root.build | 5 + old-tests/cli/lib/libtest/buildfile | 2 + old-tests/cli/lib/libtest/test/base.cli | 7 + old-tests/cli/lib/libtest/test/buildfile | 20 ++ old-tests/cli/lib/libtest/test/extra/test.cli | 11 + old-tests/cli/lib/libtest/test/test.cli | 9 + old-tests/cli/lib/libtest/test/utility.cpp | 6 + old-tests/cli/lib/test/build/bootstrap.build | 3 + old-tests/cli/lib/test/build/root.build | 7 + old-tests/cli/lib/test/buildfile | 6 + old-tests/cli/lib/test/driver.C | 8 + old-tests/cli/lib/test/test.cli | 5 + old-tests/cli/simple/build/bootstrap.build | 3 + old-tests/cli/simple/build/root.build | 1 + old-tests/cli/simple/buildfile | 15 + old-tests/cli/simple/driver.cpp | 6 + old-tests/cli/simple/test.cli | 5 + old-tests/define/buildfile | 14 + old-tests/define/buildfile.alias | 16 ++ old-tests/depdb/buildfile | 8 + old-tests/depdb/driver.cxx | 166 +++++++++++ old-tests/dist/simple/README | 0 old-tests/dist/simple/bootstrap | 0 old-tests/dist/simple/build/bootstrap.build | 9 + old-tests/dist/simple/build/export.build | 0 old-tests/dist/simple/buildfile | 4 + old-tests/dist/simple/driver.cxx | 10 + old-tests/dist/simple/test.out | 1 + old-tests/escaping/buildfile | 13 + old-tests/escaping/test.out | 4 + old-tests/escaping/test.sh | 3 + old-tests/eval/buildfile | 72 +++++ old-tests/eval/test.out | 36 +++ old-tests/eval/test.sh | 3 + old-tests/if-else/buildfile | 158 +++++++++++ old-tests/if-else/test.out | 16 ++ old-tests/if-else/test.sh | 3 + old-tests/import/installed/build/bootstrap.build | 4 + old-tests/import/installed/buildfile | 12 + old-tests/import/installed/driver.cxx | 4 + .../install/lib/libtest/build/bootstrap.build | 5 + old-tests/install/lib/libtest/build/export.build | 6 + old-tests/install/lib/libtest/build/root.build | 11 + old-tests/install/lib/libtest/buildfile | 3 + old-tests/install/lib/libtest/doc/buildfile | 1 + old-tests/install/lib/libtest/doc/test.1 | 5 + old-tests/install/lib/libtest/doc/test.txt | 1 + old-tests/install/lib/libtest/test/buildfile | 10 + old-tests/install/lib/libtest/test/driver.cxx | 4 + old-tests/install/lib/libtest/test/driver.hxx | 0 old-tests/install/lib/libtest/test/utility.cxx | 6 + old-tests/install/lib/libtest/test/utility.hxx | 5 + old-tests/install/lib/libtest/tests/buildfile | 2 + old-tests/install/lib/libtest/tests/driver.cxx | 3 + old-tests/install/simple/README | 1 + old-tests/install/simple/build/bootstrap.build | 4 + old-tests/install/simple/buildfile | 4 + old-tests/install/simple/driver.cxx | 3 + old-tests/install/simple/utility.hxx | 2 + old-tests/keyword/buildfile | 23 ++ old-tests/keyword/test.out | 2 + old-tests/keyword/test.sh | 3 + old-tests/lexer/buildfile | 7 + old-tests/lexer/driver.cxx | 179 ++++++++++++ old-tests/names/buildfile | 54 ++++ old-tests/names/test.out | 37 +++ old-tests/names/test.sh | 3 + old-tests/pairs/buildfile | 40 +++ old-tests/pairs/test.out | 27 ++ old-tests/pairs/test.sh | 3 + old-tests/parser/buildfile | 9 + old-tests/parser/driver.cxx | 195 +++++++++++++ old-tests/postponed/build/bootstrap.build | 3 + old-tests/postponed/buildfile | 5 + old-tests/postponed/driver.cxx | 4 + old-tests/postponed/out/dummy | 0 old-tests/quote/buildfile | 51 ++++ old-tests/quote/test.out | 26 ++ old-tests/quote/test.sh | 3 + old-tests/scope/amalgamation/build/bootstrap.build | 3 + old-tests/scope/amalgamation/buildfile | 1 + .../scope/amalgamation/l1/build/bootstrap.build | 16 ++ old-tests/scope/amalgamation/l1/buildfile | 37 +++ .../scope/amalgamation/l1/l2/build/bootstrap.build | 2 + old-tests/scope/test-1.out | 15 + old-tests/scope/test-2.out | 15 + old-tests/scope/test.sh | 15 + old-tests/semantics/include/buildfile | 1 + old-tests/semantics/include/includee1 | 1 + old-tests/semantics/include/includee2 | 1 + old-tests/semantics/include/includee4 | 1 + old-tests/semantics/include/includer | 10 + old-tests/semantics/include/nested/includee3 | 2 + old-tests/semantics/include/nested/includee5 | 1 + old-tests/semantics/include/test.std | 5 + old-tests/semantics/source/buildfile | 1 + old-tests/semantics/source/nested/sourcee3 | 1 + old-tests/semantics/source/sourcee1 | 1 + old-tests/semantics/source/sourcee2 | 1 + old-tests/semantics/source/sourcer | 9 + old-tests/semantics/source/test.std | 5 + old-tests/simple/build/bootstrap.build | 3 + old-tests/simple/buildfile | 3 + old-tests/simple/driver.cxx | 8 + .../target/out-qualified/src/build/bootstrap.build | 2 + old-tests/target/out-qualified/src/buildfile | 5 + old-tests/target/out-qualified/src/foo | 0 old-tests/target/out-qualified/test.sh | 3 + old-tests/test.sh | 33 +++ old-tests/test/generated/build/bootstrap.build | 4 + old-tests/test/generated/buildfile | 9 + old-tests/test/generated/driver.cxx | 24 ++ old-tests/test/generated/utility.cxx | 1 + old-tests/test/simple/build/bootstrap.build | 4 + old-tests/test/simple/buildfile | 12 + old-tests/test/simple/driver.cxx | 14 + old-tests/test/simple/test.out | 1 + old-tests/test/simple/utility.cxx | 1 + old-tests/using/buildfile | 5 + old-tests/variable/dir-path/buildfile | 45 +++ old-tests/variable/dir-path/test.out | 22 ++ old-tests/variable/dir-path/test.sh | 3 + old-tests/variable/expansion/buildfile | 26 ++ old-tests/variable/expansion/test.out | 6 + old-tests/variable/expansion/test.sh | 3 + old-tests/variable/null/buildfile | 22 ++ old-tests/variable/null/test.out | 7 + old-tests/variable/null/test.sh | 3 + old-tests/variable/override/build/bootstrap.build | 2 + old-tests/variable/override/buildfile | 58 ++++ old-tests/variable/override/cache | 13 + .../variable/override/p/build/bootstrap.build | 1 + old-tests/variable/override/p/buildfile | 49 ++++ old-tests/variable/override/p/loader | 1 + old-tests/variable/override/simple | 3 + old-tests/variable/override/test.sh | 312 +++++++++++++++++++++ old-tests/variable/prepend/buildfile | 14 + old-tests/variable/prepend/test.out | 4 + old-tests/variable/prepend/test.sh | 3 + old-tests/variable/qualified/buildfile | 27 ++ old-tests/variable/qualified/test.out | 12 + old-tests/variable/qualified/test.sh | 3 + .../variable/representation/build/bootstrap.build | 4 + old-tests/variable/representation/buildfile | 34 +++ old-tests/variable/representation/driver.cxx | 10 + old-tests/variable/representation/test.out | 20 ++ old-tests/variable/representation/test.sh | 4 + old-tests/variable/type-pattern-append/buildfile | 59 ++++ old-tests/variable/type-pattern-append/test.out | 7 + old-tests/variable/type-pattern-append/test.sh | 3 + old-tests/variable/type-pattern/buildfile | 39 +++ old-tests/variable/type/buildfile | 84 ++++++ old-tests/variable/type/test.out | 12 + old-tests/variable/type/test.sh | 3 + old-tests/version/buildfile | 31 ++ tests/.gitignore | 5 - tests/amalgam/config/build/bootstrap.build | 3 - tests/amalgam/config/build/root.build | 1 - tests/amalgam/config/buildfile | 3 - tests/amalgam/libtest/build/bootstrap.build | 2 - tests/amalgam/libtest/build/export.build | 6 - tests/amalgam/libtest/buildfile | 3 - tests/amalgam/libtest/test.cxx | 4 - tests/amalgam/test/build/bootstrap.build | 2 - tests/amalgam/test/buildfile | 5 - tests/amalgam/test/driver.cxx | 4 - tests/amalgam/unnamed/build/bootstrap.build | 3 - tests/amalgam/unnamed/buildfile | 3 - tests/amalgam/unnamed/sub/build/bootstrap.build | 2 - tests/amalgam/unnamed/sub/buildfile | 2 - tests/amalgam/unnamed/test.out | 2 - tests/amalgam/unnamed/test.sh | 3 - tests/attribute/buildfile | 21 -- tests/cli/lib/libtest/build/bootstrap.build | 3 - tests/cli/lib/libtest/build/export.build | 6 - tests/cli/lib/libtest/build/root.build | 5 - tests/cli/lib/libtest/buildfile | 2 - tests/cli/lib/libtest/test/base.cli | 7 - tests/cli/lib/libtest/test/buildfile | 20 -- tests/cli/lib/libtest/test/extra/test.cli | 11 - tests/cli/lib/libtest/test/test.cli | 9 - tests/cli/lib/libtest/test/utility.cpp | 6 - tests/cli/lib/test/build/bootstrap.build | 3 - tests/cli/lib/test/build/root.build | 7 - tests/cli/lib/test/buildfile | 6 - tests/cli/lib/test/driver.C | 8 - tests/cli/lib/test/test.cli | 5 - tests/cli/simple/build/bootstrap.build | 3 - tests/cli/simple/build/root.build | 1 - tests/cli/simple/buildfile | 15 - tests/cli/simple/driver.cpp | 6 - tests/cli/simple/test.cli | 5 - tests/define/buildfile | 14 - tests/define/buildfile.alias | 16 -- tests/depdb/buildfile | 8 - tests/depdb/driver.cxx | 166 ----------- tests/dist/simple/README | 0 tests/dist/simple/bootstrap | 0 tests/dist/simple/build/bootstrap.build | 9 - tests/dist/simple/build/export.build | 0 tests/dist/simple/buildfile | 4 - tests/dist/simple/driver.cxx | 10 - tests/dist/simple/test.out | 1 - tests/escaping/buildfile | 13 - tests/escaping/test.out | 4 - tests/escaping/test.sh | 3 - tests/eval/buildfile | 72 ----- tests/eval/test.out | 36 --- tests/eval/test.sh | 3 - tests/if-else/buildfile | 158 ----------- tests/if-else/test.out | 16 -- tests/if-else/test.sh | 3 - tests/import/installed/build/bootstrap.build | 4 - tests/import/installed/buildfile | 12 - tests/import/installed/driver.cxx | 4 - tests/install/lib/libtest/build/bootstrap.build | 5 - tests/install/lib/libtest/build/export.build | 6 - tests/install/lib/libtest/build/root.build | 11 - tests/install/lib/libtest/buildfile | 3 - tests/install/lib/libtest/doc/buildfile | 1 - tests/install/lib/libtest/doc/test.1 | 5 - tests/install/lib/libtest/doc/test.txt | 1 - tests/install/lib/libtest/test/buildfile | 10 - tests/install/lib/libtest/test/driver.cxx | 4 - tests/install/lib/libtest/test/driver.hxx | 0 tests/install/lib/libtest/test/utility.cxx | 6 - tests/install/lib/libtest/test/utility.hxx | 5 - tests/install/lib/libtest/tests/buildfile | 2 - tests/install/lib/libtest/tests/driver.cxx | 3 - tests/install/simple/README | 1 - tests/install/simple/build/bootstrap.build | 4 - tests/install/simple/buildfile | 4 - tests/install/simple/driver.cxx | 3 - tests/install/simple/utility.hxx | 2 - tests/keyword/buildfile | 23 -- tests/keyword/test.out | 2 - tests/keyword/test.sh | 3 - tests/lexer/buildfile | 7 - tests/lexer/driver.cxx | 179 ------------ tests/names/buildfile | 54 ---- tests/names/test.out | 37 --- tests/names/test.sh | 3 - tests/pairs/buildfile | 40 --- tests/pairs/test.out | 27 -- tests/pairs/test.sh | 3 - tests/parser/buildfile | 9 - tests/parser/driver.cxx | 195 ------------- tests/postponed/build/bootstrap.build | 3 - tests/postponed/buildfile | 5 - tests/postponed/driver.cxx | 4 - tests/postponed/out/dummy | 0 tests/quote/buildfile | 51 ---- tests/quote/test.out | 26 -- tests/quote/test.sh | 3 - tests/scope/amalgamation/build/bootstrap.build | 3 - tests/scope/amalgamation/buildfile | 1 - tests/scope/amalgamation/l1/build/bootstrap.build | 16 -- tests/scope/amalgamation/l1/buildfile | 37 --- .../scope/amalgamation/l1/l2/build/bootstrap.build | 2 - tests/scope/test-1.out | 15 - tests/scope/test-2.out | 15 - tests/scope/test.sh | 15 - tests/semantics/include/buildfile | 1 - tests/semantics/include/includee1 | 1 - tests/semantics/include/includee2 | 1 - tests/semantics/include/includee4 | 1 - tests/semantics/include/includer | 10 - tests/semantics/include/nested/includee3 | 2 - tests/semantics/include/nested/includee5 | 1 - tests/semantics/include/test.std | 5 - tests/semantics/source/buildfile | 1 - tests/semantics/source/nested/sourcee3 | 1 - tests/semantics/source/sourcee1 | 1 - tests/semantics/source/sourcee2 | 1 - tests/semantics/source/sourcer | 9 - tests/semantics/source/test.std | 5 - tests/simple/build/bootstrap.build | 3 - tests/simple/buildfile | 3 - tests/simple/driver.cxx | 8 - .../target/out-qualified/src/build/bootstrap.build | 2 - tests/target/out-qualified/src/buildfile | 5 - tests/target/out-qualified/src/foo | 0 tests/target/out-qualified/test.sh | 3 - tests/test.sh | 33 --- tests/test/generated/build/bootstrap.build | 4 - tests/test/generated/buildfile | 9 - tests/test/generated/driver.cxx | 24 -- tests/test/generated/utility.cxx | 1 - tests/test/simple/build/bootstrap.build | 4 - tests/test/simple/buildfile | 12 - tests/test/simple/driver.cxx | 14 - tests/test/simple/test.out | 1 - tests/test/simple/utility.cxx | 1 - tests/using/buildfile | 5 - tests/variable/dir-path/buildfile | 45 --- tests/variable/dir-path/test.out | 22 -- tests/variable/dir-path/test.sh | 3 - tests/variable/expansion/buildfile | 26 -- tests/variable/expansion/test.out | 6 - tests/variable/expansion/test.sh | 3 - tests/variable/null/buildfile | 22 -- tests/variable/null/test.out | 7 - tests/variable/null/test.sh | 3 - tests/variable/override/build/bootstrap.build | 2 - tests/variable/override/buildfile | 58 ---- tests/variable/override/cache | 13 - tests/variable/override/p/build/bootstrap.build | 1 - tests/variable/override/p/buildfile | 49 ---- tests/variable/override/p/loader | 1 - tests/variable/override/simple | 3 - tests/variable/override/test.sh | 312 --------------------- tests/variable/prepend/buildfile | 14 - tests/variable/prepend/test.out | 4 - tests/variable/prepend/test.sh | 3 - tests/variable/qualified/buildfile | 27 -- tests/variable/qualified/test.out | 12 - tests/variable/qualified/test.sh | 3 - .../variable/representation/build/bootstrap.build | 4 - tests/variable/representation/buildfile | 34 --- tests/variable/representation/driver.cxx | 10 - tests/variable/representation/test.out | 20 -- tests/variable/representation/test.sh | 4 - tests/variable/type-pattern-append/buildfile | 59 ---- tests/variable/type-pattern-append/test.out | 7 - tests/variable/type-pattern-append/test.sh | 3 - tests/variable/type-pattern/buildfile | 39 --- tests/variable/type/buildfile | 84 ------ tests/variable/type/test.out | 12 - tests/variable/type/test.sh | 3 - tests/version/buildfile | 31 -- 350 files changed, 2734 insertions(+), 2733 deletions(-) create mode 100644 old-tests/.gitignore create mode 100644 old-tests/amalgam/config/build/bootstrap.build create mode 100644 old-tests/amalgam/config/build/root.build create mode 100644 old-tests/amalgam/config/buildfile create mode 100644 old-tests/amalgam/libtest/build/bootstrap.build create mode 100644 old-tests/amalgam/libtest/build/export.build create mode 100644 old-tests/amalgam/libtest/buildfile create mode 100644 old-tests/amalgam/libtest/test.cxx create mode 100644 old-tests/amalgam/test/build/bootstrap.build create mode 100644 old-tests/amalgam/test/buildfile create mode 100644 old-tests/amalgam/test/driver.cxx create mode 100644 old-tests/amalgam/unnamed/build/bootstrap.build create mode 100644 old-tests/amalgam/unnamed/buildfile create mode 100644 old-tests/amalgam/unnamed/sub/build/bootstrap.build create mode 100644 old-tests/amalgam/unnamed/sub/buildfile create mode 100644 old-tests/amalgam/unnamed/test.out create mode 100755 old-tests/amalgam/unnamed/test.sh create mode 100644 old-tests/attribute/buildfile create mode 100644 old-tests/cli/lib/libtest/build/bootstrap.build create mode 100644 old-tests/cli/lib/libtest/build/export.build create mode 100644 old-tests/cli/lib/libtest/build/root.build create mode 100644 old-tests/cli/lib/libtest/buildfile create mode 100644 old-tests/cli/lib/libtest/test/base.cli create mode 100644 old-tests/cli/lib/libtest/test/buildfile create mode 100644 old-tests/cli/lib/libtest/test/extra/test.cli create mode 100644 old-tests/cli/lib/libtest/test/test.cli create mode 100644 old-tests/cli/lib/libtest/test/utility.cpp create mode 100644 old-tests/cli/lib/test/build/bootstrap.build create mode 100644 old-tests/cli/lib/test/build/root.build create mode 100644 old-tests/cli/lib/test/buildfile create mode 100644 old-tests/cli/lib/test/driver.C create mode 100644 old-tests/cli/lib/test/test.cli create mode 100644 old-tests/cli/simple/build/bootstrap.build create mode 100644 old-tests/cli/simple/build/root.build create mode 100644 old-tests/cli/simple/buildfile create mode 100644 old-tests/cli/simple/driver.cpp create mode 100644 old-tests/cli/simple/test.cli create mode 100644 old-tests/define/buildfile create mode 100644 old-tests/define/buildfile.alias create mode 100644 old-tests/depdb/buildfile create mode 100644 old-tests/depdb/driver.cxx create mode 100644 old-tests/dist/simple/README create mode 100755 old-tests/dist/simple/bootstrap create mode 100644 old-tests/dist/simple/build/bootstrap.build create mode 100644 old-tests/dist/simple/build/export.build create mode 100644 old-tests/dist/simple/buildfile create mode 100644 old-tests/dist/simple/driver.cxx create mode 100644 old-tests/dist/simple/test.out create mode 100644 old-tests/escaping/buildfile create mode 100644 old-tests/escaping/test.out create mode 100755 old-tests/escaping/test.sh create mode 100644 old-tests/eval/buildfile create mode 100644 old-tests/eval/test.out create mode 100755 old-tests/eval/test.sh create mode 100644 old-tests/if-else/buildfile create mode 100644 old-tests/if-else/test.out create mode 100755 old-tests/if-else/test.sh create mode 100644 old-tests/import/installed/build/bootstrap.build create mode 100644 old-tests/import/installed/buildfile create mode 100644 old-tests/import/installed/driver.cxx create mode 100644 old-tests/install/lib/libtest/build/bootstrap.build create mode 100644 old-tests/install/lib/libtest/build/export.build create mode 100644 old-tests/install/lib/libtest/build/root.build create mode 100644 old-tests/install/lib/libtest/buildfile create mode 100644 old-tests/install/lib/libtest/doc/buildfile create mode 100644 old-tests/install/lib/libtest/doc/test.1 create mode 100644 old-tests/install/lib/libtest/doc/test.txt create mode 100644 old-tests/install/lib/libtest/test/buildfile create mode 100644 old-tests/install/lib/libtest/test/driver.cxx create mode 100644 old-tests/install/lib/libtest/test/driver.hxx create mode 100644 old-tests/install/lib/libtest/test/utility.cxx create mode 100644 old-tests/install/lib/libtest/test/utility.hxx create mode 100644 old-tests/install/lib/libtest/tests/buildfile create mode 100644 old-tests/install/lib/libtest/tests/driver.cxx create mode 100644 old-tests/install/simple/README create mode 100644 old-tests/install/simple/build/bootstrap.build create mode 100644 old-tests/install/simple/buildfile create mode 100644 old-tests/install/simple/driver.cxx create mode 100644 old-tests/install/simple/utility.hxx create mode 100644 old-tests/keyword/buildfile create mode 100644 old-tests/keyword/test.out create mode 100755 old-tests/keyword/test.sh create mode 100644 old-tests/lexer/buildfile create mode 100644 old-tests/lexer/driver.cxx create mode 100644 old-tests/names/buildfile create mode 100644 old-tests/names/test.out create mode 100755 old-tests/names/test.sh create mode 100644 old-tests/pairs/buildfile create mode 100644 old-tests/pairs/test.out create mode 100755 old-tests/pairs/test.sh create mode 100644 old-tests/parser/buildfile create mode 100644 old-tests/parser/driver.cxx create mode 100644 old-tests/postponed/build/bootstrap.build create mode 100644 old-tests/postponed/buildfile create mode 100644 old-tests/postponed/driver.cxx create mode 100644 old-tests/postponed/out/dummy create mode 100644 old-tests/quote/buildfile create mode 100644 old-tests/quote/test.out create mode 100755 old-tests/quote/test.sh create mode 100644 old-tests/scope/amalgamation/build/bootstrap.build create mode 100644 old-tests/scope/amalgamation/buildfile create mode 100644 old-tests/scope/amalgamation/l1/build/bootstrap.build create mode 100644 old-tests/scope/amalgamation/l1/buildfile create mode 100644 old-tests/scope/amalgamation/l1/l2/build/bootstrap.build create mode 100644 old-tests/scope/test-1.out create mode 100644 old-tests/scope/test-2.out create mode 100755 old-tests/scope/test.sh create mode 120000 old-tests/semantics/include/buildfile create mode 100644 old-tests/semantics/include/includee1 create mode 100644 old-tests/semantics/include/includee2 create mode 100644 old-tests/semantics/include/includee4 create mode 100644 old-tests/semantics/include/includer create mode 100644 old-tests/semantics/include/nested/includee3 create mode 100644 old-tests/semantics/include/nested/includee5 create mode 100644 old-tests/semantics/include/test.std create mode 120000 old-tests/semantics/source/buildfile create mode 100644 old-tests/semantics/source/nested/sourcee3 create mode 100644 old-tests/semantics/source/sourcee1 create mode 100644 old-tests/semantics/source/sourcee2 create mode 100644 old-tests/semantics/source/sourcer create mode 100644 old-tests/semantics/source/test.std create mode 100644 old-tests/simple/build/bootstrap.build create mode 100644 old-tests/simple/buildfile create mode 100644 old-tests/simple/driver.cxx create mode 100644 old-tests/target/out-qualified/src/build/bootstrap.build create mode 100644 old-tests/target/out-qualified/src/buildfile create mode 100644 old-tests/target/out-qualified/src/foo create mode 100755 old-tests/target/out-qualified/test.sh create mode 100755 old-tests/test.sh create mode 100644 old-tests/test/generated/build/bootstrap.build create mode 100644 old-tests/test/generated/buildfile create mode 100644 old-tests/test/generated/driver.cxx create mode 100644 old-tests/test/generated/utility.cxx create mode 100644 old-tests/test/simple/build/bootstrap.build create mode 100644 old-tests/test/simple/buildfile create mode 100644 old-tests/test/simple/driver.cxx create mode 100644 old-tests/test/simple/test.out create mode 100644 old-tests/test/simple/utility.cxx create mode 100644 old-tests/using/buildfile create mode 100644 old-tests/variable/dir-path/buildfile create mode 100644 old-tests/variable/dir-path/test.out create mode 100755 old-tests/variable/dir-path/test.sh create mode 100644 old-tests/variable/expansion/buildfile create mode 100644 old-tests/variable/expansion/test.out create mode 100755 old-tests/variable/expansion/test.sh create mode 100644 old-tests/variable/null/buildfile create mode 100644 old-tests/variable/null/test.out create mode 100755 old-tests/variable/null/test.sh create mode 100644 old-tests/variable/override/build/bootstrap.build create mode 100644 old-tests/variable/override/buildfile create mode 100644 old-tests/variable/override/cache create mode 100644 old-tests/variable/override/p/build/bootstrap.build create mode 100644 old-tests/variable/override/p/buildfile create mode 100644 old-tests/variable/override/p/loader create mode 100644 old-tests/variable/override/simple create mode 100755 old-tests/variable/override/test.sh create mode 100644 old-tests/variable/prepend/buildfile create mode 100644 old-tests/variable/prepend/test.out create mode 100755 old-tests/variable/prepend/test.sh create mode 100644 old-tests/variable/qualified/buildfile create mode 100644 old-tests/variable/qualified/test.out create mode 100755 old-tests/variable/qualified/test.sh create mode 100644 old-tests/variable/representation/build/bootstrap.build create mode 100644 old-tests/variable/representation/buildfile create mode 100644 old-tests/variable/representation/driver.cxx create mode 100644 old-tests/variable/representation/test.out create mode 100755 old-tests/variable/representation/test.sh create mode 100644 old-tests/variable/type-pattern-append/buildfile create mode 100644 old-tests/variable/type-pattern-append/test.out create mode 100755 old-tests/variable/type-pattern-append/test.sh create mode 100644 old-tests/variable/type-pattern/buildfile create mode 100644 old-tests/variable/type/buildfile create mode 100644 old-tests/variable/type/test.out create mode 100755 old-tests/variable/type/test.sh create mode 100644 old-tests/version/buildfile delete mode 100644 tests/amalgam/config/build/bootstrap.build delete mode 100644 tests/amalgam/config/build/root.build delete mode 100644 tests/amalgam/config/buildfile delete mode 100644 tests/amalgam/libtest/build/bootstrap.build delete mode 100644 tests/amalgam/libtest/build/export.build delete mode 100644 tests/amalgam/libtest/buildfile delete mode 100644 tests/amalgam/libtest/test.cxx delete mode 100644 tests/amalgam/test/build/bootstrap.build delete mode 100644 tests/amalgam/test/buildfile delete mode 100644 tests/amalgam/test/driver.cxx delete mode 100644 tests/amalgam/unnamed/build/bootstrap.build delete mode 100644 tests/amalgam/unnamed/buildfile delete mode 100644 tests/amalgam/unnamed/sub/build/bootstrap.build delete mode 100644 tests/amalgam/unnamed/sub/buildfile delete mode 100644 tests/amalgam/unnamed/test.out delete mode 100755 tests/amalgam/unnamed/test.sh delete mode 100644 tests/attribute/buildfile delete mode 100644 tests/cli/lib/libtest/build/bootstrap.build delete mode 100644 tests/cli/lib/libtest/build/export.build delete mode 100644 tests/cli/lib/libtest/build/root.build delete mode 100644 tests/cli/lib/libtest/buildfile delete mode 100644 tests/cli/lib/libtest/test/base.cli delete mode 100644 tests/cli/lib/libtest/test/buildfile delete mode 100644 tests/cli/lib/libtest/test/extra/test.cli delete mode 100644 tests/cli/lib/libtest/test/test.cli delete mode 100644 tests/cli/lib/libtest/test/utility.cpp delete mode 100644 tests/cli/lib/test/build/bootstrap.build delete mode 100644 tests/cli/lib/test/build/root.build delete mode 100644 tests/cli/lib/test/buildfile delete mode 100644 tests/cli/lib/test/driver.C delete mode 100644 tests/cli/lib/test/test.cli delete mode 100644 tests/cli/simple/build/bootstrap.build delete mode 100644 tests/cli/simple/build/root.build delete mode 100644 tests/cli/simple/buildfile delete mode 100644 tests/cli/simple/driver.cpp delete mode 100644 tests/cli/simple/test.cli delete mode 100644 tests/define/buildfile delete mode 100644 tests/define/buildfile.alias delete mode 100644 tests/depdb/buildfile delete mode 100644 tests/depdb/driver.cxx delete mode 100644 tests/dist/simple/README delete mode 100755 tests/dist/simple/bootstrap delete mode 100644 tests/dist/simple/build/bootstrap.build delete mode 100644 tests/dist/simple/build/export.build delete mode 100644 tests/dist/simple/buildfile delete mode 100644 tests/dist/simple/driver.cxx delete mode 100644 tests/dist/simple/test.out delete mode 100644 tests/escaping/buildfile delete mode 100644 tests/escaping/test.out delete mode 100755 tests/escaping/test.sh delete mode 100644 tests/eval/buildfile delete mode 100644 tests/eval/test.out delete mode 100755 tests/eval/test.sh delete mode 100644 tests/if-else/buildfile delete mode 100644 tests/if-else/test.out delete mode 100755 tests/if-else/test.sh delete mode 100644 tests/import/installed/build/bootstrap.build delete mode 100644 tests/import/installed/buildfile delete mode 100644 tests/import/installed/driver.cxx delete mode 100644 tests/install/lib/libtest/build/bootstrap.build delete mode 100644 tests/install/lib/libtest/build/export.build delete mode 100644 tests/install/lib/libtest/build/root.build delete mode 100644 tests/install/lib/libtest/buildfile delete mode 100644 tests/install/lib/libtest/doc/buildfile delete mode 100644 tests/install/lib/libtest/doc/test.1 delete mode 100644 tests/install/lib/libtest/doc/test.txt delete mode 100644 tests/install/lib/libtest/test/buildfile delete mode 100644 tests/install/lib/libtest/test/driver.cxx delete mode 100644 tests/install/lib/libtest/test/driver.hxx delete mode 100644 tests/install/lib/libtest/test/utility.cxx delete mode 100644 tests/install/lib/libtest/test/utility.hxx delete mode 100644 tests/install/lib/libtest/tests/buildfile delete mode 100644 tests/install/lib/libtest/tests/driver.cxx delete mode 100644 tests/install/simple/README delete mode 100644 tests/install/simple/build/bootstrap.build delete mode 100644 tests/install/simple/buildfile delete mode 100644 tests/install/simple/driver.cxx delete mode 100644 tests/install/simple/utility.hxx delete mode 100644 tests/keyword/buildfile delete mode 100644 tests/keyword/test.out delete mode 100755 tests/keyword/test.sh delete mode 100644 tests/lexer/buildfile delete mode 100644 tests/lexer/driver.cxx delete mode 100644 tests/names/buildfile delete mode 100644 tests/names/test.out delete mode 100755 tests/names/test.sh delete mode 100644 tests/pairs/buildfile delete mode 100644 tests/pairs/test.out delete mode 100755 tests/pairs/test.sh delete mode 100644 tests/parser/buildfile delete mode 100644 tests/parser/driver.cxx delete mode 100644 tests/postponed/build/bootstrap.build delete mode 100644 tests/postponed/buildfile delete mode 100644 tests/postponed/driver.cxx delete mode 100644 tests/postponed/out/dummy delete mode 100644 tests/quote/buildfile delete mode 100644 tests/quote/test.out delete mode 100755 tests/quote/test.sh delete mode 100644 tests/scope/amalgamation/build/bootstrap.build delete mode 100644 tests/scope/amalgamation/buildfile delete mode 100644 tests/scope/amalgamation/l1/build/bootstrap.build delete mode 100644 tests/scope/amalgamation/l1/buildfile delete mode 100644 tests/scope/amalgamation/l1/l2/build/bootstrap.build delete mode 100644 tests/scope/test-1.out delete mode 100644 tests/scope/test-2.out delete mode 100755 tests/scope/test.sh delete mode 120000 tests/semantics/include/buildfile delete mode 100644 tests/semantics/include/includee1 delete mode 100644 tests/semantics/include/includee2 delete mode 100644 tests/semantics/include/includee4 delete mode 100644 tests/semantics/include/includer delete mode 100644 tests/semantics/include/nested/includee3 delete mode 100644 tests/semantics/include/nested/includee5 delete mode 100644 tests/semantics/include/test.std delete mode 120000 tests/semantics/source/buildfile delete mode 100644 tests/semantics/source/nested/sourcee3 delete mode 100644 tests/semantics/source/sourcee1 delete mode 100644 tests/semantics/source/sourcee2 delete mode 100644 tests/semantics/source/sourcer delete mode 100644 tests/semantics/source/test.std delete mode 100644 tests/simple/build/bootstrap.build delete mode 100644 tests/simple/buildfile delete mode 100644 tests/simple/driver.cxx delete mode 100644 tests/target/out-qualified/src/build/bootstrap.build delete mode 100644 tests/target/out-qualified/src/buildfile delete mode 100644 tests/target/out-qualified/src/foo delete mode 100755 tests/target/out-qualified/test.sh delete mode 100755 tests/test.sh delete mode 100644 tests/test/generated/build/bootstrap.build delete mode 100644 tests/test/generated/buildfile delete mode 100644 tests/test/generated/driver.cxx delete mode 100644 tests/test/generated/utility.cxx delete mode 100644 tests/test/simple/build/bootstrap.build delete mode 100644 tests/test/simple/buildfile delete mode 100644 tests/test/simple/driver.cxx delete mode 100644 tests/test/simple/test.out delete mode 100644 tests/test/simple/utility.cxx delete mode 100644 tests/using/buildfile delete mode 100644 tests/variable/dir-path/buildfile delete mode 100644 tests/variable/dir-path/test.out delete mode 100755 tests/variable/dir-path/test.sh delete mode 100644 tests/variable/expansion/buildfile delete mode 100644 tests/variable/expansion/test.out delete mode 100755 tests/variable/expansion/test.sh delete mode 100644 tests/variable/null/buildfile delete mode 100644 tests/variable/null/test.out delete mode 100755 tests/variable/null/test.sh delete mode 100644 tests/variable/override/build/bootstrap.build delete mode 100644 tests/variable/override/buildfile delete mode 100644 tests/variable/override/cache delete mode 100644 tests/variable/override/p/build/bootstrap.build delete mode 100644 tests/variable/override/p/buildfile delete mode 100644 tests/variable/override/p/loader delete mode 100644 tests/variable/override/simple delete mode 100755 tests/variable/override/test.sh delete mode 100644 tests/variable/prepend/buildfile delete mode 100644 tests/variable/prepend/test.out delete mode 100755 tests/variable/prepend/test.sh delete mode 100644 tests/variable/qualified/buildfile delete mode 100644 tests/variable/qualified/test.out delete mode 100755 tests/variable/qualified/test.sh delete mode 100644 tests/variable/representation/build/bootstrap.build delete mode 100644 tests/variable/representation/buildfile delete mode 100644 tests/variable/representation/driver.cxx delete mode 100644 tests/variable/representation/test.out delete mode 100755 tests/variable/representation/test.sh delete mode 100644 tests/variable/type-pattern-append/buildfile delete mode 100644 tests/variable/type-pattern-append/test.out delete mode 100755 tests/variable/type-pattern-append/test.sh delete mode 100644 tests/variable/type-pattern/buildfile delete mode 100644 tests/variable/type/buildfile delete mode 100644 tests/variable/type/test.out delete mode 100755 tests/variable/type/test.sh delete mode 100644 tests/version/buildfile diff --git a/old-tests/.gitignore b/old-tests/.gitignore new file mode 100644 index 0000000..c7bd86c --- /dev/null +++ b/old-tests/.gitignore @@ -0,0 +1,6 @@ +driver +config.build + +# Temporary out-of-tree build directories. +# +*-out diff --git a/old-tests/amalgam/config/build/bootstrap.build b/old-tests/amalgam/config/build/bootstrap.build new file mode 100644 index 0000000..52d415a --- /dev/null +++ b/old-tests/amalgam/config/build/bootstrap.build @@ -0,0 +1,3 @@ +project = amalgam-config +amalgamation = # Shall not be amalgamated. +using config diff --git a/old-tests/amalgam/config/build/root.build b/old-tests/amalgam/config/build/root.build new file mode 100644 index 0000000..7d1767b --- /dev/null +++ b/old-tests/amalgam/config/build/root.build @@ -0,0 +1 @@ +using cxx diff --git a/old-tests/amalgam/config/buildfile b/old-tests/amalgam/config/buildfile new file mode 100644 index 0000000..32285a9 --- /dev/null +++ b/old-tests/amalgam/config/buildfile @@ -0,0 +1,3 @@ +d = #t/ l/ +./: $d +include $d diff --git a/old-tests/amalgam/libtest/build/bootstrap.build b/old-tests/amalgam/libtest/build/bootstrap.build new file mode 100644 index 0000000..025e510 --- /dev/null +++ b/old-tests/amalgam/libtest/build/bootstrap.build @@ -0,0 +1,2 @@ +project = amalgam-libtest +using config diff --git a/old-tests/amalgam/libtest/build/export.build b/old-tests/amalgam/libtest/build/export.build new file mode 100644 index 0000000..b95e409 --- /dev/null +++ b/old-tests/amalgam/libtest/build/export.build @@ -0,0 +1,6 @@ +$out_root/: +{ + include buildfile +} + +export $out_root/lib{test} diff --git a/old-tests/amalgam/libtest/buildfile b/old-tests/amalgam/libtest/buildfile new file mode 100644 index 0000000..70a1467 --- /dev/null +++ b/old-tests/amalgam/libtest/buildfile @@ -0,0 +1,3 @@ +using cxx + +lib{test}: cxx{test} diff --git a/old-tests/amalgam/libtest/test.cxx b/old-tests/amalgam/libtest/test.cxx new file mode 100644 index 0000000..34a033a --- /dev/null +++ b/old-tests/amalgam/libtest/test.cxx @@ -0,0 +1,4 @@ +void +f () +{ +} diff --git a/old-tests/amalgam/test/build/bootstrap.build b/old-tests/amalgam/test/build/bootstrap.build new file mode 100644 index 0000000..a53e738 --- /dev/null +++ b/old-tests/amalgam/test/build/bootstrap.build @@ -0,0 +1,2 @@ +project = amalgam-test +using config diff --git a/old-tests/amalgam/test/buildfile b/old-tests/amalgam/test/buildfile new file mode 100644 index 0000000..e8af169 --- /dev/null +++ b/old-tests/amalgam/test/buildfile @@ -0,0 +1,5 @@ +using cxx + +import libs = amalgam-libtest%lib{test} + +exe{driver}: cxx{driver} $libs diff --git a/old-tests/amalgam/test/driver.cxx b/old-tests/amalgam/test/driver.cxx new file mode 100644 index 0000000..70b4146 --- /dev/null +++ b/old-tests/amalgam/test/driver.cxx @@ -0,0 +1,4 @@ +int +main () +{ +} diff --git a/old-tests/amalgam/unnamed/build/bootstrap.build b/old-tests/amalgam/unnamed/build/bootstrap.build new file mode 100644 index 0000000..30065f4 --- /dev/null +++ b/old-tests/amalgam/unnamed/build/bootstrap.build @@ -0,0 +1,3 @@ +project = amalgam-unnamed +amalgamation = # Disabled. +using config diff --git a/old-tests/amalgam/unnamed/buildfile b/old-tests/amalgam/unnamed/buildfile new file mode 100644 index 0000000..ead9514 --- /dev/null +++ b/old-tests/amalgam/unnamed/buildfile @@ -0,0 +1,3 @@ +./: sub/ +include sub/ +print $subprojects diff --git a/old-tests/amalgam/unnamed/sub/build/bootstrap.build b/old-tests/amalgam/unnamed/sub/build/bootstrap.build new file mode 100644 index 0000000..ce3735a --- /dev/null +++ b/old-tests/amalgam/unnamed/sub/build/bootstrap.build @@ -0,0 +1,2 @@ +project = +using config diff --git a/old-tests/amalgam/unnamed/sub/buildfile b/old-tests/amalgam/unnamed/sub/buildfile new file mode 100644 index 0000000..8717375 --- /dev/null +++ b/old-tests/amalgam/unnamed/sub/buildfile @@ -0,0 +1,2 @@ +./: +print "'$project'" diff --git a/old-tests/amalgam/unnamed/test.out b/old-tests/amalgam/unnamed/test.out new file mode 100644 index 0000000..023b71f --- /dev/null +++ b/old-tests/amalgam/unnamed/test.out @@ -0,0 +1,2 @@ +'' +sub/@sub/ diff --git a/old-tests/amalgam/unnamed/test.sh b/old-tests/amalgam/unnamed/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/amalgam/unnamed/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/attribute/buildfile b/old-tests/attribute/buildfile new file mode 100644 index 0000000..6675894 --- /dev/null +++ b/old-tests/attribute/buildfile @@ -0,0 +1,21 @@ +#[] # error: standalone attribute sequence +#[foo] # error: standalone attribute sequence +#[[] # error: expected name instead of '[' +#[foo # error: expected ']' instead of +#[dir/file{foo}] # error: invalid attribute key +#[foo=dir/file{bar}] # error: invalid attribute key + +#[foo] print hello # error: attributes before print +#[foo]./: # error: attributes before directory scope +#{ +#} +#[foo]./: # error: attributes before target/scope +#./: [foo] buildfile # error: attributes before prerequisites +#import [foo] libz # error: attributes without variable + +#foo="F[O]O" +#[{x y z}] +#[$foo] +#["[]"] + +./: diff --git a/old-tests/cli/lib/libtest/build/bootstrap.build b/old-tests/cli/lib/libtest/build/bootstrap.build new file mode 100644 index 0000000..2e04406 --- /dev/null +++ b/old-tests/cli/lib/libtest/build/bootstrap.build @@ -0,0 +1,3 @@ +project = cli-lib-libtest +amalgamation = # Disabled. +using config diff --git a/old-tests/cli/lib/libtest/build/export.build b/old-tests/cli/lib/libtest/build/export.build new file mode 100644 index 0000000..e8b12b3 --- /dev/null +++ b/old-tests/cli/lib/libtest/build/export.build @@ -0,0 +1,6 @@ +$out_root/: +{ + include test/ +} + +export $out_root/test/lib{test} diff --git a/old-tests/cli/lib/libtest/build/root.build b/old-tests/cli/lib/libtest/build/root.build new file mode 100644 index 0000000..c9ff67d --- /dev/null +++ b/old-tests/cli/lib/libtest/build/root.build @@ -0,0 +1,5 @@ +using cxx + +hxx{*}: extension = +ixx{*}: extension = ipp +cxx{*}: extension = cpp diff --git a/old-tests/cli/lib/libtest/buildfile b/old-tests/cli/lib/libtest/buildfile new file mode 100644 index 0000000..7ea849d --- /dev/null +++ b/old-tests/cli/lib/libtest/buildfile @@ -0,0 +1,2 @@ +./: test/ +include test/ diff --git a/old-tests/cli/lib/libtest/test/base.cli b/old-tests/cli/lib/libtest/test/base.cli new file mode 100644 index 0000000..bbf9999 --- /dev/null +++ b/old-tests/cli/lib/libtest/test/base.cli @@ -0,0 +1,7 @@ +namespace test +{ + class base + { + bool --version; + }; +} diff --git a/old-tests/cli/lib/libtest/test/buildfile b/old-tests/cli/lib/libtest/test/buildfile new file mode 100644 index 0000000..6b0d9bd --- /dev/null +++ b/old-tests/cli/lib/libtest/test/buildfile @@ -0,0 +1,20 @@ +using cli + +lib{test}: cxx{utility} cli.cxx{test base} extra/cxx{test} +cli.cxx{test}: cli{test} +cli.cxx{base}: cli{base} + +cli.options += -I $src_root --include-with-brackets + +extra/: +{ + cxx{test} hxx{test}: cli{test} + cli.options += --include-prefix test/extra --guard-prefix TEST_EXTRA \ + --cli-namespace test::extra::cli +} + +cxx.poptions += -I$out_root -I$src_root +lib{test}: cxx.export.poptions = -I$out_root -I$src_root + +cli.options += --include-prefix test --guard-prefix TEST \ +--cli-namespace test::cli diff --git a/old-tests/cli/lib/libtest/test/extra/test.cli b/old-tests/cli/lib/libtest/test/extra/test.cli new file mode 100644 index 0000000..8408402 --- /dev/null +++ b/old-tests/cli/lib/libtest/test/extra/test.cli @@ -0,0 +1,11 @@ +namespace test +{ + namespace extra + { + class options + { + bool --help; + bool --version; + }; + } +} diff --git a/old-tests/cli/lib/libtest/test/test.cli b/old-tests/cli/lib/libtest/test/test.cli new file mode 100644 index 0000000..f19d56c --- /dev/null +++ b/old-tests/cli/lib/libtest/test/test.cli @@ -0,0 +1,9 @@ +include ; + +namespace test +{ + class options: base + { + bool --help; + }; +} diff --git a/old-tests/cli/lib/libtest/test/utility.cpp b/old-tests/cli/lib/libtest/test/utility.cpp new file mode 100644 index 0000000..7c59218 --- /dev/null +++ b/old-tests/cli/lib/libtest/test/utility.cpp @@ -0,0 +1,6 @@ +#include + +void +f () +{ +} diff --git a/old-tests/cli/lib/test/build/bootstrap.build b/old-tests/cli/lib/test/build/bootstrap.build new file mode 100644 index 0000000..db43826 --- /dev/null +++ b/old-tests/cli/lib/test/build/bootstrap.build @@ -0,0 +1,3 @@ +project = cli-lib-test +amalgamation = # Disabled. +using config diff --git a/old-tests/cli/lib/test/build/root.build b/old-tests/cli/lib/test/build/root.build new file mode 100644 index 0000000..636fd02 --- /dev/null +++ b/old-tests/cli/lib/test/build/root.build @@ -0,0 +1,7 @@ +using cxx + +hxx{*}: extension = h +ixx{*}: extension = inl +cxx{*}: extension = C + +using cli diff --git a/old-tests/cli/lib/test/buildfile b/old-tests/cli/lib/test/buildfile new file mode 100644 index 0000000..d3e784d --- /dev/null +++ b/old-tests/cli/lib/test/buildfile @@ -0,0 +1,6 @@ +import libs += cli-lib-libtest%lib{test} + +exe{driver}: cxx{driver} cli.cxx{test} $libs +cli.cxx{test}: cli{test} + +cxx.poptions += -I$out_root diff --git a/old-tests/cli/lib/test/driver.C b/old-tests/cli/lib/test/driver.C new file mode 100644 index 0000000..ee2171f --- /dev/null +++ b/old-tests/cli/lib/test/driver.C @@ -0,0 +1,8 @@ +#include "test.h" +#include +#include + +int +main () +{ +} diff --git a/old-tests/cli/lib/test/test.cli b/old-tests/cli/lib/test/test.cli new file mode 100644 index 0000000..db3cfb8 --- /dev/null +++ b/old-tests/cli/lib/test/test.cli @@ -0,0 +1,5 @@ +class options +{ + bool --help; + bool --version; +}; diff --git a/old-tests/cli/simple/build/bootstrap.build b/old-tests/cli/simple/build/bootstrap.build new file mode 100644 index 0000000..2c116c9 --- /dev/null +++ b/old-tests/cli/simple/build/bootstrap.build @@ -0,0 +1,3 @@ +project = cli-simple +amalgamation = # Disabled. +using config diff --git a/old-tests/cli/simple/build/root.build b/old-tests/cli/simple/build/root.build new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/old-tests/cli/simple/build/root.build @@ -0,0 +1 @@ + diff --git a/old-tests/cli/simple/buildfile b/old-tests/cli/simple/buildfile new file mode 100644 index 0000000..47e06d9 --- /dev/null +++ b/old-tests/cli/simple/buildfile @@ -0,0 +1,15 @@ +using cxx + +hxx{*}: extension = +cxx{*}: extension = cpp +ixx{*}: extension = ipp + +cxx.poptions += -I$out_root + +using cli + +exe{driver}: cxx{driver} cxx{test} +cxx{test} hxx{test}: cli{test} + +#exe{driver}: cxx{driver} cli.cxx{test} +#cli.cxx{test}: cli{test} diff --git a/old-tests/cli/simple/driver.cpp b/old-tests/cli/simple/driver.cpp new file mode 100644 index 0000000..ef9cc60 --- /dev/null +++ b/old-tests/cli/simple/driver.cpp @@ -0,0 +1,6 @@ +#include "test" + +int +main () +{ +} diff --git a/old-tests/cli/simple/test.cli b/old-tests/cli/simple/test.cli new file mode 100644 index 0000000..db3cfb8 --- /dev/null +++ b/old-tests/cli/simple/test.cli @@ -0,0 +1,5 @@ +class options +{ + bool --help; + bool --version; +}; diff --git a/old-tests/define/buildfile b/old-tests/define/buildfile new file mode 100644 index 0000000..d85fc57 --- /dev/null +++ b/old-tests/define/buildfile @@ -0,0 +1,14 @@ +#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{BAR}: # verify name is bar{BAR} with --verbose 6 + +./: diff --git a/old-tests/define/buildfile.alias b/old-tests/define/buildfile.alias new file mode 100644 index 0000000..d3b9fc4 --- /dev/null +++ b/old-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" diff --git a/old-tests/depdb/buildfile b/old-tests/depdb/buildfile new file mode 100644 index 0000000..53e9cd3 --- /dev/null +++ b/old-tests/depdb/buildfile @@ -0,0 +1,8 @@ +# file : tests/depdb/buildfile +# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +import libs = libbutl%lib{butl} + +exe{driver}: cxx{driver ../../build2/{depdb}} $libs +exe{driver}: test.arguments = $out_base/test.d diff --git a/old-tests/depdb/driver.cxx b/old-tests/depdb/driver.cxx new file mode 100644 index 0000000..f156991 --- /dev/null +++ b/old-tests/depdb/driver.cxx @@ -0,0 +1,166 @@ +// file : tests/depdb/driver.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include + +#include + +#include +#include + +#include + +using namespace std; +using namespace build2; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " " << endl; + return 1; + } + + path p (argv[1]); + auto rm = [&p] () {try_rmfile (p);}; + + // Create empty database. + // + { + rm (); + + { + depdb d (p); + assert (d.writing ()); + d.close (); + } + + { + depdb d (p); + assert (d.reading ()); + assert (!d.more ()); + assert (d.read () == nullptr); + d.close (); + } + } + + // No close/end marker. + // + { + rm (); + + { + depdb d (p); + assert (d.writing ()); + // No close. + } + + { + depdb d (p); + assert (d.writing ()); + d.close (); + } + + { + depdb d (p); + assert (d.reading ()); + } + } + + // Overwrite/append/truncate. + // + { + rm (); + + { + depdb d (p); + d.write ("foo"); + d.close (); + } + + { + depdb d (p); + assert (*d.read () == "foo"); + assert (!d.more ()); + d.close (); + } + + { + depdb d (p); + assert (*d.read () == "foo"); + assert (!d.more ()); + d.write ("FOO"); + d.close (); + } + + { + depdb d (p); + assert (*d.read () == "FOO"); + assert (!d.more ()); + assert (d.read () == nullptr); + assert (d.read () == nullptr); + d.write ("BAR"); + d.close (); + } + + { + depdb d (p); + assert (*d.read () == "FOO"); + assert (d.more ()); + d.write ("foo"); + d.close (); // Truncate. + } + + { + depdb d (p); + assert (*d.read () == "foo"); + assert (!d.more ()); + } + + // Stray end marker. + // + { + depdb d (p); + assert (*d.read () == "foo"); + d.write ("fox"); + // No close. + } + + { + depdb d (p); + assert (d.more ()); + assert (*d.read () == "fox"); + assert (!d.more ()); + } + } + + // Read/truncate. + // + { + rm (); + + { + depdb d (p); + d.write ("foo"); + d.write ("bar"); + d.close (); + } + + { + depdb d (p); + assert (*d.read () == "foo"); + assert (d.more ()); + d.close (); // Truncate bar. + } + + { + depdb d (p); + assert (*d.read () == "foo"); + assert (!d.more ()); + } + } + + rm (); +} diff --git a/old-tests/dist/simple/README b/old-tests/dist/simple/README new file mode 100644 index 0000000..e69de29 diff --git a/old-tests/dist/simple/bootstrap b/old-tests/dist/simple/bootstrap new file mode 100755 index 0000000..e69de29 diff --git a/old-tests/dist/simple/build/bootstrap.build b/old-tests/dist/simple/build/bootstrap.build new file mode 100644 index 0000000..0cd9015 --- /dev/null +++ b/old-tests/dist/simple/build/bootstrap.build @@ -0,0 +1,9 @@ +project = dist-simple +version = 1.0.0 +amalgamation = # Disabled. +using config +using dist +using test +using install + +dist.package = $project-$version diff --git a/old-tests/dist/simple/build/export.build b/old-tests/dist/simple/build/export.build new file mode 100644 index 0000000..e69de29 diff --git a/old-tests/dist/simple/buildfile b/old-tests/dist/simple/buildfile new file mode 100644 index 0000000..159fff3 --- /dev/null +++ b/old-tests/dist/simple/buildfile @@ -0,0 +1,4 @@ +using cxx + +exe{driver}: cxx{driver} doc{README} file{bootstrap} +exe{driver}: test.output = test.out diff --git a/old-tests/dist/simple/driver.cxx b/old-tests/dist/simple/driver.cxx new file mode 100644 index 0000000..293d7ff --- /dev/null +++ b/old-tests/dist/simple/driver.cxx @@ -0,0 +1,10 @@ +#include + +using namespace std; + +int +main () +{ + cerr << "test is running (stderr)" << endl; + cout << "test is running (stdout)" << endl; +} diff --git a/old-tests/dist/simple/test.out b/old-tests/dist/simple/test.out new file mode 100644 index 0000000..5d63fab --- /dev/null +++ b/old-tests/dist/simple/test.out @@ -0,0 +1 @@ +test is running (stdout) diff --git a/old-tests/escaping/buildfile b/old-tests/escaping/buildfile new file mode 100644 index 0000000..4259087 --- /dev/null +++ b/old-tests/escaping/buildfile @@ -0,0 +1,13 @@ +print \'single\' +print \"double\" + +# Newline is special. +# +\ +print foo\ +bar + +print foo \ +bar + +./: diff --git a/old-tests/escaping/test.out b/old-tests/escaping/test.out new file mode 100644 index 0000000..9894dde --- /dev/null +++ b/old-tests/escaping/test.out @@ -0,0 +1,4 @@ +'single' +"double" +foobar +foo bar diff --git a/old-tests/escaping/test.sh b/old-tests/escaping/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/escaping/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/eval/buildfile b/old-tests/eval/buildfile new file mode 100644 index 0000000..f26a9a0 --- /dev/null +++ b/old-tests/eval/buildfile @@ -0,0 +1,72 @@ +(./): +() + +# Invalid. +# +#(foo +#(foo #comment + +print () +print ((foo)(bar)) +print ((foo) (bar)) + +print (foo\ +bar) + +# !=, == vs !, = recognition +# +print (=) +print (!) +print (= foo) +print (foo!) + +# !=, == evaluation +# + +# print ( == bar) +# print (foo == ) + +print (foo == bar) +print (foo == foo) +print (foo != bar) +print (foo != foo) + +print (foo == (foo)) +print ((foo bar) == foo bar) +print (foo != foo bar) +print ("" == '') + +print ((foo != bar) baz) +print "foo equals bar is (foo == bar)" + +foo = foo +print ($foo == foo) +print (bar != $foo) + +print ([null]) +print (([null])) +print ([uint64] 01) + +n = [null] +print ($n == [null]) +print ($N == [null]) +print ([null] == [null]) + +print ($n == $N == true) + +n = +print ($n == ) +n = {} +print ($n == "") + +#print ([uint64] 01 == [string] 01) + +# <, <=, >, >= evaluation +# +print (a < b) +print (a b > a a) +print (123 <= 123) +print ([uint64] 02 > [uint64] 01) +print (a > [null]) +print ([uint64] 02 > [null]) +print ($build.version > 30000) diff --git a/old-tests/eval/test.out b/old-tests/eval/test.out new file mode 100644 index 0000000..555853f --- /dev/null +++ b/old-tests/eval/test.out @@ -0,0 +1,36 @@ + +foobar +foo bar +foobar += +! += foo +foo! +false +true +true +false +true +true +true +true +true baz +foo equals bar is false +true +true +[null] +[null] +1 +true +true +true +true +true +true +true +true +true +true +true +true +true diff --git a/old-tests/eval/test.sh b/old-tests/eval/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/eval/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/if-else/buildfile b/old-tests/if-else/buildfile new file mode 100644 index 0000000..25fabf0 --- /dev/null +++ b/old-tests/if-else/buildfile @@ -0,0 +1,158 @@ +#else # else without if +#elif # elif without if +#elif! # elif! without if +#if # expected if-expression +#if test # expected true or false +#if true # expected { +#x +#if true # expected newline after { +#{x +#if true # expected newline after } +#{ +#}x + +if true +{ + print 1 +} +else +{ + print 0 +} + +if! true +{ + print 0 +} +else +{ + print 1 +} + +if false +{ + print 0 +} +else +{ + print 1 +} + +if false +{ + print 0 +} +elif true +{ + print 1 +} +else +{ + print 0 +} + +if true +{ + print 1 +} +elif true +{ + print 0 +} +else +{ + print 0 +} + +# Empty block +# +if true +{ +} +else +{ + print 0 +} + +# Nested if-else +# +if true +{ + if true + { + print 1 + } +} +else +{ + if true + { + print 0 + } +} + +t = true +f = false + +if $t +{ + print 1 +} + +if! $f +{ + print 1 +} + +# With eval context. +# +if (foo == foo) +{ + print 1 +} + +if(foo != bar) +{ + print 1 +} + +if!(foo == bar) +{ + print 1 +} + +if ([uint64] 01 == [uint64] 1) +{ + print 1 +} + +# Single line. +# + +#if true +#} # expected if-line + +if true + print 1 + +if false + + print 0 +else + # Comment. + print 1 + +if true + if false + print 0 + else + print 1 + +# EOF test. +# +./: + +if true +{ + print 1 +} diff --git a/old-tests/if-else/test.out b/old-tests/if-else/test.out new file mode 100644 index 0000000..58501cb --- /dev/null +++ b/old-tests/if-else/test.out @@ -0,0 +1,16 @@ +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/old-tests/if-else/test.sh b/old-tests/if-else/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/if-else/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/import/installed/build/bootstrap.build b/old-tests/import/installed/build/bootstrap.build new file mode 100644 index 0000000..2af1e60 --- /dev/null +++ b/old-tests/import/installed/build/bootstrap.build @@ -0,0 +1,4 @@ +project = import-installed +amalgamation = # Disabled. +using config +using test diff --git a/old-tests/import/installed/buildfile b/old-tests/import/installed/buildfile new file mode 100644 index 0000000..ae9d705 --- /dev/null +++ b/old-tests/import/installed/buildfile @@ -0,0 +1,12 @@ +using cxx + +import libs += zlib%lib{z} +import libs += libsqlite3%lib{sqlite3} +import libs += libpq%lib{pq} + +#lib{driver}: cxx{driver} $libs + +exe{driver}: cxx{driver} $libs +exe{driver}: test = true + + diff --git a/old-tests/import/installed/driver.cxx b/old-tests/import/installed/driver.cxx new file mode 100644 index 0000000..70b4146 --- /dev/null +++ b/old-tests/import/installed/driver.cxx @@ -0,0 +1,4 @@ +int +main () +{ +} diff --git a/old-tests/install/lib/libtest/build/bootstrap.build b/old-tests/install/lib/libtest/build/bootstrap.build new file mode 100644 index 0000000..0e83554 --- /dev/null +++ b/old-tests/install/lib/libtest/build/bootstrap.build @@ -0,0 +1,5 @@ +project = install-lib-libtest +amalgamation = # Disabled. +using config +using install +using test diff --git a/old-tests/install/lib/libtest/build/export.build b/old-tests/install/lib/libtest/build/export.build new file mode 100644 index 0000000..e8b12b3 --- /dev/null +++ b/old-tests/install/lib/libtest/build/export.build @@ -0,0 +1,6 @@ +$out_root/: +{ + include test/ +} + +export $out_root/test/lib{test} diff --git a/old-tests/install/lib/libtest/build/root.build b/old-tests/install/lib/libtest/build/root.build new file mode 100644 index 0000000..20536a2 --- /dev/null +++ b/old-tests/install/lib/libtest/build/root.build @@ -0,0 +1,11 @@ +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +cxx{*}: extension = cxx + +tests/: +{ + exe{*}: test = true + install = false +} diff --git a/old-tests/install/lib/libtest/buildfile b/old-tests/install/lib/libtest/buildfile new file mode 100644 index 0000000..32dd3f2 --- /dev/null +++ b/old-tests/install/lib/libtest/buildfile @@ -0,0 +1,3 @@ +d = doc/ test/ tests/ +./: $d +include $d diff --git a/old-tests/install/lib/libtest/doc/buildfile b/old-tests/install/lib/libtest/doc/buildfile new file mode 100644 index 0000000..dfc1701 --- /dev/null +++ b/old-tests/install/lib/libtest/doc/buildfile @@ -0,0 +1 @@ +./: doc{test.txt} man1{test} diff --git a/old-tests/install/lib/libtest/doc/test.1 b/old-tests/install/lib/libtest/doc/test.1 new file mode 100644 index 0000000..0a32f2b --- /dev/null +++ b/old-tests/install/lib/libtest/doc/test.1 @@ -0,0 +1,5 @@ +.TH TEST 1 +.SH NAME +test \- this is a test +.SH SYNOPSIS +.B test-driver diff --git a/old-tests/install/lib/libtest/doc/test.txt b/old-tests/install/lib/libtest/doc/test.txt new file mode 100644 index 0000000..484ba93 --- /dev/null +++ b/old-tests/install/lib/libtest/doc/test.txt @@ -0,0 +1 @@ +This is a test. diff --git a/old-tests/install/lib/libtest/test/buildfile b/old-tests/install/lib/libtest/test/buildfile new file mode 100644 index 0000000..343bc30 --- /dev/null +++ b/old-tests/install/lib/libtest/test/buildfile @@ -0,0 +1,10 @@ +cxx.poptions += -I$src_root + +install.include = $install.include/test/ + +lib{test}: cxx{utility} hxx{utility} +lib{test}: cxx.export.poptions = -I$src_root + +exe{driver}: cxx{driver} hxx{driver} lib{test} + +./: lib{test} exe{driver} diff --git a/old-tests/install/lib/libtest/test/driver.cxx b/old-tests/install/lib/libtest/test/driver.cxx new file mode 100644 index 0000000..fbb6643 --- /dev/null +++ b/old-tests/install/lib/libtest/test/driver.cxx @@ -0,0 +1,4 @@ +#include +#include "driver.hxx" + +int main () {return test::f ();} diff --git a/old-tests/install/lib/libtest/test/driver.hxx b/old-tests/install/lib/libtest/test/driver.hxx new file mode 100644 index 0000000..e69de29 diff --git a/old-tests/install/lib/libtest/test/utility.cxx b/old-tests/install/lib/libtest/test/utility.cxx new file mode 100644 index 0000000..2016b45 --- /dev/null +++ b/old-tests/install/lib/libtest/test/utility.cxx @@ -0,0 +1,6 @@ +#include + +namespace test +{ + int f () {return 0;} +} diff --git a/old-tests/install/lib/libtest/test/utility.hxx b/old-tests/install/lib/libtest/test/utility.hxx new file mode 100644 index 0000000..1a9dd72 --- /dev/null +++ b/old-tests/install/lib/libtest/test/utility.hxx @@ -0,0 +1,5 @@ +namespace test +{ + int f (); +} + diff --git a/old-tests/install/lib/libtest/tests/buildfile b/old-tests/install/lib/libtest/tests/buildfile new file mode 100644 index 0000000..72d549a --- /dev/null +++ b/old-tests/install/lib/libtest/tests/buildfile @@ -0,0 +1,2 @@ +exe{driver}: cxx{driver} ../test/lib{test} +include ../test/ diff --git a/old-tests/install/lib/libtest/tests/driver.cxx b/old-tests/install/lib/libtest/tests/driver.cxx new file mode 100644 index 0000000..9a12f9d --- /dev/null +++ b/old-tests/install/lib/libtest/tests/driver.cxx @@ -0,0 +1,3 @@ +#include + +int main () {return test::f ();} diff --git a/old-tests/install/simple/README b/old-tests/install/simple/README new file mode 100644 index 0000000..484ba93 --- /dev/null +++ b/old-tests/install/simple/README @@ -0,0 +1 @@ +This is a test. diff --git a/old-tests/install/simple/build/bootstrap.build b/old-tests/install/simple/build/bootstrap.build new file mode 100644 index 0000000..40e665b --- /dev/null +++ b/old-tests/install/simple/build/bootstrap.build @@ -0,0 +1,4 @@ +project = install-simple +amalgamation = # Disabled. +using config +using install diff --git a/old-tests/install/simple/buildfile b/old-tests/install/simple/buildfile new file mode 100644 index 0000000..d37f63f --- /dev/null +++ b/old-tests/install/simple/buildfile @@ -0,0 +1,4 @@ +using cxx + +exe{driver}: cxx{driver} hxx{utility} doc{README} +exe{driver}: install = sbin/ diff --git a/old-tests/install/simple/driver.cxx b/old-tests/install/simple/driver.cxx new file mode 100644 index 0000000..1b28c94 --- /dev/null +++ b/old-tests/install/simple/driver.cxx @@ -0,0 +1,3 @@ +#include "utility.hxx" + +int main () {return result;} diff --git a/old-tests/install/simple/utility.hxx b/old-tests/install/simple/utility.hxx new file mode 100644 index 0000000..1b8e18e --- /dev/null +++ b/old-tests/install/simple/utility.hxx @@ -0,0 +1,2 @@ +const int result = 0; + diff --git a/old-tests/keyword/buildfile b/old-tests/keyword/buildfile new file mode 100644 index 0000000..cd91d33 --- /dev/null +++ b/old-tests/keyword/buildfile @@ -0,0 +1,23 @@ +# Quoting. +# +"print" = a +'print' += b +pr"int" += c +print'' += d + +# Not = or +=. +# +print += e + +print $print + +# ( +# +print(test) + +# Separated. +# +define print: file +print{foo}: + +./: diff --git a/old-tests/keyword/test.out b/old-tests/keyword/test.out new file mode 100644 index 0000000..729af10 --- /dev/null +++ b/old-tests/keyword/test.out @@ -0,0 +1,2 @@ +a b c d e +test diff --git a/old-tests/keyword/test.sh b/old-tests/keyword/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/keyword/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/lexer/buildfile b/old-tests/lexer/buildfile new file mode 100644 index 0000000..9a17904 --- /dev/null +++ b/old-tests/lexer/buildfile @@ -0,0 +1,7 @@ +# file : tests/lexer/buildfile +# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +import libs = libbutl%lib{butl} + +exe{driver}: cxx{driver ../../build/{lexer diagnostics utility}} $libs diff --git a/old-tests/lexer/driver.cxx b/old-tests/lexer/driver.cxx new file mode 100644 index 0000000..5575956 --- /dev/null +++ b/old-tests/lexer/driver.cxx @@ -0,0 +1,179 @@ +// file : tests/build/lexer/driver.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; +using namespace build; + +using tokens = vector; + +static tokens +lex (const char*); + +ostream& +operator<< (ostream&, const tokens&); + +int +main () +{ + ostream cnull (nullptr); + diag_stream = &cnull; + + // Whitespaces. + // + assert (lex ("") == tokens ({""})); + assert (lex ("\n") == tokens ({""})); + assert (lex ("\n\n") == tokens ({""})); + assert (lex (" \t \n") == tokens ({""})); + assert (lex ("#comment") == tokens ({""})); + assert (lex (" #comment") == tokens ({""})); + assert (lex ("#comment\n") == tokens ({""})); + assert (lex ("#comment\\\n") == tokens ({""})); + assert (lex ("#comment 1\n#comment2") == tokens ({""})); + + // Punctuation. + // + assert (lex (": \n { }") == tokens ({":", "\n", "{", "}", ""})); + + // Names. + // + assert (lex ("foo") == tokens ({"foo", ""})); + assert (lex ("foo.bar") == tokens ({"foo.bar", ""})); + + // Escaping. + // + assert (lex (" \\\n") == tokens ({""})); + assert (lex ("\\\nfoo") == tokens ({"foo", ""})); + assert (lex (" \\ foo") == tokens ({" foo", ""})); + assert (lex ("fo\\ o\\:") == tokens ({"fo o:", ""})); + assert (lex ("foo\\\nbar") == tokens ({"foobar", ""})); + assert (lex ("foo \\\nbar") == tokens ({"foo", "bar", ""})); + assert (lex ("\\'foo") == tokens ({"'foo", ""})); + + assert (lex (" \\") == tokens ({""})); + assert (lex (" foo\\") == tokens ({""})); + + + // Quoting ''. + // + assert (lex ("''") == tokens ({"", ""})); + assert (lex ("'foo'") == tokens ({"foo", ""})); + assert (lex ("'foo bar'") == tokens ({"foo bar", ""})); + assert (lex ("'foo 'bar") == tokens ({"foo bar", ""})); + assert (lex ("foo' bar'") == tokens ({"foo bar", ""})); + assert (lex ("'foo ''bar'") == tokens ({"foo bar", ""})); + assert (lex ("foo' 'bar") == tokens ({"foo bar", ""})); + assert (lex ("'foo\nbar'") == tokens ({"foo\nbar", ""})); + assert (lex ("'#:${}()=+\n'") == tokens ({"#:${}()=+\n", ""})); + assert (lex ("'\"'") == tokens ({"\"", ""})); + assert (lex ("'\\'") == tokens ({"\\", ""})); + + assert (lex ("'foo bar") == tokens ({""})); + + // Quoting "". + // + assert (lex ("\"\"") == tokens ({"", ""})); + assert (lex ("\"foo\"") == tokens ({"foo", ""})); + assert (lex ("\"foo bar\"") == tokens ({"foo bar", ""})); + assert (lex ("\"foo \"bar") == tokens ({"foo bar", ""})); + assert (lex ("foo\" bar\"") == tokens ({"foo bar", ""})); + assert (lex ("\"foo \"\"bar\"") == tokens ({"foo bar", ""})); + assert (lex ("foo\" \"bar") == tokens ({"foo bar", ""})); + assert (lex ("\"foo\nbar\"") == tokens ({"foo\nbar", ""})); + assert (lex ("\"#:{})=+\n\"") == tokens ({"#:{})=+\n", ""})); + assert (lex ("\"'\"") == tokens ({"'", ""})); + assert (lex ("\"\\\"") == tokens ({"\\", ""})); + + assert (lex ("\"$\"") == tokens ({"", "$", "", ""})); + assert (lex ("\"foo$bar\"") == tokens ({"foo", "$", "bar", ""})); + assert (lex ("foo\"$\"bar") == tokens ({"foo", "$", "bar", ""})); + assert (lex ("f\"oo$ba\"r") == tokens ({"foo", "$", "bar", ""})); + + assert (lex ("\"foo bar") == tokens ({""})); + assert (lex ("\"foo $") == tokens ({"foo ", "$", ""})); + assert (lex ("\"foo $bar") == tokens ({"foo ", "$", ""})); + + // Combinations. + // + assert (lex ("foo: bar") == tokens ({"foo", ":", "bar", ""})); + assert (lex ("\n \nfoo: bar") == tokens ({"foo", ":", "bar", ""})); + assert (lex ("foo: bar\n") == tokens ({"foo", ":", "bar", "\n", ""})); + assert (lex ("foo: bar#comment") == tokens ({"foo", ":", "bar", ""})); + assert (lex ("exe{foo}: obj{bar}") == + tokens ({"exe", "{", "foo", "}", ":", "obj", "{", "bar", "}", ""})); + assert (lex ("foo: bar\nbaz: biz") == + tokens ({"foo", ":", "bar", "\n", "baz", ":", "biz", ""})); + assert (lex ("foo: bar#comment\nbaz: biz") == + tokens ({"foo", ":", "bar", "\n", "baz", ":", "biz", ""})); + assert (lex ("foo:#comment \\\nbar") == + tokens ({"foo", ":", "\n", "bar", ""})); +} + +static tokens +lex (const char* s) +{ + tokens r; + istringstream is (s); + + is.exceptions (istream::failbit | istream::badbit); + lexer l (is, ""); + + try + { + for (token t (l.next ());; t = l.next ()) + { + string v; + + switch (t.type) + { + case token_type::eos: v = ""; break; + case token_type::newline: v = "\n"; break; + case token_type::pair_separator: v = l.pair_separator (); break; + case token_type::colon: v = ":"; break; + case token_type::lcbrace: v = "{"; break; + case token_type::rcbrace: v = "}"; break; + case token_type::equal: v = "="; break; + case token_type::plus_equal: v = "+="; break; + case token_type::dollar: v = "$"; break; + case token_type::lparen: v = "("; break; + case token_type::rparen: v = ")"; break; + case token_type::name: v = t.value.c_str (); break; + } + + // cerr << t.line () << ':' << t.column () << ':' << v << endl; + + r.push_back (move (v)); + + if (t.type == token_type::eos) + break; + } + } + catch (const failed&) + { + r.push_back (""); + } + catch (const io_error&) + { + r.push_back (""); + } + + return r; +} + +ostream& +operator<< (ostream& os, const tokens& ts) +{ + for (const string& t: ts) + os << '"' << t << '"' << ' '; + + return os; +} diff --git a/old-tests/names/buildfile b/old-tests/names/buildfile new file mode 100644 index 0000000..0f3d482 --- /dev/null +++ b/old-tests/names/buildfile @@ -0,0 +1,54 @@ +# Name separation. +# +print foo {bar baz} +print fox/ {bar baz} +print fox/foo {bar baz} + +# Name "crosses". +# +print {}{bar} # Same as bar. +print {foo}{} # Same as foo{} (empty name of type foo). +print foo{} # For compatiron. +print {foo}{bar} +print {foo}{bar baz} +print {foo fox}{bar} +print {foo fox}{bar baz} + +print dir/{}{bar} # Same as dir/bar. +print dir/{foo}{} # Same as dir/foo{} (directory of type foo). +print dir/foo{} # For comparison. +print dir/{foo}{bar} +print dir/{foo}{bar baz} +print dir/{foo fox}{bar} +print dir/{foo fox}{bar baz} + +print {dir/}{bar} +print {dir/}{bar baz} +print {dir/ dor/}{bar} +print {dir/ dor/}{bar baz} + +print {dir/foo}{bar} +print {dir/foo}{bar baz} +print {dir/foo dor/fox}{bar} +print {dir/foo dor/fox}{bar baz} + +print {dir/}{foo}{bar} +print {dir/}{foo}{bar baz} +print {dir/ dor/}{foo}{bar} +print {dir/ dor/}{foo fox}{bar baz} + +print {prj%foo}{bar baz} +print {foo}{bar prj%baz} +#print {prj%foo}{bar prk%baz} # nested project name + +print dir/{foo}{bar baz} +print {foo}{bar dir/{baz}} +print dir/{foo}{bar dor/{baz}} + +print {dir/foo{}}{bar} +print {dir/{foo}}{bar} +print {dir/}{foo{bar}} +#print {dir/foo{fox}}{bar} # nested type name +#print {dir/foo}{fox{bar}} # nested type name + +./: diff --git a/old-tests/names/test.out b/old-tests/names/test.out new file mode 100644 index 0000000..280c372 --- /dev/null +++ b/old-tests/names/test.out @@ -0,0 +1,37 @@ +foo bar baz +fox/ bar baz +fox/foo bar baz +bar +foo{} +foo{} +foo{bar} +foo{bar} foo{baz} +foo{bar} fox{bar} +foo{bar} fox{bar} foo{baz} fox{baz} +dir/bar +foo{dir/} +foo{dir/} +dir/foo{bar} +dir/foo{bar} dir/foo{baz} +dir/foo{bar} dir/fox{bar} +dir/foo{bar} dir/fox{bar} dir/foo{baz} dir/fox{baz} +dir/bar +dir/bar dir/baz +dir/bar dor/bar +dir/bar dor/bar dir/baz dor/baz +dir/foo{bar} +dir/foo{bar} dir/foo{baz} +dir/foo{bar} dor/fox{bar} +dir/foo{bar} dor/fox{bar} dir/foo{baz} dor/fox{baz} +dir/foo{bar} +dir/foo{bar} dir/foo{baz} +dir/foo{bar} dor/foo{bar} +dir/foo{bar} dor/foo{bar} dir/fox{bar} dor/fox{bar} dir/foo{baz} dor/foo{baz} dir/fox{baz} dor/fox{baz} +prj%foo{bar} prj%foo{baz} +foo{bar} prj%foo{baz} +dir/foo{bar} dir/foo{baz} +foo{bar} dir/foo{baz} +dir/foo{bar} dir/dor/foo{baz} +dir/foo{bar} +dir/foo{bar} +dir/foo{bar} diff --git a/old-tests/names/test.sh b/old-tests/names/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/names/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/pairs/buildfile b/old-tests/pairs/buildfile new file mode 100644 index 0000000..3b55044 --- /dev/null +++ b/old-tests/pairs/buildfile @@ -0,0 +1,40 @@ +print foo@bar # foo@bar +print foo@{bar} # foo@bar +print {foo}@bar # foo@bar +print {foo@bar} # foo@bar +print {{foo}@{bar}} # foo@bar +print "{foo}@bar" # {foo}@bar + +print foo@ # foo@{} +print {foo}@ # foo@{} +print {foo}@{} # foo@{} +print {foo}@ {FOO}@ # foo@{} FOO@{} +v=foo@ +print $v # foo@{} + +print @bar # {}@bar +print @{bar} # {}@bar +print {}@{bar} # {}@bar +print @{BAR} @{bar} # {}@BAR {}@bar +v=@bar +print $v # {}@bar + +print @ # {}@{} +print @{} # {}@{} +print {}@ # {}@{} +print {}@{} # {}@{} +print {@} # {}@{} +v=@ +print $v # {}@{} + +print @ @ # {}@{} {}@{} +v=@ @ +print $v # {}@{} {}@{} + +print @{bar BAR} # {}@bar {}@BAR +print @{bar {BAR}} # {}@bar {}@BAR +print foo@{bar BAR} # foo@bar foo@BAR + +#print @@ # error: double pair separator + +./: diff --git a/old-tests/pairs/test.out b/old-tests/pairs/test.out new file mode 100644 index 0000000..6033c84 --- /dev/null +++ b/old-tests/pairs/test.out @@ -0,0 +1,27 @@ +foo@bar +foo@bar +foo@bar +foo@bar +foo@bar +{foo}@bar +foo@{} +foo@{} +foo@{} +foo@{} FOO@{} +foo@{} +{}@bar +{}@bar +{}@bar +{}@BAR {}@bar +{}@bar +{}@{} +{}@{} +{}@{} +{}@{} +{}@{} +{}@{} +{}@{} {}@{} +{}@{} {}@{} +{}@bar {}@BAR +{}@bar {}@BAR +foo@bar foo@BAR diff --git a/old-tests/pairs/test.sh b/old-tests/pairs/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/pairs/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/parser/buildfile b/old-tests/parser/buildfile new file mode 100644 index 0000000..ec158fa --- /dev/null +++ b/old-tests/parser/buildfile @@ -0,0 +1,9 @@ +# file : tests/parser/buildfile +# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +import libs = libbutl%lib{butl} + +exe{driver}: cxx{driver ../../build/{token lexer parser scope target \ + prerequisite variable operation rule search algorithm file module dump \ + context diagnostics name path-io utility}} $libs diff --git a/old-tests/parser/driver.cxx b/old-tests/parser/driver.cxx new file mode 100644 index 0000000..7c73937 --- /dev/null +++ b/old-tests/parser/driver.cxx @@ -0,0 +1,195 @@ +// file : tests/build/parser/driver.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; +using namespace build; + +static bool +parse (const char*); + +static names +parse_names (const char* s, lexer_mode m, bool chunk); + +static names +chunk_names (const char* s) +{ + return parse_names (s, lexer_mode::pairs, true); +} + +int +main () +{ + ostream cnull (nullptr); + diag_stream = &cnull; + + reset (); + + global_scope->assign ("foo") = "FOO"; + global_scope->assign ("bar") = "BAR"; + + // names() in chunking mode. + // + assert (chunk_names ("{}") == names ({name ()})); + assert (chunk_names ("foo") == names ({name ("foo")})); + assert (chunk_names ("foo bar") == names ({name ("foo")})); + assert (chunk_names ("{foo bar}") == names ({name ("foo"), name ("bar")})); + assert (chunk_names ("dir{foo bar}") == names ({name ("dir", "foo"), + name ("dir", "bar")})); + assert (chunk_names ("dir{foo bar} baz") == names ({name ("dir", "foo"), + name ("dir", "bar")})); + assert (chunk_names ("dir {foo bar}") == names ({name ("dir", "foo"), + name ("dir", "bar")})); + assert (chunk_names ("dir {foo bar} baz") == names ({name ("dir", "foo"), + name ("dir", "bar")})); + assert (chunk_names ("{} foo") == names ({name ()})); + + // Expansion. + // + assert (chunk_names ("$foo $bar baz") == names ({name ("FOO")})); + assert (chunk_names ("$foo$bar baz") == names ({name ("FOOBAR")})); + + assert (chunk_names ("foo(bar)") == names ({name ("foobar")})); + assert (chunk_names ("foo (bar)") == names ({name ("foo")})); + + assert (chunk_names ("\"$foo\"(bar)") == names ({name ("FOObar")})); + assert (chunk_names ("\"$foo\" (bar)") == names ({name ("FOO")})); + + // Quoting. + // + assert (chunk_names ("\"$foo $bar\" baz") == names ({name ("FOO BAR")})); + + // Pairs. + // + assert (chunk_names ("foo=bar") == names ({name ("foo"), name ("bar")})); + assert (chunk_names ("foo = bar x") == names ({name ("foo"), name ("bar")})); + + // General. + // + assert (parse ("")); + assert (parse ("foo:")); + assert (parse ("foo bar:")); + assert (parse ("foo:\nbar:")); + assert (parse ("foo: bar")); + assert (parse ("foo: bar baz")); + assert (parse ("foo bar: baz biz")); + + assert (parse ("{foo}:")); + assert (parse ("{foo bar}:")); + assert (parse ("{{foo bar}}:")); + assert (parse ("{{foo bar} {baz} {biz fox} fix}:")); + + assert (parse ("file{foo}:")); + assert (parse ("file{foo bar}:")); + assert (parse ("{file{foo bar}}:")); + assert (parse ("file{{foo bar} fox}:")); + assert (parse ("file{foo}: file{bar baz} biz.o file{fox}")); + + //assert (!parse (":")); + assert (!parse ("foo")); + assert (!parse ("{")); + assert (!parse ("{foo:")); + assert (!parse ("{foo{:")); + assert (!parse ("foo: bar:")); + assert (!parse ("file{foo:")); + + // Directory prefix. + // + assert (parse ("../{foo}: ../{bar}")); + assert (parse ("../file{foo}: ../file{bar}")); + assert (!parse ("../file{file{foo}}:")); + + // Directory scope. + // + assert (parse ("test/:\n{\n}")); + assert (parse ("test/:\n{\n}\n")); + assert (parse ("test/:\n{\nfoo:bar\n}")); + assert (parse ("test/:\n{\nfoo:bar\n}")); + assert (parse ("test/:\n{\nmore/:\n{\n}\n}")); + assert (parse ("test/:\n{\nmore/:\n{\nfoo:{bar baz}\n}\n}")); + + assert (!parse ("test/:\n{")); + assert (!parse ("test/:\n{\n")); + assert (!parse ("test/:\n{\n:")); + assert (!parse ("test/:\n{\n} foo: bar\n")); + assert (!parse ("test/ foo:\n{\n}")); + assert (!parse ("test foo/:\n{\n}")); + assert (!parse ("test/ foo/:\n{\n}")); +} + +struct test_parser: parser +{ + names_type + test_names (const char*, lexer_mode, bool chunk); +}; + +static bool +parse (const char* s) +{ + reset (); // Clear the state. + + // Create a minimal root scope. + // + auto i (scopes.insert (path::current (), nullptr, true, true)); + scope& root (*i->second); + root.src_path_ = root.out_path_ = &i->first; + + istringstream is (s); + + is.exceptions (istream::failbit | istream::badbit); + parser p; + + try + { + p.parse_buildfile (is, path (), root, root); + } + catch (const failed&) + { + return false; + } + + return true; +} + +// parser::names() +// +names test_parser:: +test_names (const char* s, lexer_mode m, bool chunk) +{ + istringstream is (s); + is.exceptions (istream::failbit | istream::badbit); + lexer l (is, ""); + + if (m != lexer_mode::normal) + l.mode (m, '='); + + path_ = &l.name (); + lexer_ = &l; + target_ = nullptr; + scope_ = root_ = global_scope; + + token t (token_type::eos, false, 0, 0); + token_type tt; + next (t, tt); + return names (t, tt, chunk); +} + +static names +parse_names (const char* s, lexer_mode m, bool chunk) +{ + test_parser p; + return p.test_names (s, m, chunk); +} diff --git a/old-tests/postponed/build/bootstrap.build b/old-tests/postponed/build/bootstrap.build new file mode 100644 index 0000000..42ba33a --- /dev/null +++ b/old-tests/postponed/build/bootstrap.build @@ -0,0 +1,3 @@ +project = postponed +amalgamation = # Disabled. +using config diff --git a/old-tests/postponed/buildfile b/old-tests/postponed/buildfile new file mode 100644 index 0000000..53873aa --- /dev/null +++ b/old-tests/postponed/buildfile @@ -0,0 +1,5 @@ +using cxx + +exe{driver}: cxx{driver} fsdir{$out_root/out} + +./: exe{driver} diff --git a/old-tests/postponed/driver.cxx b/old-tests/postponed/driver.cxx new file mode 100644 index 0000000..70b4146 --- /dev/null +++ b/old-tests/postponed/driver.cxx @@ -0,0 +1,4 @@ +int +main () +{ +} diff --git a/old-tests/postponed/out/dummy b/old-tests/postponed/out/dummy new file mode 100644 index 0000000..e69de29 diff --git a/old-tests/quote/buildfile b/old-tests/quote/buildfile new file mode 100644 index 0000000..e8951b5 --- /dev/null +++ b/old-tests/quote/buildfile @@ -0,0 +1,51 @@ +print "foo bar" +print "foo +bar" + +foo = "fo o" +bar = " bar " + +print "$foo" +print "$bar" +print "$foo $bar" +print "$foo$bar" + +print "[ $foo ]" +print "[ $bar ]" +print "[ $foo $bar ]" +print "[ $foo/$bar ]" + +print $foo'bar' +print $foo"$bar" +print "$foo"bar + +# Quoting and evaluation context. +# +print ("x{foo bar}") +#print "(x{foo bar})" # multiple values in concatenating context expansion +print "({foo})" +print "('foo bar')" +print "("foo bar")" +print "("$foo bar")" +print "("$foo ($bar)")" + +# Quoting and escaping/multiline. +# +print \ +"foo"\ +"bar" + +print \ +"foo\ +bar" + +print \ +'foo\ +bar' + +print \ +"foo (fox \ +) +bar" + +./: diff --git a/old-tests/quote/test.out b/old-tests/quote/test.out new file mode 100644 index 0000000..33450a5 --- /dev/null +++ b/old-tests/quote/test.out @@ -0,0 +1,26 @@ +foo bar +foo +bar +fo o + bar +fo o bar +fo o bar +[ fo o ] +[ bar ] +[ fo o bar ] +[ fo o/ bar ] +fo obar +fo o bar +fo obar +x{foo bar} +foo +foo bar +foo bar +fo o bar +fo o bar +foobar +foobar +foo\ +bar +foo fox +bar diff --git a/old-tests/quote/test.sh b/old-tests/quote/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/quote/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/scope/amalgamation/build/bootstrap.build b/old-tests/scope/amalgamation/build/bootstrap.build new file mode 100644 index 0000000..ee73365 --- /dev/null +++ b/old-tests/scope/amalgamation/build/bootstrap.build @@ -0,0 +1,3 @@ +project = scope-amalgamation +amalgamation = # Disabled. +using config diff --git a/old-tests/scope/amalgamation/buildfile b/old-tests/scope/amalgamation/buildfile new file mode 100644 index 0000000..9f80de9 --- /dev/null +++ b/old-tests/scope/amalgamation/buildfile @@ -0,0 +1 @@ +./: diff --git a/old-tests/scope/amalgamation/l1/build/bootstrap.build b/old-tests/scope/amalgamation/l1/build/bootstrap.build new file mode 100644 index 0000000..6bde838 --- /dev/null +++ b/old-tests/scope/amalgamation/l1/build/bootstrap.build @@ -0,0 +1,16 @@ +project = scope-amalgamation-l1 +using config + +# At this stage we don't know ../ is a project. This +# tests an out-of-project scope that will later be +# replaced with an in-project scope. Note that the +# replacement will only occur if src_root != out_root. +# If they are the same, then this scope will simply +# be "upgraded". +# +$src_root/../: +{ + print 0: $project + print 0: $src_base + print 0: $out_base +} diff --git a/old-tests/scope/amalgamation/l1/buildfile b/old-tests/scope/amalgamation/l1/buildfile new file mode 100644 index 0000000..55d8c64 --- /dev/null +++ b/old-tests/scope/amalgamation/l1/buildfile @@ -0,0 +1,37 @@ +# Out of amalgamation. +# +../../: +{ + print -1: $project + print -1: $src_base + print -1: $out_base +} + +# In amalgamation. +# +../s/: +{ + print 0: $project + print 0: $src_base + print 0: $out_base +} + +# In project. +# +s/: +{ + print 1: $project + print 1: $src_base + print 1: $out_base +} + +# In sub-project. +# +l2/s/: +{ + print 2: $project + print 2: $src_base + print 2: $out_base +} + +./: diff --git a/old-tests/scope/amalgamation/l1/l2/build/bootstrap.build b/old-tests/scope/amalgamation/l1/l2/build/bootstrap.build new file mode 100644 index 0000000..0262763 --- /dev/null +++ b/old-tests/scope/amalgamation/l1/l2/build/bootstrap.build @@ -0,0 +1,2 @@ +project = scope-amalgamation-l2 +using config diff --git a/old-tests/scope/test-1.out b/old-tests/scope/test-1.out new file mode 100644 index 0000000..0273bf1 --- /dev/null +++ b/old-tests/scope/test-1.out @@ -0,0 +1,15 @@ +0: +0: +0: +-1: +-1: +-1: +0: scope-amalgamation +0: /home/boris/work/build2/build2/tests/scope/amalgamation/s/ +0: /home/boris/work/build2/build2/tests/scope/amalgamation/s/ +1: scope-amalgamation-l1 +1: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/s/ +1: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/s/ +2: scope-amalgamation-l2 +2: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/l2/s/ +2: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/l2/s/ diff --git a/old-tests/scope/test-2.out b/old-tests/scope/test-2.out new file mode 100644 index 0000000..88f9620 --- /dev/null +++ b/old-tests/scope/test-2.out @@ -0,0 +1,15 @@ +0: +0: +0: +-1: +-1: +-1: +0: scope-amalgamation +0: /home/boris/work/build2/build2/tests/scope/amalgamation/s/ +0: /home/boris/work/build2/build2/tests/scope/a-out/s/ +1: scope-amalgamation-l1 +1: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/s/ +1: /home/boris/work/build2/build2/tests/scope/a-out/l1/s/ +2: scope-amalgamation-l2 +2: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/l2/s/ +2: /home/boris/work/build2/build2/tests/scope/a-out/l1/l2/s/ diff --git a/old-tests/scope/test.sh b/old-tests/scope/test.sh new file mode 100755 index 0000000..2728a9d --- /dev/null +++ b/old-tests/scope/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# In-tree. +# +b amalgamation/l1/ 2>/dev/null | diff --strip-trailing-cr -u test-1.out - + +# Out-of-tree. +# +rm -rf a-out/ +b 'configure(amalgamation/@a-out/)' 2>/dev/null + +b amalgamation/l1/@a-out/l1/ 2>/dev/null | \ + diff --strip-trailing-cr -u test-2.out - + +rm -rf a-out/ diff --git a/old-tests/semantics/include/buildfile b/old-tests/semantics/include/buildfile new file mode 120000 index 0000000..361dcf4 --- /dev/null +++ b/old-tests/semantics/include/buildfile @@ -0,0 +1 @@ +includer \ No newline at end of file diff --git a/old-tests/semantics/include/includee1 b/old-tests/semantics/include/includee1 new file mode 100644 index 0000000..70ed3fc --- /dev/null +++ b/old-tests/semantics/include/includee1 @@ -0,0 +1 @@ +print includee1 \ No newline at end of file diff --git a/old-tests/semantics/include/includee2 b/old-tests/semantics/include/includee2 new file mode 100644 index 0000000..762825b --- /dev/null +++ b/old-tests/semantics/include/includee2 @@ -0,0 +1 @@ +print includee2 diff --git a/old-tests/semantics/include/includee4 b/old-tests/semantics/include/includee4 new file mode 100644 index 0000000..4964d81 --- /dev/null +++ b/old-tests/semantics/include/includee4 @@ -0,0 +1 @@ +print includee4 diff --git a/old-tests/semantics/include/includer b/old-tests/semantics/include/includer new file mode 100644 index 0000000..70527a5 --- /dev/null +++ b/old-tests/semantics/include/includer @@ -0,0 +1,10 @@ +include +include includee1 +include includee1 ../include/includee2 # includee1 is skipped +include nested/includee3 +nested/: +{ + include includee5 + include ../includee2 # skipped +} +: diff --git a/old-tests/semantics/include/nested/includee3 b/old-tests/semantics/include/nested/includee3 new file mode 100644 index 0000000..7196e82 --- /dev/null +++ b/old-tests/semantics/include/nested/includee3 @@ -0,0 +1,2 @@ +print nested/includee3 +include ../includee4 diff --git a/old-tests/semantics/include/nested/includee5 b/old-tests/semantics/include/nested/includee5 new file mode 100644 index 0000000..b4c9c74 --- /dev/null +++ b/old-tests/semantics/include/nested/includee5 @@ -0,0 +1 @@ +print nested/includee5 diff --git a/old-tests/semantics/include/test.std b/old-tests/semantics/include/test.std new file mode 100644 index 0000000..559584c --- /dev/null +++ b/old-tests/semantics/include/test.std @@ -0,0 +1,5 @@ +includee1 +includee2 +nested/includee3 +includee4 +nested/includee5 diff --git a/old-tests/semantics/source/buildfile b/old-tests/semantics/source/buildfile new file mode 120000 index 0000000..b6d1987 --- /dev/null +++ b/old-tests/semantics/source/buildfile @@ -0,0 +1 @@ +sourcer \ No newline at end of file diff --git a/old-tests/semantics/source/nested/sourcee3 b/old-tests/semantics/source/nested/sourcee3 new file mode 100644 index 0000000..cdf51fb --- /dev/null +++ b/old-tests/semantics/source/nested/sourcee3 @@ -0,0 +1 @@ +print nested/sourcee3 \ No newline at end of file diff --git a/old-tests/semantics/source/sourcee1 b/old-tests/semantics/source/sourcee1 new file mode 100644 index 0000000..683cd1f --- /dev/null +++ b/old-tests/semantics/source/sourcee1 @@ -0,0 +1 @@ +print sourcee1 \ No newline at end of file diff --git a/old-tests/semantics/source/sourcee2 b/old-tests/semantics/source/sourcee2 new file mode 100644 index 0000000..c989838 --- /dev/null +++ b/old-tests/semantics/source/sourcee2 @@ -0,0 +1 @@ +print sourcee2 diff --git a/old-tests/semantics/source/sourcer b/old-tests/semantics/source/sourcer new file mode 100644 index 0000000..eb1310e --- /dev/null +++ b/old-tests/semantics/source/sourcer @@ -0,0 +1,9 @@ +source +source sourcee1 +source sourcee1 ../source/sourcee2 +nested/: +{ + source sourcee3 + source ../sourcee1 +} +: diff --git a/old-tests/semantics/source/test.std b/old-tests/semantics/source/test.std new file mode 100644 index 0000000..84d94b7 --- /dev/null +++ b/old-tests/semantics/source/test.std @@ -0,0 +1,5 @@ +sourcee1 +sourcee1 +sourcee2 +nested/sourcee3 +sourcee1 diff --git a/old-tests/simple/build/bootstrap.build b/old-tests/simple/build/bootstrap.build new file mode 100644 index 0000000..7ee30cb --- /dev/null +++ b/old-tests/simple/build/bootstrap.build @@ -0,0 +1,3 @@ +project = simple +amalgamation = # Disabled. +using config diff --git a/old-tests/simple/buildfile b/old-tests/simple/buildfile new file mode 100644 index 0000000..ea1d8fa --- /dev/null +++ b/old-tests/simple/buildfile @@ -0,0 +1,3 @@ +using cxx + +exe{driver}: cxx{driver} diff --git a/old-tests/simple/driver.cxx b/old-tests/simple/driver.cxx new file mode 100644 index 0000000..5b076c7 --- /dev/null +++ b/old-tests/simple/driver.cxx @@ -0,0 +1,8 @@ +#include + +using namespace std; + +int +main () +{ +} diff --git a/old-tests/target/out-qualified/src/build/bootstrap.build b/old-tests/target/out-qualified/src/build/bootstrap.build new file mode 100644 index 0000000..056ee6f --- /dev/null +++ b/old-tests/target/out-qualified/src/build/bootstrap.build @@ -0,0 +1,2 @@ +project = test +amalgamation = diff --git a/old-tests/target/out-qualified/src/buildfile b/old-tests/target/out-qualified/src/buildfile new file mode 100644 index 0000000..1bcaa32 --- /dev/null +++ b/old-tests/target/out-qualified/src/buildfile @@ -0,0 +1,5 @@ +./: file{foo} + +# Use --verbose 6 to debug. +# +file{foo}@./: x = y diff --git a/old-tests/target/out-qualified/src/foo b/old-tests/target/out-qualified/src/foo new file mode 100644 index 0000000..e69de29 diff --git a/old-tests/target/out-qualified/test.sh b/old-tests/target/out-qualified/test.sh new file mode 100755 index 0000000..f1ece0e --- /dev/null +++ b/old-tests/target/out-qualified/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q src/@out/ diff --git a/old-tests/test.sh b/old-tests/test.sh new file mode 100755 index 0000000..de93322 --- /dev/null +++ b/old-tests/test.sh @@ -0,0 +1,33 @@ +#! /usr/bin/env bash + +cur_dir="`pwd`" +trap 'cd "$cur_dir"' EXIT + +export PATH=$cur_dir/../build2:$PATH + +function test () +{ + echo "testing $1" + cd "$cur_dir/$1" + ./test.sh +} + +test "amalgam/unnamed" +test "escaping" +test "eval" +test "if-else" +test "keyword" +test "names" +test "pairs" +test "quote" +test "scope" +test "target/out-qualified" +test "variable/dir-path" +test "variable/expansion" +test "variable/null" +test "variable/override" +test "variable/prepend" +test "variable/qualified" +test "variable/representation" +test "variable/type" +test "variable/type-pattern-append" diff --git a/old-tests/test/generated/build/bootstrap.build b/old-tests/test/generated/build/bootstrap.build new file mode 100644 index 0000000..5428eb8 --- /dev/null +++ b/old-tests/test/generated/build/bootstrap.build @@ -0,0 +1,4 @@ +project = test-generated +amalgamation = # Disabled. +using config +using test diff --git a/old-tests/test/generated/buildfile b/old-tests/test/generated/buildfile new file mode 100644 index 0000000..aacca8b --- /dev/null +++ b/old-tests/test/generated/buildfile @@ -0,0 +1,9 @@ +# Test generated input. +# +using cxx + +exe{utility}: cxx{utility} +exe{driver}: cxx{driver} +exe{driver}: test.input = exe{utility} + +./: exe{driver} diff --git a/old-tests/test/generated/driver.cxx b/old-tests/test/generated/driver.cxx new file mode 100644 index 0000000..008dbf7 --- /dev/null +++ b/old-tests/test/generated/driver.cxx @@ -0,0 +1,24 @@ +#include +#include + +using namespace std; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " " << endl; + return 1; + } + + ifstream ifs (argv[1], ifstream::in | ifstream::binary | ifstream::ate); + + if (!ifs.is_open ()) + cerr << "unable to open " << argv[1] << endl; + + if (ifs.tellg () == 0) + cerr << argv[1] << " is empty" << endl; + + return 0; +} diff --git a/old-tests/test/generated/utility.cxx b/old-tests/test/generated/utility.cxx new file mode 100644 index 0000000..ca2ac4a --- /dev/null +++ b/old-tests/test/generated/utility.cxx @@ -0,0 +1 @@ +int main () {} diff --git a/old-tests/test/simple/build/bootstrap.build b/old-tests/test/simple/build/bootstrap.build new file mode 100644 index 0000000..0b7a347 --- /dev/null +++ b/old-tests/test/simple/build/bootstrap.build @@ -0,0 +1,4 @@ +project = test-simple +amalgamation = # Disabled. +using config +using test diff --git a/old-tests/test/simple/buildfile b/old-tests/test/simple/buildfile new file mode 100644 index 0000000..569c12c --- /dev/null +++ b/old-tests/test/simple/buildfile @@ -0,0 +1,12 @@ +using cxx + +lib{utility}: cxx{utility} +exe{driver}: cxx{driver} #lib{utility} + +#exe{driver}: test.roundtrip = test.out + +exe{*}: test = true +exe{*}: test.output = test.out + +./: lib{utility} exe{driver} +#./: exe{driver} diff --git a/old-tests/test/simple/driver.cxx b/old-tests/test/simple/driver.cxx new file mode 100644 index 0000000..3753821 --- /dev/null +++ b/old-tests/test/simple/driver.cxx @@ -0,0 +1,14 @@ +#include +#include + +using namespace std; + +int +main () +{ + cerr << "test is running (stderr)" << endl; + //assert (false); + cout << "test is running (stdout)" << endl; + return 0; + //return 1; +} diff --git a/old-tests/test/simple/test.out b/old-tests/test/simple/test.out new file mode 100644 index 0000000..5d63fab --- /dev/null +++ b/old-tests/test/simple/test.out @@ -0,0 +1 @@ +test is running (stdout) diff --git a/old-tests/test/simple/utility.cxx b/old-tests/test/simple/utility.cxx new file mode 100644 index 0000000..c4bb446 --- /dev/null +++ b/old-tests/test/simple/utility.cxx @@ -0,0 +1 @@ +void f (){} diff --git a/old-tests/using/buildfile b/old-tests/using/buildfile new file mode 100644 index 0000000..86baa42 --- /dev/null +++ b/old-tests/using/buildfile @@ -0,0 +1,5 @@ +using? foo +print $foo.loaded +print $foo.configured + +./: diff --git a/old-tests/variable/dir-path/buildfile b/old-tests/variable/dir-path/buildfile new file mode 100644 index 0000000..5c99f07 --- /dev/null +++ b/old-tests/variable/dir-path/buildfile @@ -0,0 +1,45 @@ +# Untyped dir path reversability. +# +x = s/foo/bar/ +print -e=$x +print -e $x + +y = $x +print -e=$y +print -e $y +print + +# Typed dir path reversability and expansion. +# +x = [dir_path] foo/bar/ +print -I$x +print -I$x/baz +print -I $x +print [strings] -I $x +print -I $x/baz +print + +y = $x # No longer typed but still not original. +print -I$y +print -I$y/baz +print -I $y +print [strings] -I $y +print -I $y/baz +print + +z = [strings] $x # Re-typed. +print $z +print + +# The root case. +# +r = [dir_path] / +print $r/foo + +r += foo +print [strings] $r + +r += bar +print [strings] $r + +./: diff --git a/old-tests/variable/dir-path/test.out b/old-tests/variable/dir-path/test.out new file mode 100644 index 0000000..e608c42 --- /dev/null +++ b/old-tests/variable/dir-path/test.out @@ -0,0 +1,22 @@ +-e=s/foo/bar/ +-e s/foo/bar/ +-e=s/foo/bar/ +-e s/foo/bar/ + +-Ifoo/bar +-Ifoo/bar/baz +-I foo/bar/ +-I foo/bar +-I foo/bar/baz + +-Ifoo/bar +-Ifoo/bar/baz +-I foo/bar/ +-I foo/bar +-I foo/bar/baz + +foo/bar + +//foo +/foo +/foo/bar diff --git a/old-tests/variable/dir-path/test.sh b/old-tests/variable/dir-path/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/variable/dir-path/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/variable/expansion/buildfile b/old-tests/variable/expansion/buildfile new file mode 100644 index 0000000..3f28372 --- /dev/null +++ b/old-tests/variable/expansion/buildfile @@ -0,0 +1,26 @@ +foo = FOO + +print $foo +print $(foo) + +# Invalid. +# +#print $ +#print $() +#print $(foo bar) +#print $(foo{bar}) + +# Indirect. +# +FOO = foo +print $($FOO) +print $($(FOO)) +print $($($FOO)) + +# Quoted name. +# +"b a r" = BAR +print $("b a r") +#print $"b a r" + +./: diff --git a/old-tests/variable/expansion/test.out b/old-tests/variable/expansion/test.out new file mode 100644 index 0000000..5056f04 --- /dev/null +++ b/old-tests/variable/expansion/test.out @@ -0,0 +1,6 @@ +FOO +FOO +FOO +FOO +foo +BAR diff --git a/old-tests/variable/expansion/test.sh b/old-tests/variable/expansion/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/variable/expansion/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/variable/null/buildfile b/old-tests/variable/null/buildfile new file mode 100644 index 0000000..3fa1a9e --- /dev/null +++ b/old-tests/variable/null/buildfile @@ -0,0 +1,22 @@ +#v = [null=junk] # error: unexpected value for attribute null: junk +#v = [null] junk # error: empty null value expected instead of 'junk' + +print $v0 # Undefined. + +v1 = [null] +print $v1 + +v2 = x +v2 = [null] +print $v2 + +v3a = [null] +v3b = $v3a +print $v3b +v3b = ($v3a) +print $v3b +print ($v3b) + +print [null] + +./: diff --git a/old-tests/variable/null/test.out b/old-tests/variable/null/test.out new file mode 100644 index 0000000..5119a71 --- /dev/null +++ b/old-tests/variable/null/test.out @@ -0,0 +1,7 @@ +[null] +[null] +[null] +[null] +[null] +[null] +[null] diff --git a/old-tests/variable/null/test.sh b/old-tests/variable/null/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/variable/null/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/variable/override/build/bootstrap.build b/old-tests/variable/override/build/bootstrap.build new file mode 100644 index 0000000..1c2e239 --- /dev/null +++ b/old-tests/variable/override/build/bootstrap.build @@ -0,0 +1,2 @@ +project = override +amalgamation = # Disabled. diff --git a/old-tests/variable/override/buildfile b/old-tests/variable/override/buildfile new file mode 100644 index 0000000..c090e81 --- /dev/null +++ b/old-tests/variable/override/buildfile @@ -0,0 +1,58 @@ +if ($t != [null]) +{ + [$t] v = [null] +} + +print "/ :" $(/: v) + +if ($a == as) +{ + v = x +} +elif ($a == ap) +{ + v += s +} +elif ($a == pr) +{ + v =+ p +} + +print ". :" $v + +d/: +{ + if ($d_a == as) + { + v = x + } + elif ($d_a == ap) + { + v += s + } + elif ($d_a == pr) + { + v =+ p + } + + print "d :" $v + + + if ($d_t_a == as) + { + file{t}: v = x + } + elif ($d_t_a == ap) + { + file{t}: v += s + } + elif ($d_t_a == pr) + { + file{t}: v =+ p + } + + print "d/t :" $(file{t}: v) +} + +include p/ +./: diff --git a/old-tests/variable/override/cache b/old-tests/variable/override/cache new file mode 100644 index 0000000..8378688 --- /dev/null +++ b/old-tests/variable/override/cache @@ -0,0 +1,13 @@ +x = [string] 0 +print $x + +x = [uint64] 1 +print $x + +y = 0 +print $y + +[uint64] y = [null] +print $y + +./: diff --git a/old-tests/variable/override/p/build/bootstrap.build b/old-tests/variable/override/p/build/bootstrap.build new file mode 100644 index 0000000..723e2a3 --- /dev/null +++ b/old-tests/variable/override/p/build/bootstrap.build @@ -0,0 +1 @@ +project = override-p diff --git a/old-tests/variable/override/p/buildfile b/old-tests/variable/override/p/buildfile new file mode 100644 index 0000000..527b9ae --- /dev/null +++ b/old-tests/variable/override/p/buildfile @@ -0,0 +1,49 @@ +if ($p_a == as) +{ + v = x +} +elif ($p_a == ap) +{ + v += s +} +elif ($p_a == pr) +{ + v =+ p +} + +print "p :" $v + +d/: +{ + if ($p_d_a == as) + { + v = x + } + elif ($p_d_a == ap) + { + v += s + } + elif ($p_d_a == pr) + { + v =+ p + } + + print "p/d :" $v + + if ($p_d_t_a == as) + { + file{t}: v = x + } + elif ($p_d_t_a == ap) + { + file{t}: v += s + } + elif ($p_d_t_a == pr) + { + file{t}: v =+ p + } + + print "p/d/t :" $(file{t}: v) +} + +./: diff --git a/old-tests/variable/override/p/loader b/old-tests/variable/override/p/loader new file mode 100644 index 0000000..f298dcc --- /dev/null +++ b/old-tests/variable/override/p/loader @@ -0,0 +1 @@ +include ../buildfile diff --git a/old-tests/variable/override/simple b/old-tests/variable/override/simple new file mode 100644 index 0000000..899daa2 --- /dev/null +++ b/old-tests/variable/override/simple @@ -0,0 +1,3 @@ +print $foo + +./: diff --git a/old-tests/variable/override/test.sh b/old-tests/variable/override/test.sh new file mode 100755 index 0000000..a8b08b2 --- /dev/null +++ b/old-tests/variable/override/test.sh @@ -0,0 +1,312 @@ +#! /usr/bin/env bash + +verbose=n + +# By default when MSYS2 executable (bash.exe in particular) runs another +# executable it converts arguments that look like POSIX paths to Windows +# representations. More about it at: +# +# http://www.mingw.org/wiki/Posix_path_conversion +# +# So when you run b /v=X, build2 gets 'C:/msys64/v=X' argument instead of +# '/v=X'. To disable this behavior set MSYS2_ARG_CONV_EXCL environment +# variable, so all arguments starting with / will not be converted. You can +# list more prefixes using ';' as a separator. +# +export MSYS2_ARG_CONV_EXCL=/ + +tmp_file=`mktemp` + +# Remove temporary file on exit. Cover the case when exit due to an error. +# +trap 'rm -f $tmp_file' EXIT + +function error () { echo "$*" 1>&2; exit 1; } + +function fail () +{ + if [ "$verbose" = "y" ]; then + b $* + else + b -q $* 2>/dev/null + fi + + if [ $? -eq 0 ]; then + error "succeeded: b $*" + fi + + return 0 +} + +function test () +{ + b -q $* >$tmp_file + + if [ $? -ne 0 ]; then + error "failed: b -q $* >$tmp_file" + fi + + diff --strip-trailing-cr -u - $tmp_file + + if [ $? -ne 0 ]; then + error "failed: b $*" + fi +} + +fail foo=bar[] # error: unexpected [ in variable assignment 'foo=bar[]' +fail foo=[string]bar # error: typed override of variable foo +fail "!foo=bar" "!foo=BAR" # error: multiple global overrides of variable foo +fail "foo=bar" "foo=BAR" # error: multiple project overrides of variable foo +fail "%foo=bar" "%foo=BAR" # error: multiple project overrides of variable foo + +test --buildfile simple foo=bar ./ ./ <<< "bar" # Multiple bootstraps of the same project. + +# Visibility/qualification. +# +test !v=X < + +using namespace std; + +int +main (int argc, const char* argv[]) +{ + for (int i (1); i < argc; ++i) + cout << "'" << argv[i] << "'" << endl; +} diff --git a/old-tests/variable/representation/test.out b/old-tests/variable/representation/test.out new file mode 100644 index 0000000..84e7250 --- /dev/null +++ b/old-tests/variable/representation/test.out @@ -0,0 +1,20 @@ +'-L/' +'-L/foo/' +'..' +'../' +'/' +'//' +'///' +'//foo/' +'foo@bar' +'foo/@bar/' +'foo@' +'@bar' +'@' +'@@' +'foo%bar' +'foo%' +'%bar' +'foo%bar' +'x%foo@y%bar' +'x%foo/@y%bar/' diff --git a/old-tests/variable/representation/test.sh b/old-tests/variable/representation/test.sh new file mode 100755 index 0000000..da9e0e9 --- /dev/null +++ b/old-tests/variable/representation/test.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +b test + diff --git a/old-tests/variable/type-pattern-append/buildfile b/old-tests/variable/type-pattern-append/buildfile new file mode 100644 index 0000000..a91b340 --- /dev/null +++ b/old-tests/variable/type-pattern-append/buildfile @@ -0,0 +1,59 @@ +# Typed append/prepend. +# +#dir{a*}: x += [bool] true +#dir{p*}: x =+ [bool] true + +[string] typed = [null] +dir{a*}: typed += abc # ok +dir{p*}: typed =+ abc # ok + +# Prepend/append before/after assignment. +# +[string] x1 = [null] +dir{*}: x1 += A +dir{*}: x1 = b +dir{*}: x1 += c +dir{*}: x1 =+ a +print $(dir{./}:x1) + +# Without stem, mixed prepend/append. +# +dir{*}: x2 += b +dir{*}: x2 += c +#dir{*}: x2 =+ a # error +print $(dir{./}:x2) + +dir{*}: x3 =+ b +dir{*}: x3 =+ a +#dir{*}: x3 += c # error +print $(dir{./}:x3) + +# With stem, typing. +# +x4 = a +dir{*}: x4 += b +dir{*}: x4 += c +print $(dir{./}:x4) + +[string] x5 = b +dir{*}: x5 =+ a +x = $(dir{./}:x5) +print $(dir{./}:x5) + +x6 = [string] a +sub/: +{ + dir{*}: x6 += b + dir{*}: x6 += [null] + print $(dir{./}:x6) +} + +x7 = [string] b +dir{*}: x7 =+ a +sub/: +{ + dir{*}: x7 += c + print $(dir{./}:x7) +} + +./: diff --git a/old-tests/variable/type-pattern-append/test.out b/old-tests/variable/type-pattern-append/test.out new file mode 100644 index 0000000..e8e2242 --- /dev/null +++ b/old-tests/variable/type-pattern-append/test.out @@ -0,0 +1,7 @@ +abc +b c +a b +a b c +ab +ab +abc diff --git a/old-tests/variable/type-pattern-append/test.sh b/old-tests/variable/type-pattern-append/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/variable/type-pattern-append/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/variable/type-pattern/buildfile b/old-tests/variable/type-pattern/buildfile new file mode 100644 index 0000000..dd218ac --- /dev/null +++ b/old-tests/variable/type-pattern/buildfile @@ -0,0 +1,39 @@ +#dir/foo{*}: x = y # directory +#foo{*.*}: x = y # multiple wildcards +#foo{*}: x = y # unknown target type +#file{*}: x += y # append + +# Use --verbose 6 to examine. +# + +dir{*}: x = y + +x = z +dir{*-foo}: x = $x # 'z' + +x = G +file{*-foo}: x = x +file{xfoo}: x = $x # 'G' +file{-foo}: x = $x # 'x' +file{x-foo}: x = $x # 'x' +file{bar-*-foo}: x = X +file{bar-x}: x = $x # 'G' +file{bar--foo}: x = $x # 'X' +file{bar-x-foo}: x = $x # 'X' + +file{*-fox}: x = 1 +file{fox-*}: x = 2 +file{fox-fox}: x = $x # '2' +file{*-fox}: x = 3 +file{fox-x-fox}: x = $x # still '2'! + +*-foz: x = z # any target +file{x-foz}: x = $x # 'z' + +# These should all be the same. +# +*: x1 = X1 +{*}: x2 = X2 +*{*}: x3 = X3 + +./: diff --git a/old-tests/variable/type/buildfile b/old-tests/variable/type/buildfile new file mode 100644 index 0000000..a22cddd --- /dev/null +++ b/old-tests/variable/type/buildfile @@ -0,0 +1,84 @@ +# Variable typing. +# + +#[string] str3 = foo +#[bool] str3 = false # error: changing str3 type from string to bool + +#[bool string] str3 = foo # error: multiple variable types: bool, string + +#[junk] jnk = foo # error: unknown variable attribute junk + +[string] str1 = bar +str1 =+ foo +str1 += baz +print $str1 + +str2 = bar +[string] str2 =+ foo +str2 += baz +print $str2 + +# Value typing. +# + +#v = [bool string] true # error: multiple value types: string, bool +#v = [string=junk] true # error: unexpected value for attribute string: junk + +#[string] var = +#var = [bool] true # error: confliction variable var type string and value type bool + +#var = [string] false +#var += [bool] true # error: confliction original value type string and append/prepend value type bool + +v1a = [uint64] 00 +v1b += [uint64] 00 +v1c =+ [uint64] 00 +print $v1a $v1b $v1c # 0 0 0 + +v2 = [uint64] 00 +v2 = [string] 00 +print $v2 # 00 + +#v3a = [uint64] 00 +#v3a += [string] 00 # error: confliction original value type uint64 and append/prepend value type string + +#v3b = [uint64] 00 +#v3b =+ [string] 00 # error: confliction original value type uint64 and append/prepend value type string + +v4a = 01 +v4a += [uint64] 01 +print $v4a # 2 + +v4b = 01 +v4b =+ [uint64] 01 +print $v4b # 2 + +v5a = 01 +sub/: +{ + v5a += [uint64] 01 + print $v5a # 2 +} + +v5b = 01 +sub/: +{ + v5b =+ [uint64] 01 + print $v5b # 2 +} + +v6 = [uint64 null] +v6 += 00 +print $v6 # 0 + +v7 = [string null] +v7 += [uint64] 00 +print $v7 # 0 + +print [uint64] 00 # 0 + +v8 = [uint64] 01 +v8 = abc +print $v8 # abc + +./: diff --git a/old-tests/variable/type/test.out b/old-tests/variable/type/test.out new file mode 100644 index 0000000..5218221 --- /dev/null +++ b/old-tests/variable/type/test.out @@ -0,0 +1,12 @@ +foobarbaz +foobarbaz +0 0 0 +00 +2 +2 +2 +2 +0 +0 +0 +abc diff --git a/old-tests/variable/type/test.sh b/old-tests/variable/type/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/variable/type/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - diff --git a/old-tests/version/buildfile b/old-tests/version/buildfile new file mode 100644 index 0000000..eaf2f77 --- /dev/null +++ b/old-tests/version/buildfile @@ -0,0 +1,31 @@ +#using build@-1.0.0 +#using build@+1.0.0 +#using build@x.0.0 +#using build@1x.0.0 +#using build@1 +#using build@1. +#using build@1.x +#using build@1.1 +#using build@1.1. +#using build@1.1.x +#using build@1.1.100 +#using build@1.1.1~ +#using build@1.1.1-d +#using build@1.1.1-aX +#using build@1.1.1-a0 +#using build@1.1.1-a99 +#using build@1.1.1-a1X +#using build@0.0.0-a1 + +using build@0.0.0 +using build@0.0.1 +using build@0.0.1-a1 +using build@0.0.1-b2 + +#using build@0.1.0 +using build@0.1.0-a1 + +#using build@1.1.0 +#using build@1.1.0-b1 + +./: diff --git a/tests/.gitignore b/tests/.gitignore index c7bd86c..e54525b 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,6 +1 @@ driver -config.build - -# Temporary out-of-tree build directories. -# -*-out diff --git a/tests/amalgam/config/build/bootstrap.build b/tests/amalgam/config/build/bootstrap.build deleted file mode 100644 index 52d415a..0000000 --- a/tests/amalgam/config/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = amalgam-config -amalgamation = # Shall not be amalgamated. -using config diff --git a/tests/amalgam/config/build/root.build b/tests/amalgam/config/build/root.build deleted file mode 100644 index 7d1767b..0000000 --- a/tests/amalgam/config/build/root.build +++ /dev/null @@ -1 +0,0 @@ -using cxx diff --git a/tests/amalgam/config/buildfile b/tests/amalgam/config/buildfile deleted file mode 100644 index 32285a9..0000000 --- a/tests/amalgam/config/buildfile +++ /dev/null @@ -1,3 +0,0 @@ -d = #t/ l/ -./: $d -include $d diff --git a/tests/amalgam/libtest/build/bootstrap.build b/tests/amalgam/libtest/build/bootstrap.build deleted file mode 100644 index 025e510..0000000 --- a/tests/amalgam/libtest/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = amalgam-libtest -using config diff --git a/tests/amalgam/libtest/build/export.build b/tests/amalgam/libtest/build/export.build deleted file mode 100644 index b95e409..0000000 --- a/tests/amalgam/libtest/build/export.build +++ /dev/null @@ -1,6 +0,0 @@ -$out_root/: -{ - include buildfile -} - -export $out_root/lib{test} diff --git a/tests/amalgam/libtest/buildfile b/tests/amalgam/libtest/buildfile deleted file mode 100644 index 70a1467..0000000 --- a/tests/amalgam/libtest/buildfile +++ /dev/null @@ -1,3 +0,0 @@ -using cxx - -lib{test}: cxx{test} diff --git a/tests/amalgam/libtest/test.cxx b/tests/amalgam/libtest/test.cxx deleted file mode 100644 index 34a033a..0000000 --- a/tests/amalgam/libtest/test.cxx +++ /dev/null @@ -1,4 +0,0 @@ -void -f () -{ -} diff --git a/tests/amalgam/test/build/bootstrap.build b/tests/amalgam/test/build/bootstrap.build deleted file mode 100644 index a53e738..0000000 --- a/tests/amalgam/test/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = amalgam-test -using config diff --git a/tests/amalgam/test/buildfile b/tests/amalgam/test/buildfile deleted file mode 100644 index e8af169..0000000 --- a/tests/amalgam/test/buildfile +++ /dev/null @@ -1,5 +0,0 @@ -using cxx - -import libs = amalgam-libtest%lib{test} - -exe{driver}: cxx{driver} $libs diff --git a/tests/amalgam/test/driver.cxx b/tests/amalgam/test/driver.cxx deleted file mode 100644 index 70b4146..0000000 --- a/tests/amalgam/test/driver.cxx +++ /dev/null @@ -1,4 +0,0 @@ -int -main () -{ -} diff --git a/tests/amalgam/unnamed/build/bootstrap.build b/tests/amalgam/unnamed/build/bootstrap.build deleted file mode 100644 index 30065f4..0000000 --- a/tests/amalgam/unnamed/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = amalgam-unnamed -amalgamation = # Disabled. -using config diff --git a/tests/amalgam/unnamed/buildfile b/tests/amalgam/unnamed/buildfile deleted file mode 100644 index ead9514..0000000 --- a/tests/amalgam/unnamed/buildfile +++ /dev/null @@ -1,3 +0,0 @@ -./: sub/ -include sub/ -print $subprojects diff --git a/tests/amalgam/unnamed/sub/build/bootstrap.build b/tests/amalgam/unnamed/sub/build/bootstrap.build deleted file mode 100644 index ce3735a..0000000 --- a/tests/amalgam/unnamed/sub/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = -using config diff --git a/tests/amalgam/unnamed/sub/buildfile b/tests/amalgam/unnamed/sub/buildfile deleted file mode 100644 index 8717375..0000000 --- a/tests/amalgam/unnamed/sub/buildfile +++ /dev/null @@ -1,2 +0,0 @@ -./: -print "'$project'" diff --git a/tests/amalgam/unnamed/test.out b/tests/amalgam/unnamed/test.out deleted file mode 100644 index 023b71f..0000000 --- a/tests/amalgam/unnamed/test.out +++ /dev/null @@ -1,2 +0,0 @@ -'' -sub/@sub/ diff --git a/tests/amalgam/unnamed/test.sh b/tests/amalgam/unnamed/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/amalgam/unnamed/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/attribute/buildfile b/tests/attribute/buildfile deleted file mode 100644 index 6675894..0000000 --- a/tests/attribute/buildfile +++ /dev/null @@ -1,21 +0,0 @@ -#[] # error: standalone attribute sequence -#[foo] # error: standalone attribute sequence -#[[] # error: expected name instead of '[' -#[foo # error: expected ']' instead of -#[dir/file{foo}] # error: invalid attribute key -#[foo=dir/file{bar}] # error: invalid attribute key - -#[foo] print hello # error: attributes before print -#[foo]./: # error: attributes before directory scope -#{ -#} -#[foo]./: # error: attributes before target/scope -#./: [foo] buildfile # error: attributes before prerequisites -#import [foo] libz # error: attributes without variable - -#foo="F[O]O" -#[{x y z}] -#[$foo] -#["[]"] - -./: diff --git a/tests/cli/lib/libtest/build/bootstrap.build b/tests/cli/lib/libtest/build/bootstrap.build deleted file mode 100644 index 2e04406..0000000 --- a/tests/cli/lib/libtest/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = cli-lib-libtest -amalgamation = # Disabled. -using config diff --git a/tests/cli/lib/libtest/build/export.build b/tests/cli/lib/libtest/build/export.build deleted file mode 100644 index e8b12b3..0000000 --- a/tests/cli/lib/libtest/build/export.build +++ /dev/null @@ -1,6 +0,0 @@ -$out_root/: -{ - include test/ -} - -export $out_root/test/lib{test} diff --git a/tests/cli/lib/libtest/build/root.build b/tests/cli/lib/libtest/build/root.build deleted file mode 100644 index c9ff67d..0000000 --- a/tests/cli/lib/libtest/build/root.build +++ /dev/null @@ -1,5 +0,0 @@ -using cxx - -hxx{*}: extension = -ixx{*}: extension = ipp -cxx{*}: extension = cpp diff --git a/tests/cli/lib/libtest/buildfile b/tests/cli/lib/libtest/buildfile deleted file mode 100644 index 7ea849d..0000000 --- a/tests/cli/lib/libtest/buildfile +++ /dev/null @@ -1,2 +0,0 @@ -./: test/ -include test/ diff --git a/tests/cli/lib/libtest/test/base.cli b/tests/cli/lib/libtest/test/base.cli deleted file mode 100644 index bbf9999..0000000 --- a/tests/cli/lib/libtest/test/base.cli +++ /dev/null @@ -1,7 +0,0 @@ -namespace test -{ - class base - { - bool --version; - }; -} diff --git a/tests/cli/lib/libtest/test/buildfile b/tests/cli/lib/libtest/test/buildfile deleted file mode 100644 index 6b0d9bd..0000000 --- a/tests/cli/lib/libtest/test/buildfile +++ /dev/null @@ -1,20 +0,0 @@ -using cli - -lib{test}: cxx{utility} cli.cxx{test base} extra/cxx{test} -cli.cxx{test}: cli{test} -cli.cxx{base}: cli{base} - -cli.options += -I $src_root --include-with-brackets - -extra/: -{ - cxx{test} hxx{test}: cli{test} - cli.options += --include-prefix test/extra --guard-prefix TEST_EXTRA \ - --cli-namespace test::extra::cli -} - -cxx.poptions += -I$out_root -I$src_root -lib{test}: cxx.export.poptions = -I$out_root -I$src_root - -cli.options += --include-prefix test --guard-prefix TEST \ ---cli-namespace test::cli diff --git a/tests/cli/lib/libtest/test/extra/test.cli b/tests/cli/lib/libtest/test/extra/test.cli deleted file mode 100644 index 8408402..0000000 --- a/tests/cli/lib/libtest/test/extra/test.cli +++ /dev/null @@ -1,11 +0,0 @@ -namespace test -{ - namespace extra - { - class options - { - bool --help; - bool --version; - }; - } -} diff --git a/tests/cli/lib/libtest/test/test.cli b/tests/cli/lib/libtest/test/test.cli deleted file mode 100644 index f19d56c..0000000 --- a/tests/cli/lib/libtest/test/test.cli +++ /dev/null @@ -1,9 +0,0 @@ -include ; - -namespace test -{ - class options: base - { - bool --help; - }; -} diff --git a/tests/cli/lib/libtest/test/utility.cpp b/tests/cli/lib/libtest/test/utility.cpp deleted file mode 100644 index 7c59218..0000000 --- a/tests/cli/lib/libtest/test/utility.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -void -f () -{ -} diff --git a/tests/cli/lib/test/build/bootstrap.build b/tests/cli/lib/test/build/bootstrap.build deleted file mode 100644 index db43826..0000000 --- a/tests/cli/lib/test/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = cli-lib-test -amalgamation = # Disabled. -using config diff --git a/tests/cli/lib/test/build/root.build b/tests/cli/lib/test/build/root.build deleted file mode 100644 index 636fd02..0000000 --- a/tests/cli/lib/test/build/root.build +++ /dev/null @@ -1,7 +0,0 @@ -using cxx - -hxx{*}: extension = h -ixx{*}: extension = inl -cxx{*}: extension = C - -using cli diff --git a/tests/cli/lib/test/buildfile b/tests/cli/lib/test/buildfile deleted file mode 100644 index d3e784d..0000000 --- a/tests/cli/lib/test/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -import libs += cli-lib-libtest%lib{test} - -exe{driver}: cxx{driver} cli.cxx{test} $libs -cli.cxx{test}: cli{test} - -cxx.poptions += -I$out_root diff --git a/tests/cli/lib/test/driver.C b/tests/cli/lib/test/driver.C deleted file mode 100644 index ee2171f..0000000 --- a/tests/cli/lib/test/driver.C +++ /dev/null @@ -1,8 +0,0 @@ -#include "test.h" -#include -#include - -int -main () -{ -} diff --git a/tests/cli/lib/test/test.cli b/tests/cli/lib/test/test.cli deleted file mode 100644 index db3cfb8..0000000 --- a/tests/cli/lib/test/test.cli +++ /dev/null @@ -1,5 +0,0 @@ -class options -{ - bool --help; - bool --version; -}; diff --git a/tests/cli/simple/build/bootstrap.build b/tests/cli/simple/build/bootstrap.build deleted file mode 100644 index 2c116c9..0000000 --- a/tests/cli/simple/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = cli-simple -amalgamation = # Disabled. -using config diff --git a/tests/cli/simple/build/root.build b/tests/cli/simple/build/root.build deleted file mode 100644 index 8b13789..0000000 --- a/tests/cli/simple/build/root.build +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/cli/simple/buildfile b/tests/cli/simple/buildfile deleted file mode 100644 index 47e06d9..0000000 --- a/tests/cli/simple/buildfile +++ /dev/null @@ -1,15 +0,0 @@ -using cxx - -hxx{*}: extension = -cxx{*}: extension = cpp -ixx{*}: extension = ipp - -cxx.poptions += -I$out_root - -using cli - -exe{driver}: cxx{driver} cxx{test} -cxx{test} hxx{test}: cli{test} - -#exe{driver}: cxx{driver} cli.cxx{test} -#cli.cxx{test}: cli{test} diff --git a/tests/cli/simple/driver.cpp b/tests/cli/simple/driver.cpp deleted file mode 100644 index ef9cc60..0000000 --- a/tests/cli/simple/driver.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "test" - -int -main () -{ -} diff --git a/tests/cli/simple/test.cli b/tests/cli/simple/test.cli deleted file mode 100644 index db3cfb8..0000000 --- a/tests/cli/simple/test.cli +++ /dev/null @@ -1,5 +0,0 @@ -class options -{ - bool --help; - bool --version; -}; diff --git a/tests/define/buildfile b/tests/define/buildfile deleted file mode 100644 index d85fc57..0000000 --- a/tests/define/buildfile +++ /dev/null @@ -1,14 +0,0 @@ -#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{BAR}: # verify name is bar{BAR} with --verbose 6 - -./: diff --git a/tests/define/buildfile.alias b/tests/define/buildfile.alias deleted file mode 100644 index d3b9fc4..0000000 --- a/tests/define/buildfile.alias +++ /dev/null @@ -1,16 +0,0 @@ -#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" diff --git a/tests/depdb/buildfile b/tests/depdb/buildfile deleted file mode 100644 index 53e9cd3..0000000 --- a/tests/depdb/buildfile +++ /dev/null @@ -1,8 +0,0 @@ -# file : tests/depdb/buildfile -# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -import libs = libbutl%lib{butl} - -exe{driver}: cxx{driver ../../build2/{depdb}} $libs -exe{driver}: test.arguments = $out_base/test.d diff --git a/tests/depdb/driver.cxx b/tests/depdb/driver.cxx deleted file mode 100644 index f156991..0000000 --- a/tests/depdb/driver.cxx +++ /dev/null @@ -1,166 +0,0 @@ -// file : tests/depdb/driver.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include - -#include - -#include -#include - -#include - -using namespace std; -using namespace build2; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " " << endl; - return 1; - } - - path p (argv[1]); - auto rm = [&p] () {try_rmfile (p);}; - - // Create empty database. - // - { - rm (); - - { - depdb d (p); - assert (d.writing ()); - d.close (); - } - - { - depdb d (p); - assert (d.reading ()); - assert (!d.more ()); - assert (d.read () == nullptr); - d.close (); - } - } - - // No close/end marker. - // - { - rm (); - - { - depdb d (p); - assert (d.writing ()); - // No close. - } - - { - depdb d (p); - assert (d.writing ()); - d.close (); - } - - { - depdb d (p); - assert (d.reading ()); - } - } - - // Overwrite/append/truncate. - // - { - rm (); - - { - depdb d (p); - d.write ("foo"); - d.close (); - } - - { - depdb d (p); - assert (*d.read () == "foo"); - assert (!d.more ()); - d.close (); - } - - { - depdb d (p); - assert (*d.read () == "foo"); - assert (!d.more ()); - d.write ("FOO"); - d.close (); - } - - { - depdb d (p); - assert (*d.read () == "FOO"); - assert (!d.more ()); - assert (d.read () == nullptr); - assert (d.read () == nullptr); - d.write ("BAR"); - d.close (); - } - - { - depdb d (p); - assert (*d.read () == "FOO"); - assert (d.more ()); - d.write ("foo"); - d.close (); // Truncate. - } - - { - depdb d (p); - assert (*d.read () == "foo"); - assert (!d.more ()); - } - - // Stray end marker. - // - { - depdb d (p); - assert (*d.read () == "foo"); - d.write ("fox"); - // No close. - } - - { - depdb d (p); - assert (d.more ()); - assert (*d.read () == "fox"); - assert (!d.more ()); - } - } - - // Read/truncate. - // - { - rm (); - - { - depdb d (p); - d.write ("foo"); - d.write ("bar"); - d.close (); - } - - { - depdb d (p); - assert (*d.read () == "foo"); - assert (d.more ()); - d.close (); // Truncate bar. - } - - { - depdb d (p); - assert (*d.read () == "foo"); - assert (!d.more ()); - } - } - - rm (); -} diff --git a/tests/dist/simple/README b/tests/dist/simple/README deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dist/simple/bootstrap b/tests/dist/simple/bootstrap deleted file mode 100755 index e69de29..0000000 diff --git a/tests/dist/simple/build/bootstrap.build b/tests/dist/simple/build/bootstrap.build deleted file mode 100644 index 0cd9015..0000000 --- a/tests/dist/simple/build/bootstrap.build +++ /dev/null @@ -1,9 +0,0 @@ -project = dist-simple -version = 1.0.0 -amalgamation = # Disabled. -using config -using dist -using test -using install - -dist.package = $project-$version diff --git a/tests/dist/simple/build/export.build b/tests/dist/simple/build/export.build deleted file mode 100644 index e69de29..0000000 diff --git a/tests/dist/simple/buildfile b/tests/dist/simple/buildfile deleted file mode 100644 index 159fff3..0000000 --- a/tests/dist/simple/buildfile +++ /dev/null @@ -1,4 +0,0 @@ -using cxx - -exe{driver}: cxx{driver} doc{README} file{bootstrap} -exe{driver}: test.output = test.out diff --git a/tests/dist/simple/driver.cxx b/tests/dist/simple/driver.cxx deleted file mode 100644 index 293d7ff..0000000 --- a/tests/dist/simple/driver.cxx +++ /dev/null @@ -1,10 +0,0 @@ -#include - -using namespace std; - -int -main () -{ - cerr << "test is running (stderr)" << endl; - cout << "test is running (stdout)" << endl; -} diff --git a/tests/dist/simple/test.out b/tests/dist/simple/test.out deleted file mode 100644 index 5d63fab..0000000 --- a/tests/dist/simple/test.out +++ /dev/null @@ -1 +0,0 @@ -test is running (stdout) diff --git a/tests/escaping/buildfile b/tests/escaping/buildfile deleted file mode 100644 index 4259087..0000000 --- a/tests/escaping/buildfile +++ /dev/null @@ -1,13 +0,0 @@ -print \'single\' -print \"double\" - -# Newline is special. -# -\ -print foo\ -bar - -print foo \ -bar - -./: diff --git a/tests/escaping/test.out b/tests/escaping/test.out deleted file mode 100644 index 9894dde..0000000 --- a/tests/escaping/test.out +++ /dev/null @@ -1,4 +0,0 @@ -'single' -"double" -foobar -foo bar diff --git a/tests/escaping/test.sh b/tests/escaping/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/escaping/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/eval/buildfile b/tests/eval/buildfile deleted file mode 100644 index f26a9a0..0000000 --- a/tests/eval/buildfile +++ /dev/null @@ -1,72 +0,0 @@ -(./): -() - -# Invalid. -# -#(foo -#(foo #comment - -print () -print ((foo)(bar)) -print ((foo) (bar)) - -print (foo\ -bar) - -# !=, == vs !, = recognition -# -print (=) -print (!) -print (= foo) -print (foo!) - -# !=, == evaluation -# - -# print ( == bar) -# print (foo == ) - -print (foo == bar) -print (foo == foo) -print (foo != bar) -print (foo != foo) - -print (foo == (foo)) -print ((foo bar) == foo bar) -print (foo != foo bar) -print ("" == '') - -print ((foo != bar) baz) -print "foo equals bar is (foo == bar)" - -foo = foo -print ($foo == foo) -print (bar != $foo) - -print ([null]) -print (([null])) -print ([uint64] 01) - -n = [null] -print ($n == [null]) -print ($N == [null]) -print ([null] == [null]) - -print ($n == $N == true) - -n = -print ($n == ) -n = {} -print ($n == "") - -#print ([uint64] 01 == [string] 01) - -# <, <=, >, >= evaluation -# -print (a < b) -print (a b > a a) -print (123 <= 123) -print ([uint64] 02 > [uint64] 01) -print (a > [null]) -print ([uint64] 02 > [null]) -print ($build.version > 30000) diff --git a/tests/eval/test.out b/tests/eval/test.out deleted file mode 100644 index 555853f..0000000 --- a/tests/eval/test.out +++ /dev/null @@ -1,36 +0,0 @@ - -foobar -foo bar -foobar -= -! -= foo -foo! -false -true -true -false -true -true -true -true -true baz -foo equals bar is false -true -true -[null] -[null] -1 -true -true -true -true -true -true -true -true -true -true -true -true -true diff --git a/tests/eval/test.sh b/tests/eval/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/eval/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/if-else/buildfile b/tests/if-else/buildfile deleted file mode 100644 index 25fabf0..0000000 --- a/tests/if-else/buildfile +++ /dev/null @@ -1,158 +0,0 @@ -#else # else without if -#elif # elif without if -#elif! # elif! without if -#if # expected if-expression -#if test # expected true or false -#if true # expected { -#x -#if true # expected newline after { -#{x -#if true # expected newline after } -#{ -#}x - -if true -{ - print 1 -} -else -{ - print 0 -} - -if! true -{ - print 0 -} -else -{ - print 1 -} - -if false -{ - print 0 -} -else -{ - print 1 -} - -if false -{ - print 0 -} -elif true -{ - print 1 -} -else -{ - print 0 -} - -if true -{ - print 1 -} -elif true -{ - print 0 -} -else -{ - print 0 -} - -# Empty block -# -if true -{ -} -else -{ - print 0 -} - -# Nested if-else -# -if true -{ - if true - { - print 1 - } -} -else -{ - if true - { - print 0 - } -} - -t = true -f = false - -if $t -{ - print 1 -} - -if! $f -{ - print 1 -} - -# With eval context. -# -if (foo == foo) -{ - print 1 -} - -if(foo != bar) -{ - print 1 -} - -if!(foo == bar) -{ - print 1 -} - -if ([uint64] 01 == [uint64] 1) -{ - print 1 -} - -# Single line. -# - -#if true -#} # expected if-line - -if true - print 1 - -if false - - print 0 -else - # Comment. - print 1 - -if true - if false - print 0 - else - print 1 - -# EOF test. -# -./: - -if true -{ - print 1 -} diff --git a/tests/if-else/test.out b/tests/if-else/test.out deleted file mode 100644 index 58501cb..0000000 --- a/tests/if-else/test.out +++ /dev/null @@ -1,16 +0,0 @@ -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 diff --git a/tests/if-else/test.sh b/tests/if-else/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/if-else/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/import/installed/build/bootstrap.build b/tests/import/installed/build/bootstrap.build deleted file mode 100644 index 2af1e60..0000000 --- a/tests/import/installed/build/bootstrap.build +++ /dev/null @@ -1,4 +0,0 @@ -project = import-installed -amalgamation = # Disabled. -using config -using test diff --git a/tests/import/installed/buildfile b/tests/import/installed/buildfile deleted file mode 100644 index ae9d705..0000000 --- a/tests/import/installed/buildfile +++ /dev/null @@ -1,12 +0,0 @@ -using cxx - -import libs += zlib%lib{z} -import libs += libsqlite3%lib{sqlite3} -import libs += libpq%lib{pq} - -#lib{driver}: cxx{driver} $libs - -exe{driver}: cxx{driver} $libs -exe{driver}: test = true - - diff --git a/tests/import/installed/driver.cxx b/tests/import/installed/driver.cxx deleted file mode 100644 index 70b4146..0000000 --- a/tests/import/installed/driver.cxx +++ /dev/null @@ -1,4 +0,0 @@ -int -main () -{ -} diff --git a/tests/install/lib/libtest/build/bootstrap.build b/tests/install/lib/libtest/build/bootstrap.build deleted file mode 100644 index 0e83554..0000000 --- a/tests/install/lib/libtest/build/bootstrap.build +++ /dev/null @@ -1,5 +0,0 @@ -project = install-lib-libtest -amalgamation = # Disabled. -using config -using install -using test diff --git a/tests/install/lib/libtest/build/export.build b/tests/install/lib/libtest/build/export.build deleted file mode 100644 index e8b12b3..0000000 --- a/tests/install/lib/libtest/build/export.build +++ /dev/null @@ -1,6 +0,0 @@ -$out_root/: -{ - include test/ -} - -export $out_root/test/lib{test} diff --git a/tests/install/lib/libtest/build/root.build b/tests/install/lib/libtest/build/root.build deleted file mode 100644 index 20536a2..0000000 --- a/tests/install/lib/libtest/build/root.build +++ /dev/null @@ -1,11 +0,0 @@ -using cxx - -hxx{*}: extension = hxx -ixx{*}: extension = ixx -cxx{*}: extension = cxx - -tests/: -{ - exe{*}: test = true - install = false -} diff --git a/tests/install/lib/libtest/buildfile b/tests/install/lib/libtest/buildfile deleted file mode 100644 index 32dd3f2..0000000 --- a/tests/install/lib/libtest/buildfile +++ /dev/null @@ -1,3 +0,0 @@ -d = doc/ test/ tests/ -./: $d -include $d diff --git a/tests/install/lib/libtest/doc/buildfile b/tests/install/lib/libtest/doc/buildfile deleted file mode 100644 index dfc1701..0000000 --- a/tests/install/lib/libtest/doc/buildfile +++ /dev/null @@ -1 +0,0 @@ -./: doc{test.txt} man1{test} diff --git a/tests/install/lib/libtest/doc/test.1 b/tests/install/lib/libtest/doc/test.1 deleted file mode 100644 index 0a32f2b..0000000 --- a/tests/install/lib/libtest/doc/test.1 +++ /dev/null @@ -1,5 +0,0 @@ -.TH TEST 1 -.SH NAME -test \- this is a test -.SH SYNOPSIS -.B test-driver diff --git a/tests/install/lib/libtest/doc/test.txt b/tests/install/lib/libtest/doc/test.txt deleted file mode 100644 index 484ba93..0000000 --- a/tests/install/lib/libtest/doc/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test. diff --git a/tests/install/lib/libtest/test/buildfile b/tests/install/lib/libtest/test/buildfile deleted file mode 100644 index 343bc30..0000000 --- a/tests/install/lib/libtest/test/buildfile +++ /dev/null @@ -1,10 +0,0 @@ -cxx.poptions += -I$src_root - -install.include = $install.include/test/ - -lib{test}: cxx{utility} hxx{utility} -lib{test}: cxx.export.poptions = -I$src_root - -exe{driver}: cxx{driver} hxx{driver} lib{test} - -./: lib{test} exe{driver} diff --git a/tests/install/lib/libtest/test/driver.cxx b/tests/install/lib/libtest/test/driver.cxx deleted file mode 100644 index fbb6643..0000000 --- a/tests/install/lib/libtest/test/driver.cxx +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include "driver.hxx" - -int main () {return test::f ();} diff --git a/tests/install/lib/libtest/test/driver.hxx b/tests/install/lib/libtest/test/driver.hxx deleted file mode 100644 index e69de29..0000000 diff --git a/tests/install/lib/libtest/test/utility.cxx b/tests/install/lib/libtest/test/utility.cxx deleted file mode 100644 index 2016b45..0000000 --- a/tests/install/lib/libtest/test/utility.cxx +++ /dev/null @@ -1,6 +0,0 @@ -#include - -namespace test -{ - int f () {return 0;} -} diff --git a/tests/install/lib/libtest/test/utility.hxx b/tests/install/lib/libtest/test/utility.hxx deleted file mode 100644 index 1a9dd72..0000000 --- a/tests/install/lib/libtest/test/utility.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace test -{ - int f (); -} - diff --git a/tests/install/lib/libtest/tests/buildfile b/tests/install/lib/libtest/tests/buildfile deleted file mode 100644 index 72d549a..0000000 --- a/tests/install/lib/libtest/tests/buildfile +++ /dev/null @@ -1,2 +0,0 @@ -exe{driver}: cxx{driver} ../test/lib{test} -include ../test/ diff --git a/tests/install/lib/libtest/tests/driver.cxx b/tests/install/lib/libtest/tests/driver.cxx deleted file mode 100644 index 9a12f9d..0000000 --- a/tests/install/lib/libtest/tests/driver.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include - -int main () {return test::f ();} diff --git a/tests/install/simple/README b/tests/install/simple/README deleted file mode 100644 index 484ba93..0000000 --- a/tests/install/simple/README +++ /dev/null @@ -1 +0,0 @@ -This is a test. diff --git a/tests/install/simple/build/bootstrap.build b/tests/install/simple/build/bootstrap.build deleted file mode 100644 index 40e665b..0000000 --- a/tests/install/simple/build/bootstrap.build +++ /dev/null @@ -1,4 +0,0 @@ -project = install-simple -amalgamation = # Disabled. -using config -using install diff --git a/tests/install/simple/buildfile b/tests/install/simple/buildfile deleted file mode 100644 index d37f63f..0000000 --- a/tests/install/simple/buildfile +++ /dev/null @@ -1,4 +0,0 @@ -using cxx - -exe{driver}: cxx{driver} hxx{utility} doc{README} -exe{driver}: install = sbin/ diff --git a/tests/install/simple/driver.cxx b/tests/install/simple/driver.cxx deleted file mode 100644 index 1b28c94..0000000 --- a/tests/install/simple/driver.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "utility.hxx" - -int main () {return result;} diff --git a/tests/install/simple/utility.hxx b/tests/install/simple/utility.hxx deleted file mode 100644 index 1b8e18e..0000000 --- a/tests/install/simple/utility.hxx +++ /dev/null @@ -1,2 +0,0 @@ -const int result = 0; - diff --git a/tests/keyword/buildfile b/tests/keyword/buildfile deleted file mode 100644 index cd91d33..0000000 --- a/tests/keyword/buildfile +++ /dev/null @@ -1,23 +0,0 @@ -# Quoting. -# -"print" = a -'print' += b -pr"int" += c -print'' += d - -# Not = or +=. -# -print += e - -print $print - -# ( -# -print(test) - -# Separated. -# -define print: file -print{foo}: - -./: diff --git a/tests/keyword/test.out b/tests/keyword/test.out deleted file mode 100644 index 729af10..0000000 --- a/tests/keyword/test.out +++ /dev/null @@ -1,2 +0,0 @@ -a b c d e -test diff --git a/tests/keyword/test.sh b/tests/keyword/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/keyword/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/lexer/buildfile b/tests/lexer/buildfile deleted file mode 100644 index 9a17904..0000000 --- a/tests/lexer/buildfile +++ /dev/null @@ -1,7 +0,0 @@ -# file : tests/lexer/buildfile -# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -import libs = libbutl%lib{butl} - -exe{driver}: cxx{driver ../../build/{lexer diagnostics utility}} $libs diff --git a/tests/lexer/driver.cxx b/tests/lexer/driver.cxx deleted file mode 100644 index 5575956..0000000 --- a/tests/lexer/driver.cxx +++ /dev/null @@ -1,179 +0,0 @@ -// file : tests/build/lexer/driver.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include -#include -#include -#include -#include - -#include -#include - -using namespace std; -using namespace build; - -using tokens = vector; - -static tokens -lex (const char*); - -ostream& -operator<< (ostream&, const tokens&); - -int -main () -{ - ostream cnull (nullptr); - diag_stream = &cnull; - - // Whitespaces. - // - assert (lex ("") == tokens ({""})); - assert (lex ("\n") == tokens ({""})); - assert (lex ("\n\n") == tokens ({""})); - assert (lex (" \t \n") == tokens ({""})); - assert (lex ("#comment") == tokens ({""})); - assert (lex (" #comment") == tokens ({""})); - assert (lex ("#comment\n") == tokens ({""})); - assert (lex ("#comment\\\n") == tokens ({""})); - assert (lex ("#comment 1\n#comment2") == tokens ({""})); - - // Punctuation. - // - assert (lex (": \n { }") == tokens ({":", "\n", "{", "}", ""})); - - // Names. - // - assert (lex ("foo") == tokens ({"foo", ""})); - assert (lex ("foo.bar") == tokens ({"foo.bar", ""})); - - // Escaping. - // - assert (lex (" \\\n") == tokens ({""})); - assert (lex ("\\\nfoo") == tokens ({"foo", ""})); - assert (lex (" \\ foo") == tokens ({" foo", ""})); - assert (lex ("fo\\ o\\:") == tokens ({"fo o:", ""})); - assert (lex ("foo\\\nbar") == tokens ({"foobar", ""})); - assert (lex ("foo \\\nbar") == tokens ({"foo", "bar", ""})); - assert (lex ("\\'foo") == tokens ({"'foo", ""})); - - assert (lex (" \\") == tokens ({""})); - assert (lex (" foo\\") == tokens ({""})); - - - // Quoting ''. - // - assert (lex ("''") == tokens ({"", ""})); - assert (lex ("'foo'") == tokens ({"foo", ""})); - assert (lex ("'foo bar'") == tokens ({"foo bar", ""})); - assert (lex ("'foo 'bar") == tokens ({"foo bar", ""})); - assert (lex ("foo' bar'") == tokens ({"foo bar", ""})); - assert (lex ("'foo ''bar'") == tokens ({"foo bar", ""})); - assert (lex ("foo' 'bar") == tokens ({"foo bar", ""})); - assert (lex ("'foo\nbar'") == tokens ({"foo\nbar", ""})); - assert (lex ("'#:${}()=+\n'") == tokens ({"#:${}()=+\n", ""})); - assert (lex ("'\"'") == tokens ({"\"", ""})); - assert (lex ("'\\'") == tokens ({"\\", ""})); - - assert (lex ("'foo bar") == tokens ({""})); - - // Quoting "". - // - assert (lex ("\"\"") == tokens ({"", ""})); - assert (lex ("\"foo\"") == tokens ({"foo", ""})); - assert (lex ("\"foo bar\"") == tokens ({"foo bar", ""})); - assert (lex ("\"foo \"bar") == tokens ({"foo bar", ""})); - assert (lex ("foo\" bar\"") == tokens ({"foo bar", ""})); - assert (lex ("\"foo \"\"bar\"") == tokens ({"foo bar", ""})); - assert (lex ("foo\" \"bar") == tokens ({"foo bar", ""})); - assert (lex ("\"foo\nbar\"") == tokens ({"foo\nbar", ""})); - assert (lex ("\"#:{})=+\n\"") == tokens ({"#:{})=+\n", ""})); - assert (lex ("\"'\"") == tokens ({"'", ""})); - assert (lex ("\"\\\"") == tokens ({"\\", ""})); - - assert (lex ("\"$\"") == tokens ({"", "$", "", ""})); - assert (lex ("\"foo$bar\"") == tokens ({"foo", "$", "bar", ""})); - assert (lex ("foo\"$\"bar") == tokens ({"foo", "$", "bar", ""})); - assert (lex ("f\"oo$ba\"r") == tokens ({"foo", "$", "bar", ""})); - - assert (lex ("\"foo bar") == tokens ({""})); - assert (lex ("\"foo $") == tokens ({"foo ", "$", ""})); - assert (lex ("\"foo $bar") == tokens ({"foo ", "$", ""})); - - // Combinations. - // - assert (lex ("foo: bar") == tokens ({"foo", ":", "bar", ""})); - assert (lex ("\n \nfoo: bar") == tokens ({"foo", ":", "bar", ""})); - assert (lex ("foo: bar\n") == tokens ({"foo", ":", "bar", "\n", ""})); - assert (lex ("foo: bar#comment") == tokens ({"foo", ":", "bar", ""})); - assert (lex ("exe{foo}: obj{bar}") == - tokens ({"exe", "{", "foo", "}", ":", "obj", "{", "bar", "}", ""})); - assert (lex ("foo: bar\nbaz: biz") == - tokens ({"foo", ":", "bar", "\n", "baz", ":", "biz", ""})); - assert (lex ("foo: bar#comment\nbaz: biz") == - tokens ({"foo", ":", "bar", "\n", "baz", ":", "biz", ""})); - assert (lex ("foo:#comment \\\nbar") == - tokens ({"foo", ":", "\n", "bar", ""})); -} - -static tokens -lex (const char* s) -{ - tokens r; - istringstream is (s); - - is.exceptions (istream::failbit | istream::badbit); - lexer l (is, ""); - - try - { - for (token t (l.next ());; t = l.next ()) - { - string v; - - switch (t.type) - { - case token_type::eos: v = ""; break; - case token_type::newline: v = "\n"; break; - case token_type::pair_separator: v = l.pair_separator (); break; - case token_type::colon: v = ":"; break; - case token_type::lcbrace: v = "{"; break; - case token_type::rcbrace: v = "}"; break; - case token_type::equal: v = "="; break; - case token_type::plus_equal: v = "+="; break; - case token_type::dollar: v = "$"; break; - case token_type::lparen: v = "("; break; - case token_type::rparen: v = ")"; break; - case token_type::name: v = t.value.c_str (); break; - } - - // cerr << t.line () << ':' << t.column () << ':' << v << endl; - - r.push_back (move (v)); - - if (t.type == token_type::eos) - break; - } - } - catch (const failed&) - { - r.push_back (""); - } - catch (const io_error&) - { - r.push_back (""); - } - - return r; -} - -ostream& -operator<< (ostream& os, const tokens& ts) -{ - for (const string& t: ts) - os << '"' << t << '"' << ' '; - - return os; -} diff --git a/tests/names/buildfile b/tests/names/buildfile deleted file mode 100644 index 0f3d482..0000000 --- a/tests/names/buildfile +++ /dev/null @@ -1,54 +0,0 @@ -# Name separation. -# -print foo {bar baz} -print fox/ {bar baz} -print fox/foo {bar baz} - -# Name "crosses". -# -print {}{bar} # Same as bar. -print {foo}{} # Same as foo{} (empty name of type foo). -print foo{} # For compatiron. -print {foo}{bar} -print {foo}{bar baz} -print {foo fox}{bar} -print {foo fox}{bar baz} - -print dir/{}{bar} # Same as dir/bar. -print dir/{foo}{} # Same as dir/foo{} (directory of type foo). -print dir/foo{} # For comparison. -print dir/{foo}{bar} -print dir/{foo}{bar baz} -print dir/{foo fox}{bar} -print dir/{foo fox}{bar baz} - -print {dir/}{bar} -print {dir/}{bar baz} -print {dir/ dor/}{bar} -print {dir/ dor/}{bar baz} - -print {dir/foo}{bar} -print {dir/foo}{bar baz} -print {dir/foo dor/fox}{bar} -print {dir/foo dor/fox}{bar baz} - -print {dir/}{foo}{bar} -print {dir/}{foo}{bar baz} -print {dir/ dor/}{foo}{bar} -print {dir/ dor/}{foo fox}{bar baz} - -print {prj%foo}{bar baz} -print {foo}{bar prj%baz} -#print {prj%foo}{bar prk%baz} # nested project name - -print dir/{foo}{bar baz} -print {foo}{bar dir/{baz}} -print dir/{foo}{bar dor/{baz}} - -print {dir/foo{}}{bar} -print {dir/{foo}}{bar} -print {dir/}{foo{bar}} -#print {dir/foo{fox}}{bar} # nested type name -#print {dir/foo}{fox{bar}} # nested type name - -./: diff --git a/tests/names/test.out b/tests/names/test.out deleted file mode 100644 index 280c372..0000000 --- a/tests/names/test.out +++ /dev/null @@ -1,37 +0,0 @@ -foo bar baz -fox/ bar baz -fox/foo bar baz -bar -foo{} -foo{} -foo{bar} -foo{bar} foo{baz} -foo{bar} fox{bar} -foo{bar} fox{bar} foo{baz} fox{baz} -dir/bar -foo{dir/} -foo{dir/} -dir/foo{bar} -dir/foo{bar} dir/foo{baz} -dir/foo{bar} dir/fox{bar} -dir/foo{bar} dir/fox{bar} dir/foo{baz} dir/fox{baz} -dir/bar -dir/bar dir/baz -dir/bar dor/bar -dir/bar dor/bar dir/baz dor/baz -dir/foo{bar} -dir/foo{bar} dir/foo{baz} -dir/foo{bar} dor/fox{bar} -dir/foo{bar} dor/fox{bar} dir/foo{baz} dor/fox{baz} -dir/foo{bar} -dir/foo{bar} dir/foo{baz} -dir/foo{bar} dor/foo{bar} -dir/foo{bar} dor/foo{bar} dir/fox{bar} dor/fox{bar} dir/foo{baz} dor/foo{baz} dir/fox{baz} dor/fox{baz} -prj%foo{bar} prj%foo{baz} -foo{bar} prj%foo{baz} -dir/foo{bar} dir/foo{baz} -foo{bar} dir/foo{baz} -dir/foo{bar} dir/dor/foo{baz} -dir/foo{bar} -dir/foo{bar} -dir/foo{bar} diff --git a/tests/names/test.sh b/tests/names/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/names/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/pairs/buildfile b/tests/pairs/buildfile deleted file mode 100644 index 3b55044..0000000 --- a/tests/pairs/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -print foo@bar # foo@bar -print foo@{bar} # foo@bar -print {foo}@bar # foo@bar -print {foo@bar} # foo@bar -print {{foo}@{bar}} # foo@bar -print "{foo}@bar" # {foo}@bar - -print foo@ # foo@{} -print {foo}@ # foo@{} -print {foo}@{} # foo@{} -print {foo}@ {FOO}@ # foo@{} FOO@{} -v=foo@ -print $v # foo@{} - -print @bar # {}@bar -print @{bar} # {}@bar -print {}@{bar} # {}@bar -print @{BAR} @{bar} # {}@BAR {}@bar -v=@bar -print $v # {}@bar - -print @ # {}@{} -print @{} # {}@{} -print {}@ # {}@{} -print {}@{} # {}@{} -print {@} # {}@{} -v=@ -print $v # {}@{} - -print @ @ # {}@{} {}@{} -v=@ @ -print $v # {}@{} {}@{} - -print @{bar BAR} # {}@bar {}@BAR -print @{bar {BAR}} # {}@bar {}@BAR -print foo@{bar BAR} # foo@bar foo@BAR - -#print @@ # error: double pair separator - -./: diff --git a/tests/pairs/test.out b/tests/pairs/test.out deleted file mode 100644 index 6033c84..0000000 --- a/tests/pairs/test.out +++ /dev/null @@ -1,27 +0,0 @@ -foo@bar -foo@bar -foo@bar -foo@bar -foo@bar -{foo}@bar -foo@{} -foo@{} -foo@{} -foo@{} FOO@{} -foo@{} -{}@bar -{}@bar -{}@bar -{}@BAR {}@bar -{}@bar -{}@{} -{}@{} -{}@{} -{}@{} -{}@{} -{}@{} -{}@{} {}@{} -{}@{} {}@{} -{}@bar {}@BAR -{}@bar {}@BAR -foo@bar foo@BAR diff --git a/tests/pairs/test.sh b/tests/pairs/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/pairs/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/parser/buildfile b/tests/parser/buildfile deleted file mode 100644 index ec158fa..0000000 --- a/tests/parser/buildfile +++ /dev/null @@ -1,9 +0,0 @@ -# file : tests/parser/buildfile -# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -import libs = libbutl%lib{butl} - -exe{driver}: cxx{driver ../../build/{token lexer parser scope target \ - prerequisite variable operation rule search algorithm file module dump \ - context diagnostics name path-io utility}} $libs diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx deleted file mode 100644 index 7c73937..0000000 --- a/tests/parser/driver.cxx +++ /dev/null @@ -1,195 +0,0 @@ -// file : tests/build/parser/driver.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -using namespace std; -using namespace build; - -static bool -parse (const char*); - -static names -parse_names (const char* s, lexer_mode m, bool chunk); - -static names -chunk_names (const char* s) -{ - return parse_names (s, lexer_mode::pairs, true); -} - -int -main () -{ - ostream cnull (nullptr); - diag_stream = &cnull; - - reset (); - - global_scope->assign ("foo") = "FOO"; - global_scope->assign ("bar") = "BAR"; - - // names() in chunking mode. - // - assert (chunk_names ("{}") == names ({name ()})); - assert (chunk_names ("foo") == names ({name ("foo")})); - assert (chunk_names ("foo bar") == names ({name ("foo")})); - assert (chunk_names ("{foo bar}") == names ({name ("foo"), name ("bar")})); - assert (chunk_names ("dir{foo bar}") == names ({name ("dir", "foo"), - name ("dir", "bar")})); - assert (chunk_names ("dir{foo bar} baz") == names ({name ("dir", "foo"), - name ("dir", "bar")})); - assert (chunk_names ("dir {foo bar}") == names ({name ("dir", "foo"), - name ("dir", "bar")})); - assert (chunk_names ("dir {foo bar} baz") == names ({name ("dir", "foo"), - name ("dir", "bar")})); - assert (chunk_names ("{} foo") == names ({name ()})); - - // Expansion. - // - assert (chunk_names ("$foo $bar baz") == names ({name ("FOO")})); - assert (chunk_names ("$foo$bar baz") == names ({name ("FOOBAR")})); - - assert (chunk_names ("foo(bar)") == names ({name ("foobar")})); - assert (chunk_names ("foo (bar)") == names ({name ("foo")})); - - assert (chunk_names ("\"$foo\"(bar)") == names ({name ("FOObar")})); - assert (chunk_names ("\"$foo\" (bar)") == names ({name ("FOO")})); - - // Quoting. - // - assert (chunk_names ("\"$foo $bar\" baz") == names ({name ("FOO BAR")})); - - // Pairs. - // - assert (chunk_names ("foo=bar") == names ({name ("foo"), name ("bar")})); - assert (chunk_names ("foo = bar x") == names ({name ("foo"), name ("bar")})); - - // General. - // - assert (parse ("")); - assert (parse ("foo:")); - assert (parse ("foo bar:")); - assert (parse ("foo:\nbar:")); - assert (parse ("foo: bar")); - assert (parse ("foo: bar baz")); - assert (parse ("foo bar: baz biz")); - - assert (parse ("{foo}:")); - assert (parse ("{foo bar}:")); - assert (parse ("{{foo bar}}:")); - assert (parse ("{{foo bar} {baz} {biz fox} fix}:")); - - assert (parse ("file{foo}:")); - assert (parse ("file{foo bar}:")); - assert (parse ("{file{foo bar}}:")); - assert (parse ("file{{foo bar} fox}:")); - assert (parse ("file{foo}: file{bar baz} biz.o file{fox}")); - - //assert (!parse (":")); - assert (!parse ("foo")); - assert (!parse ("{")); - assert (!parse ("{foo:")); - assert (!parse ("{foo{:")); - assert (!parse ("foo: bar:")); - assert (!parse ("file{foo:")); - - // Directory prefix. - // - assert (parse ("../{foo}: ../{bar}")); - assert (parse ("../file{foo}: ../file{bar}")); - assert (!parse ("../file{file{foo}}:")); - - // Directory scope. - // - assert (parse ("test/:\n{\n}")); - assert (parse ("test/:\n{\n}\n")); - assert (parse ("test/:\n{\nfoo:bar\n}")); - assert (parse ("test/:\n{\nfoo:bar\n}")); - assert (parse ("test/:\n{\nmore/:\n{\n}\n}")); - assert (parse ("test/:\n{\nmore/:\n{\nfoo:{bar baz}\n}\n}")); - - assert (!parse ("test/:\n{")); - assert (!parse ("test/:\n{\n")); - assert (!parse ("test/:\n{\n:")); - assert (!parse ("test/:\n{\n} foo: bar\n")); - assert (!parse ("test/ foo:\n{\n}")); - assert (!parse ("test foo/:\n{\n}")); - assert (!parse ("test/ foo/:\n{\n}")); -} - -struct test_parser: parser -{ - names_type - test_names (const char*, lexer_mode, bool chunk); -}; - -static bool -parse (const char* s) -{ - reset (); // Clear the state. - - // Create a minimal root scope. - // - auto i (scopes.insert (path::current (), nullptr, true, true)); - scope& root (*i->second); - root.src_path_ = root.out_path_ = &i->first; - - istringstream is (s); - - is.exceptions (istream::failbit | istream::badbit); - parser p; - - try - { - p.parse_buildfile (is, path (), root, root); - } - catch (const failed&) - { - return false; - } - - return true; -} - -// parser::names() -// -names test_parser:: -test_names (const char* s, lexer_mode m, bool chunk) -{ - istringstream is (s); - is.exceptions (istream::failbit | istream::badbit); - lexer l (is, ""); - - if (m != lexer_mode::normal) - l.mode (m, '='); - - path_ = &l.name (); - lexer_ = &l; - target_ = nullptr; - scope_ = root_ = global_scope; - - token t (token_type::eos, false, 0, 0); - token_type tt; - next (t, tt); - return names (t, tt, chunk); -} - -static names -parse_names (const char* s, lexer_mode m, bool chunk) -{ - test_parser p; - return p.test_names (s, m, chunk); -} diff --git a/tests/postponed/build/bootstrap.build b/tests/postponed/build/bootstrap.build deleted file mode 100644 index 42ba33a..0000000 --- a/tests/postponed/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = postponed -amalgamation = # Disabled. -using config diff --git a/tests/postponed/buildfile b/tests/postponed/buildfile deleted file mode 100644 index 53873aa..0000000 --- a/tests/postponed/buildfile +++ /dev/null @@ -1,5 +0,0 @@ -using cxx - -exe{driver}: cxx{driver} fsdir{$out_root/out} - -./: exe{driver} diff --git a/tests/postponed/driver.cxx b/tests/postponed/driver.cxx deleted file mode 100644 index 70b4146..0000000 --- a/tests/postponed/driver.cxx +++ /dev/null @@ -1,4 +0,0 @@ -int -main () -{ -} diff --git a/tests/postponed/out/dummy b/tests/postponed/out/dummy deleted file mode 100644 index e69de29..0000000 diff --git a/tests/quote/buildfile b/tests/quote/buildfile deleted file mode 100644 index e8951b5..0000000 --- a/tests/quote/buildfile +++ /dev/null @@ -1,51 +0,0 @@ -print "foo bar" -print "foo -bar" - -foo = "fo o" -bar = " bar " - -print "$foo" -print "$bar" -print "$foo $bar" -print "$foo$bar" - -print "[ $foo ]" -print "[ $bar ]" -print "[ $foo $bar ]" -print "[ $foo/$bar ]" - -print $foo'bar' -print $foo"$bar" -print "$foo"bar - -# Quoting and evaluation context. -# -print ("x{foo bar}") -#print "(x{foo bar})" # multiple values in concatenating context expansion -print "({foo})" -print "('foo bar')" -print "("foo bar")" -print "("$foo bar")" -print "("$foo ($bar)")" - -# Quoting and escaping/multiline. -# -print \ -"foo"\ -"bar" - -print \ -"foo\ -bar" - -print \ -'foo\ -bar' - -print \ -"foo (fox \ -) -bar" - -./: diff --git a/tests/quote/test.out b/tests/quote/test.out deleted file mode 100644 index 33450a5..0000000 --- a/tests/quote/test.out +++ /dev/null @@ -1,26 +0,0 @@ -foo bar -foo -bar -fo o - bar -fo o bar -fo o bar -[ fo o ] -[ bar ] -[ fo o bar ] -[ fo o/ bar ] -fo obar -fo o bar -fo obar -x{foo bar} -foo -foo bar -foo bar -fo o bar -fo o bar -foobar -foobar -foo\ -bar -foo fox -bar diff --git a/tests/quote/test.sh b/tests/quote/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/quote/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/scope/amalgamation/build/bootstrap.build b/tests/scope/amalgamation/build/bootstrap.build deleted file mode 100644 index ee73365..0000000 --- a/tests/scope/amalgamation/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = scope-amalgamation -amalgamation = # Disabled. -using config diff --git a/tests/scope/amalgamation/buildfile b/tests/scope/amalgamation/buildfile deleted file mode 100644 index 9f80de9..0000000 --- a/tests/scope/amalgamation/buildfile +++ /dev/null @@ -1 +0,0 @@ -./: diff --git a/tests/scope/amalgamation/l1/build/bootstrap.build b/tests/scope/amalgamation/l1/build/bootstrap.build deleted file mode 100644 index 6bde838..0000000 --- a/tests/scope/amalgamation/l1/build/bootstrap.build +++ /dev/null @@ -1,16 +0,0 @@ -project = scope-amalgamation-l1 -using config - -# At this stage we don't know ../ is a project. This -# tests an out-of-project scope that will later be -# replaced with an in-project scope. Note that the -# replacement will only occur if src_root != out_root. -# If they are the same, then this scope will simply -# be "upgraded". -# -$src_root/../: -{ - print 0: $project - print 0: $src_base - print 0: $out_base -} diff --git a/tests/scope/amalgamation/l1/buildfile b/tests/scope/amalgamation/l1/buildfile deleted file mode 100644 index 55d8c64..0000000 --- a/tests/scope/amalgamation/l1/buildfile +++ /dev/null @@ -1,37 +0,0 @@ -# Out of amalgamation. -# -../../: -{ - print -1: $project - print -1: $src_base - print -1: $out_base -} - -# In amalgamation. -# -../s/: -{ - print 0: $project - print 0: $src_base - print 0: $out_base -} - -# In project. -# -s/: -{ - print 1: $project - print 1: $src_base - print 1: $out_base -} - -# In sub-project. -# -l2/s/: -{ - print 2: $project - print 2: $src_base - print 2: $out_base -} - -./: diff --git a/tests/scope/amalgamation/l1/l2/build/bootstrap.build b/tests/scope/amalgamation/l1/l2/build/bootstrap.build deleted file mode 100644 index 0262763..0000000 --- a/tests/scope/amalgamation/l1/l2/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = scope-amalgamation-l2 -using config diff --git a/tests/scope/test-1.out b/tests/scope/test-1.out deleted file mode 100644 index 0273bf1..0000000 --- a/tests/scope/test-1.out +++ /dev/null @@ -1,15 +0,0 @@ -0: -0: -0: --1: --1: --1: -0: scope-amalgamation -0: /home/boris/work/build2/build2/tests/scope/amalgamation/s/ -0: /home/boris/work/build2/build2/tests/scope/amalgamation/s/ -1: scope-amalgamation-l1 -1: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/s/ -1: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/s/ -2: scope-amalgamation-l2 -2: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/l2/s/ -2: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/l2/s/ diff --git a/tests/scope/test-2.out b/tests/scope/test-2.out deleted file mode 100644 index 88f9620..0000000 --- a/tests/scope/test-2.out +++ /dev/null @@ -1,15 +0,0 @@ -0: -0: -0: --1: --1: --1: -0: scope-amalgamation -0: /home/boris/work/build2/build2/tests/scope/amalgamation/s/ -0: /home/boris/work/build2/build2/tests/scope/a-out/s/ -1: scope-amalgamation-l1 -1: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/s/ -1: /home/boris/work/build2/build2/tests/scope/a-out/l1/s/ -2: scope-amalgamation-l2 -2: /home/boris/work/build2/build2/tests/scope/amalgamation/l1/l2/s/ -2: /home/boris/work/build2/build2/tests/scope/a-out/l1/l2/s/ diff --git a/tests/scope/test.sh b/tests/scope/test.sh deleted file mode 100755 index 2728a9d..0000000 --- a/tests/scope/test.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# In-tree. -# -b amalgamation/l1/ 2>/dev/null | diff --strip-trailing-cr -u test-1.out - - -# Out-of-tree. -# -rm -rf a-out/ -b 'configure(amalgamation/@a-out/)' 2>/dev/null - -b amalgamation/l1/@a-out/l1/ 2>/dev/null | \ - diff --strip-trailing-cr -u test-2.out - - -rm -rf a-out/ diff --git a/tests/semantics/include/buildfile b/tests/semantics/include/buildfile deleted file mode 120000 index 361dcf4..0000000 --- a/tests/semantics/include/buildfile +++ /dev/null @@ -1 +0,0 @@ -includer \ No newline at end of file diff --git a/tests/semantics/include/includee1 b/tests/semantics/include/includee1 deleted file mode 100644 index 70ed3fc..0000000 --- a/tests/semantics/include/includee1 +++ /dev/null @@ -1 +0,0 @@ -print includee1 \ No newline at end of file diff --git a/tests/semantics/include/includee2 b/tests/semantics/include/includee2 deleted file mode 100644 index 762825b..0000000 --- a/tests/semantics/include/includee2 +++ /dev/null @@ -1 +0,0 @@ -print includee2 diff --git a/tests/semantics/include/includee4 b/tests/semantics/include/includee4 deleted file mode 100644 index 4964d81..0000000 --- a/tests/semantics/include/includee4 +++ /dev/null @@ -1 +0,0 @@ -print includee4 diff --git a/tests/semantics/include/includer b/tests/semantics/include/includer deleted file mode 100644 index 70527a5..0000000 --- a/tests/semantics/include/includer +++ /dev/null @@ -1,10 +0,0 @@ -include -include includee1 -include includee1 ../include/includee2 # includee1 is skipped -include nested/includee3 -nested/: -{ - include includee5 - include ../includee2 # skipped -} -: diff --git a/tests/semantics/include/nested/includee3 b/tests/semantics/include/nested/includee3 deleted file mode 100644 index 7196e82..0000000 --- a/tests/semantics/include/nested/includee3 +++ /dev/null @@ -1,2 +0,0 @@ -print nested/includee3 -include ../includee4 diff --git a/tests/semantics/include/nested/includee5 b/tests/semantics/include/nested/includee5 deleted file mode 100644 index b4c9c74..0000000 --- a/tests/semantics/include/nested/includee5 +++ /dev/null @@ -1 +0,0 @@ -print nested/includee5 diff --git a/tests/semantics/include/test.std b/tests/semantics/include/test.std deleted file mode 100644 index 559584c..0000000 --- a/tests/semantics/include/test.std +++ /dev/null @@ -1,5 +0,0 @@ -includee1 -includee2 -nested/includee3 -includee4 -nested/includee5 diff --git a/tests/semantics/source/buildfile b/tests/semantics/source/buildfile deleted file mode 120000 index b6d1987..0000000 --- a/tests/semantics/source/buildfile +++ /dev/null @@ -1 +0,0 @@ -sourcer \ No newline at end of file diff --git a/tests/semantics/source/nested/sourcee3 b/tests/semantics/source/nested/sourcee3 deleted file mode 100644 index cdf51fb..0000000 --- a/tests/semantics/source/nested/sourcee3 +++ /dev/null @@ -1 +0,0 @@ -print nested/sourcee3 \ No newline at end of file diff --git a/tests/semantics/source/sourcee1 b/tests/semantics/source/sourcee1 deleted file mode 100644 index 683cd1f..0000000 --- a/tests/semantics/source/sourcee1 +++ /dev/null @@ -1 +0,0 @@ -print sourcee1 \ No newline at end of file diff --git a/tests/semantics/source/sourcee2 b/tests/semantics/source/sourcee2 deleted file mode 100644 index c989838..0000000 --- a/tests/semantics/source/sourcee2 +++ /dev/null @@ -1 +0,0 @@ -print sourcee2 diff --git a/tests/semantics/source/sourcer b/tests/semantics/source/sourcer deleted file mode 100644 index eb1310e..0000000 --- a/tests/semantics/source/sourcer +++ /dev/null @@ -1,9 +0,0 @@ -source -source sourcee1 -source sourcee1 ../source/sourcee2 -nested/: -{ - source sourcee3 - source ../sourcee1 -} -: diff --git a/tests/semantics/source/test.std b/tests/semantics/source/test.std deleted file mode 100644 index 84d94b7..0000000 --- a/tests/semantics/source/test.std +++ /dev/null @@ -1,5 +0,0 @@ -sourcee1 -sourcee1 -sourcee2 -nested/sourcee3 -sourcee1 diff --git a/tests/simple/build/bootstrap.build b/tests/simple/build/bootstrap.build deleted file mode 100644 index 7ee30cb..0000000 --- a/tests/simple/build/bootstrap.build +++ /dev/null @@ -1,3 +0,0 @@ -project = simple -amalgamation = # Disabled. -using config diff --git a/tests/simple/buildfile b/tests/simple/buildfile deleted file mode 100644 index ea1d8fa..0000000 --- a/tests/simple/buildfile +++ /dev/null @@ -1,3 +0,0 @@ -using cxx - -exe{driver}: cxx{driver} diff --git a/tests/simple/driver.cxx b/tests/simple/driver.cxx deleted file mode 100644 index 5b076c7..0000000 --- a/tests/simple/driver.cxx +++ /dev/null @@ -1,8 +0,0 @@ -#include - -using namespace std; - -int -main () -{ -} diff --git a/tests/target/out-qualified/src/build/bootstrap.build b/tests/target/out-qualified/src/build/bootstrap.build deleted file mode 100644 index 056ee6f..0000000 --- a/tests/target/out-qualified/src/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = test -amalgamation = diff --git a/tests/target/out-qualified/src/buildfile b/tests/target/out-qualified/src/buildfile deleted file mode 100644 index 1bcaa32..0000000 --- a/tests/target/out-qualified/src/buildfile +++ /dev/null @@ -1,5 +0,0 @@ -./: file{foo} - -# Use --verbose 6 to debug. -# -file{foo}@./: x = y diff --git a/tests/target/out-qualified/src/foo b/tests/target/out-qualified/src/foo deleted file mode 100644 index e69de29..0000000 diff --git a/tests/target/out-qualified/test.sh b/tests/target/out-qualified/test.sh deleted file mode 100755 index f1ece0e..0000000 --- a/tests/target/out-qualified/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q src/@out/ diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100755 index de93322..0000000 --- a/tests/test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env bash - -cur_dir="`pwd`" -trap 'cd "$cur_dir"' EXIT - -export PATH=$cur_dir/../build2:$PATH - -function test () -{ - echo "testing $1" - cd "$cur_dir/$1" - ./test.sh -} - -test "amalgam/unnamed" -test "escaping" -test "eval" -test "if-else" -test "keyword" -test "names" -test "pairs" -test "quote" -test "scope" -test "target/out-qualified" -test "variable/dir-path" -test "variable/expansion" -test "variable/null" -test "variable/override" -test "variable/prepend" -test "variable/qualified" -test "variable/representation" -test "variable/type" -test "variable/type-pattern-append" diff --git a/tests/test/generated/build/bootstrap.build b/tests/test/generated/build/bootstrap.build deleted file mode 100644 index 5428eb8..0000000 --- a/tests/test/generated/build/bootstrap.build +++ /dev/null @@ -1,4 +0,0 @@ -project = test-generated -amalgamation = # Disabled. -using config -using test diff --git a/tests/test/generated/buildfile b/tests/test/generated/buildfile deleted file mode 100644 index aacca8b..0000000 --- a/tests/test/generated/buildfile +++ /dev/null @@ -1,9 +0,0 @@ -# Test generated input. -# -using cxx - -exe{utility}: cxx{utility} -exe{driver}: cxx{driver} -exe{driver}: test.input = exe{utility} - -./: exe{driver} diff --git a/tests/test/generated/driver.cxx b/tests/test/generated/driver.cxx deleted file mode 100644 index 008dbf7..0000000 --- a/tests/test/generated/driver.cxx +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -using namespace std; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " " << endl; - return 1; - } - - ifstream ifs (argv[1], ifstream::in | ifstream::binary | ifstream::ate); - - if (!ifs.is_open ()) - cerr << "unable to open " << argv[1] << endl; - - if (ifs.tellg () == 0) - cerr << argv[1] << " is empty" << endl; - - return 0; -} diff --git a/tests/test/generated/utility.cxx b/tests/test/generated/utility.cxx deleted file mode 100644 index ca2ac4a..0000000 --- a/tests/test/generated/utility.cxx +++ /dev/null @@ -1 +0,0 @@ -int main () {} diff --git a/tests/test/simple/build/bootstrap.build b/tests/test/simple/build/bootstrap.build deleted file mode 100644 index 0b7a347..0000000 --- a/tests/test/simple/build/bootstrap.build +++ /dev/null @@ -1,4 +0,0 @@ -project = test-simple -amalgamation = # Disabled. -using config -using test diff --git a/tests/test/simple/buildfile b/tests/test/simple/buildfile deleted file mode 100644 index 569c12c..0000000 --- a/tests/test/simple/buildfile +++ /dev/null @@ -1,12 +0,0 @@ -using cxx - -lib{utility}: cxx{utility} -exe{driver}: cxx{driver} #lib{utility} - -#exe{driver}: test.roundtrip = test.out - -exe{*}: test = true -exe{*}: test.output = test.out - -./: lib{utility} exe{driver} -#./: exe{driver} diff --git a/tests/test/simple/driver.cxx b/tests/test/simple/driver.cxx deleted file mode 100644 index 3753821..0000000 --- a/tests/test/simple/driver.cxx +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -using namespace std; - -int -main () -{ - cerr << "test is running (stderr)" << endl; - //assert (false); - cout << "test is running (stdout)" << endl; - return 0; - //return 1; -} diff --git a/tests/test/simple/test.out b/tests/test/simple/test.out deleted file mode 100644 index 5d63fab..0000000 --- a/tests/test/simple/test.out +++ /dev/null @@ -1 +0,0 @@ -test is running (stdout) diff --git a/tests/test/simple/utility.cxx b/tests/test/simple/utility.cxx deleted file mode 100644 index c4bb446..0000000 --- a/tests/test/simple/utility.cxx +++ /dev/null @@ -1 +0,0 @@ -void f (){} diff --git a/tests/using/buildfile b/tests/using/buildfile deleted file mode 100644 index 86baa42..0000000 --- a/tests/using/buildfile +++ /dev/null @@ -1,5 +0,0 @@ -using? foo -print $foo.loaded -print $foo.configured - -./: diff --git a/tests/variable/dir-path/buildfile b/tests/variable/dir-path/buildfile deleted file mode 100644 index 5c99f07..0000000 --- a/tests/variable/dir-path/buildfile +++ /dev/null @@ -1,45 +0,0 @@ -# Untyped dir path reversability. -# -x = s/foo/bar/ -print -e=$x -print -e $x - -y = $x -print -e=$y -print -e $y -print - -# Typed dir path reversability and expansion. -# -x = [dir_path] foo/bar/ -print -I$x -print -I$x/baz -print -I $x -print [strings] -I $x -print -I $x/baz -print - -y = $x # No longer typed but still not original. -print -I$y -print -I$y/baz -print -I $y -print [strings] -I $y -print -I $y/baz -print - -z = [strings] $x # Re-typed. -print $z -print - -# The root case. -# -r = [dir_path] / -print $r/foo - -r += foo -print [strings] $r - -r += bar -print [strings] $r - -./: diff --git a/tests/variable/dir-path/test.out b/tests/variable/dir-path/test.out deleted file mode 100644 index e608c42..0000000 --- a/tests/variable/dir-path/test.out +++ /dev/null @@ -1,22 +0,0 @@ --e=s/foo/bar/ --e s/foo/bar/ --e=s/foo/bar/ --e s/foo/bar/ - --Ifoo/bar --Ifoo/bar/baz --I foo/bar/ --I foo/bar --I foo/bar/baz - --Ifoo/bar --Ifoo/bar/baz --I foo/bar/ --I foo/bar --I foo/bar/baz - -foo/bar - -//foo -/foo -/foo/bar diff --git a/tests/variable/dir-path/test.sh b/tests/variable/dir-path/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/variable/dir-path/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/variable/expansion/buildfile b/tests/variable/expansion/buildfile deleted file mode 100644 index 3f28372..0000000 --- a/tests/variable/expansion/buildfile +++ /dev/null @@ -1,26 +0,0 @@ -foo = FOO - -print $foo -print $(foo) - -# Invalid. -# -#print $ -#print $() -#print $(foo bar) -#print $(foo{bar}) - -# Indirect. -# -FOO = foo -print $($FOO) -print $($(FOO)) -print $($($FOO)) - -# Quoted name. -# -"b a r" = BAR -print $("b a r") -#print $"b a r" - -./: diff --git a/tests/variable/expansion/test.out b/tests/variable/expansion/test.out deleted file mode 100644 index 5056f04..0000000 --- a/tests/variable/expansion/test.out +++ /dev/null @@ -1,6 +0,0 @@ -FOO -FOO -FOO -FOO -foo -BAR diff --git a/tests/variable/expansion/test.sh b/tests/variable/expansion/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/variable/expansion/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/variable/null/buildfile b/tests/variable/null/buildfile deleted file mode 100644 index 3fa1a9e..0000000 --- a/tests/variable/null/buildfile +++ /dev/null @@ -1,22 +0,0 @@ -#v = [null=junk] # error: unexpected value for attribute null: junk -#v = [null] junk # error: empty null value expected instead of 'junk' - -print $v0 # Undefined. - -v1 = [null] -print $v1 - -v2 = x -v2 = [null] -print $v2 - -v3a = [null] -v3b = $v3a -print $v3b -v3b = ($v3a) -print $v3b -print ($v3b) - -print [null] - -./: diff --git a/tests/variable/null/test.out b/tests/variable/null/test.out deleted file mode 100644 index 5119a71..0000000 --- a/tests/variable/null/test.out +++ /dev/null @@ -1,7 +0,0 @@ -[null] -[null] -[null] -[null] -[null] -[null] -[null] diff --git a/tests/variable/null/test.sh b/tests/variable/null/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/variable/null/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/variable/override/build/bootstrap.build b/tests/variable/override/build/bootstrap.build deleted file mode 100644 index 1c2e239..0000000 --- a/tests/variable/override/build/bootstrap.build +++ /dev/null @@ -1,2 +0,0 @@ -project = override -amalgamation = # Disabled. diff --git a/tests/variable/override/buildfile b/tests/variable/override/buildfile deleted file mode 100644 index c090e81..0000000 --- a/tests/variable/override/buildfile +++ /dev/null @@ -1,58 +0,0 @@ -if ($t != [null]) -{ - [$t] v = [null] -} - -print "/ :" $(/: v) - -if ($a == as) -{ - v = x -} -elif ($a == ap) -{ - v += s -} -elif ($a == pr) -{ - v =+ p -} - -print ". :" $v - -d/: -{ - if ($d_a == as) - { - v = x - } - elif ($d_a == ap) - { - v += s - } - elif ($d_a == pr) - { - v =+ p - } - - print "d :" $v - - - if ($d_t_a == as) - { - file{t}: v = x - } - elif ($d_t_a == ap) - { - file{t}: v += s - } - elif ($d_t_a == pr) - { - file{t}: v =+ p - } - - print "d/t :" $(file{t}: v) -} - -include p/ -./: diff --git a/tests/variable/override/cache b/tests/variable/override/cache deleted file mode 100644 index 8378688..0000000 --- a/tests/variable/override/cache +++ /dev/null @@ -1,13 +0,0 @@ -x = [string] 0 -print $x - -x = [uint64] 1 -print $x - -y = 0 -print $y - -[uint64] y = [null] -print $y - -./: diff --git a/tests/variable/override/p/build/bootstrap.build b/tests/variable/override/p/build/bootstrap.build deleted file mode 100644 index 723e2a3..0000000 --- a/tests/variable/override/p/build/bootstrap.build +++ /dev/null @@ -1 +0,0 @@ -project = override-p diff --git a/tests/variable/override/p/buildfile b/tests/variable/override/p/buildfile deleted file mode 100644 index 527b9ae..0000000 --- a/tests/variable/override/p/buildfile +++ /dev/null @@ -1,49 +0,0 @@ -if ($p_a == as) -{ - v = x -} -elif ($p_a == ap) -{ - v += s -} -elif ($p_a == pr) -{ - v =+ p -} - -print "p :" $v - -d/: -{ - if ($p_d_a == as) - { - v = x - } - elif ($p_d_a == ap) - { - v += s - } - elif ($p_d_a == pr) - { - v =+ p - } - - print "p/d :" $v - - if ($p_d_t_a == as) - { - file{t}: v = x - } - elif ($p_d_t_a == ap) - { - file{t}: v += s - } - elif ($p_d_t_a == pr) - { - file{t}: v =+ p - } - - print "p/d/t :" $(file{t}: v) -} - -./: diff --git a/tests/variable/override/p/loader b/tests/variable/override/p/loader deleted file mode 100644 index f298dcc..0000000 --- a/tests/variable/override/p/loader +++ /dev/null @@ -1 +0,0 @@ -include ../buildfile diff --git a/tests/variable/override/simple b/tests/variable/override/simple deleted file mode 100644 index 899daa2..0000000 --- a/tests/variable/override/simple +++ /dev/null @@ -1,3 +0,0 @@ -print $foo - -./: diff --git a/tests/variable/override/test.sh b/tests/variable/override/test.sh deleted file mode 100755 index a8b08b2..0000000 --- a/tests/variable/override/test.sh +++ /dev/null @@ -1,312 +0,0 @@ -#! /usr/bin/env bash - -verbose=n - -# By default when MSYS2 executable (bash.exe in particular) runs another -# executable it converts arguments that look like POSIX paths to Windows -# representations. More about it at: -# -# http://www.mingw.org/wiki/Posix_path_conversion -# -# So when you run b /v=X, build2 gets 'C:/msys64/v=X' argument instead of -# '/v=X'. To disable this behavior set MSYS2_ARG_CONV_EXCL environment -# variable, so all arguments starting with / will not be converted. You can -# list more prefixes using ';' as a separator. -# -export MSYS2_ARG_CONV_EXCL=/ - -tmp_file=`mktemp` - -# Remove temporary file on exit. Cover the case when exit due to an error. -# -trap 'rm -f $tmp_file' EXIT - -function error () { echo "$*" 1>&2; exit 1; } - -function fail () -{ - if [ "$verbose" = "y" ]; then - b $* - else - b -q $* 2>/dev/null - fi - - if [ $? -eq 0 ]; then - error "succeeded: b $*" - fi - - return 0 -} - -function test () -{ - b -q $* >$tmp_file - - if [ $? -ne 0 ]; then - error "failed: b -q $* >$tmp_file" - fi - - diff --strip-trailing-cr -u - $tmp_file - - if [ $? -ne 0 ]; then - error "failed: b $*" - fi -} - -fail foo=bar[] # error: unexpected [ in variable assignment 'foo=bar[]' -fail foo=[string]bar # error: typed override of variable foo -fail "!foo=bar" "!foo=BAR" # error: multiple global overrides of variable foo -fail "foo=bar" "foo=BAR" # error: multiple project overrides of variable foo -fail "%foo=bar" "%foo=BAR" # error: multiple project overrides of variable foo - -test --buildfile simple foo=bar ./ ./ <<< "bar" # Multiple bootstraps of the same project. - -# Visibility/qualification. -# -test !v=X < - -using namespace std; - -int -main (int argc, const char* argv[]) -{ - for (int i (1); i < argc; ++i) - cout << "'" << argv[i] << "'" << endl; -} diff --git a/tests/variable/representation/test.out b/tests/variable/representation/test.out deleted file mode 100644 index 84e7250..0000000 --- a/tests/variable/representation/test.out +++ /dev/null @@ -1,20 +0,0 @@ -'-L/' -'-L/foo/' -'..' -'../' -'/' -'//' -'///' -'//foo/' -'foo@bar' -'foo/@bar/' -'foo@' -'@bar' -'@' -'@@' -'foo%bar' -'foo%' -'%bar' -'foo%bar' -'x%foo@y%bar' -'x%foo/@y%bar/' diff --git a/tests/variable/representation/test.sh b/tests/variable/representation/test.sh deleted file mode 100755 index da9e0e9..0000000 --- a/tests/variable/representation/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -b test - diff --git a/tests/variable/type-pattern-append/buildfile b/tests/variable/type-pattern-append/buildfile deleted file mode 100644 index a91b340..0000000 --- a/tests/variable/type-pattern-append/buildfile +++ /dev/null @@ -1,59 +0,0 @@ -# Typed append/prepend. -# -#dir{a*}: x += [bool] true -#dir{p*}: x =+ [bool] true - -[string] typed = [null] -dir{a*}: typed += abc # ok -dir{p*}: typed =+ abc # ok - -# Prepend/append before/after assignment. -# -[string] x1 = [null] -dir{*}: x1 += A -dir{*}: x1 = b -dir{*}: x1 += c -dir{*}: x1 =+ a -print $(dir{./}:x1) - -# Without stem, mixed prepend/append. -# -dir{*}: x2 += b -dir{*}: x2 += c -#dir{*}: x2 =+ a # error -print $(dir{./}:x2) - -dir{*}: x3 =+ b -dir{*}: x3 =+ a -#dir{*}: x3 += c # error -print $(dir{./}:x3) - -# With stem, typing. -# -x4 = a -dir{*}: x4 += b -dir{*}: x4 += c -print $(dir{./}:x4) - -[string] x5 = b -dir{*}: x5 =+ a -x = $(dir{./}:x5) -print $(dir{./}:x5) - -x6 = [string] a -sub/: -{ - dir{*}: x6 += b - dir{*}: x6 += [null] - print $(dir{./}:x6) -} - -x7 = [string] b -dir{*}: x7 =+ a -sub/: -{ - dir{*}: x7 += c - print $(dir{./}:x7) -} - -./: diff --git a/tests/variable/type-pattern-append/test.out b/tests/variable/type-pattern-append/test.out deleted file mode 100644 index e8e2242..0000000 --- a/tests/variable/type-pattern-append/test.out +++ /dev/null @@ -1,7 +0,0 @@ -abc -b c -a b -a b c -ab -ab -abc diff --git a/tests/variable/type-pattern-append/test.sh b/tests/variable/type-pattern-append/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/variable/type-pattern-append/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/variable/type-pattern/buildfile b/tests/variable/type-pattern/buildfile deleted file mode 100644 index dd218ac..0000000 --- a/tests/variable/type-pattern/buildfile +++ /dev/null @@ -1,39 +0,0 @@ -#dir/foo{*}: x = y # directory -#foo{*.*}: x = y # multiple wildcards -#foo{*}: x = y # unknown target type -#file{*}: x += y # append - -# Use --verbose 6 to examine. -# - -dir{*}: x = y - -x = z -dir{*-foo}: x = $x # 'z' - -x = G -file{*-foo}: x = x -file{xfoo}: x = $x # 'G' -file{-foo}: x = $x # 'x' -file{x-foo}: x = $x # 'x' -file{bar-*-foo}: x = X -file{bar-x}: x = $x # 'G' -file{bar--foo}: x = $x # 'X' -file{bar-x-foo}: x = $x # 'X' - -file{*-fox}: x = 1 -file{fox-*}: x = 2 -file{fox-fox}: x = $x # '2' -file{*-fox}: x = 3 -file{fox-x-fox}: x = $x # still '2'! - -*-foz: x = z # any target -file{x-foz}: x = $x # 'z' - -# These should all be the same. -# -*: x1 = X1 -{*}: x2 = X2 -*{*}: x3 = X3 - -./: diff --git a/tests/variable/type/buildfile b/tests/variable/type/buildfile deleted file mode 100644 index a22cddd..0000000 --- a/tests/variable/type/buildfile +++ /dev/null @@ -1,84 +0,0 @@ -# Variable typing. -# - -#[string] str3 = foo -#[bool] str3 = false # error: changing str3 type from string to bool - -#[bool string] str3 = foo # error: multiple variable types: bool, string - -#[junk] jnk = foo # error: unknown variable attribute junk - -[string] str1 = bar -str1 =+ foo -str1 += baz -print $str1 - -str2 = bar -[string] str2 =+ foo -str2 += baz -print $str2 - -# Value typing. -# - -#v = [bool string] true # error: multiple value types: string, bool -#v = [string=junk] true # error: unexpected value for attribute string: junk - -#[string] var = -#var = [bool] true # error: confliction variable var type string and value type bool - -#var = [string] false -#var += [bool] true # error: confliction original value type string and append/prepend value type bool - -v1a = [uint64] 00 -v1b += [uint64] 00 -v1c =+ [uint64] 00 -print $v1a $v1b $v1c # 0 0 0 - -v2 = [uint64] 00 -v2 = [string] 00 -print $v2 # 00 - -#v3a = [uint64] 00 -#v3a += [string] 00 # error: confliction original value type uint64 and append/prepend value type string - -#v3b = [uint64] 00 -#v3b =+ [string] 00 # error: confliction original value type uint64 and append/prepend value type string - -v4a = 01 -v4a += [uint64] 01 -print $v4a # 2 - -v4b = 01 -v4b =+ [uint64] 01 -print $v4b # 2 - -v5a = 01 -sub/: -{ - v5a += [uint64] 01 - print $v5a # 2 -} - -v5b = 01 -sub/: -{ - v5b =+ [uint64] 01 - print $v5b # 2 -} - -v6 = [uint64 null] -v6 += 00 -print $v6 # 0 - -v7 = [string null] -v7 += [uint64] 00 -print $v7 # 0 - -print [uint64] 00 # 0 - -v8 = [uint64] 01 -v8 = abc -print $v8 # abc - -./: diff --git a/tests/variable/type/test.out b/tests/variable/type/test.out deleted file mode 100644 index 5218221..0000000 --- a/tests/variable/type/test.out +++ /dev/null @@ -1,12 +0,0 @@ -foobarbaz -foobarbaz -0 0 0 -00 -2 -2 -2 -2 -0 -0 -0 -abc diff --git a/tests/variable/type/test.sh b/tests/variable/type/test.sh deleted file mode 100755 index c745b76..0000000 --- a/tests/variable/type/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -b -q | diff --strip-trailing-cr -u test.out - diff --git a/tests/version/buildfile b/tests/version/buildfile deleted file mode 100644 index eaf2f77..0000000 --- a/tests/version/buildfile +++ /dev/null @@ -1,31 +0,0 @@ -#using build@-1.0.0 -#using build@+1.0.0 -#using build@x.0.0 -#using build@1x.0.0 -#using build@1 -#using build@1. -#using build@1.x -#using build@1.1 -#using build@1.1. -#using build@1.1.x -#using build@1.1.100 -#using build@1.1.1~ -#using build@1.1.1-d -#using build@1.1.1-aX -#using build@1.1.1-a0 -#using build@1.1.1-a99 -#using build@1.1.1-a1X -#using build@0.0.0-a1 - -using build@0.0.0 -using build@0.0.1 -using build@0.0.1-a1 -using build@0.0.1-b2 - -#using build@0.1.0 -using build@0.1.0-a1 - -#using build@1.1.0 -#using build@1.1.0-b1 - -./: -- cgit v1.1