1#!/usr/local/bin/python3.8
2
3# Copyright 2003 Dave Abrahams
4# Copyright 2003 Vladimir Prus
5# Distributed under the Boost Software License, Version 1.0.
6# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7
8# Test the 'symlink' rule.
9
10from __future__ import print_function
11
12import os
13import BoostBuild
14
15
16if os.name != 'posix':
17    print("The symlink tests can be run on posix only.")
18    import sys
19    sys.exit(1)
20
21
22t = BoostBuild.Tester(use_test_config=False)
23
24t.write("jamroot.jam", "import gcc ;")
25
26t.write("jamfile.jam", """
27exe hello : hello.cpp ;
28symlink hello_release : hello/<variant>release ;
29symlink hello_debug : hello/<variant>debug ;
30symlink links/hello_release : hello/<variant>release ;
31""")
32
33t.write("hello.cpp", """
34int main() {}
35""")
36
37t.run_build_system()
38t.expect_addition([
39    'hello_debug.exe',
40    'hello_release.exe',
41    'links/hello_release.exe'])
42
43t.cleanup()
44