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/ --- 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 - 35 files changed, 918 deletions(-) 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 (limited to 'tests/variable') 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 - -- cgit v1.1