2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-02 20:52:13 +00:00
Files
build/test/implicit_dependency.py
github-actions[bot] def908ed01 [Backport version/4.10.0] python3 shebang (#266)
* python3 shebang

(cherry picked from commit 9f0d565b06482a90b59d07ef9e7b9aadd698926c)

* CI: execute python scripts via shebang

(cherry picked from commit cf36b637abe2125cf6895bec593b4cbcf71ae570)

---------

Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>
2023-04-17 14:23:50 -05:00

82 lines
1.3 KiB
Python

#!/usr/bin/env python3
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test the <implicit-dependency> is respected even if the target referred to is
# not built itself, but only referred to by <implicit-dependency>.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", """
make a.h : : gen-header ;
explicit a.h ;
exe hello : hello.cpp : <implicit-dependency>a.h ;
import os ;
if [ os.name ] = NT
{
actions gen-header
{
echo int i; > $(<)
}
}
else
{
actions gen-header
{
echo "int i;" > $(<)
}
}
""")
t.write("hello.cpp", """
#include "a.h"
int main() { return i; }
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug*/hello.exe")
t.rm("bin")
t.write("jamroot.jam", """
make dir/a.h : : gen-header ;
explicit dir/a.h ;
exe hello : hello.cpp : <implicit-dependency>dir/a.h ;
import os ;
if [ os.name ] = NT
{
actions gen-header
{
echo int i; > $(<)
}
}
else
{
actions gen-header
{
echo "int i;" > $(<)
}
}
""")
t.write("hello.cpp", """
#include "dir/a.h"
int main() { return i; }
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug*/hello.exe")
t.cleanup()