From 8a4dfbbbe76a2aef35427b7915d6e28bab165c43 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 12 May 2024 16:07:53 +0200 Subject: Build static and dynamic libs --- test-ymake.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test-ymake.cpp') diff --git a/test-ymake.cpp b/test-ymake.cpp index c2dd78e..bf59bbc 100644 --- a/test-ymake.cpp +++ b/test-ymake.cpp @@ -433,7 +433,7 @@ TEST_F(ymakeTest, test_only) TEST_F(ymakeTest, build_with_gcc) { - if (!is_executable("g++")) { + if (!is_executable_command("g++")) { GTEST_SKIP() << "g++ not available"; } @@ -463,7 +463,7 @@ TEST_F(ymakeTest, build_with_gcc) TEST_F(ymakeTest, build_with_clang) { - if (!is_executable("clang++")) { + if (!is_executable_command("clang++")) { GTEST_SKIP() << "clang++ not available"; } @@ -629,12 +629,14 @@ TEST_F(ymakeTest, build_one_dynamic_lib) int result = run_command("../ymake", output); EXPECT_EQ(result, 0); - ASSERT_EQ(output.size(), 3); // 2x compile, link + ASSERT_EQ(output.size(), 5); // 2x compile, link, 2 symlinks EXPECT_EQ(output[2].substr(0, 4), "g++ "); EXPECT_TRUE(fs::exists("hello.d")); EXPECT_TRUE(fs::exists("hello.o")); EXPECT_TRUE(fs::exists("hello.so.1.2.3")); + EXPECT_TRUE(fs::exists("hello.so.1")); + EXPECT_TRUE(fs::exists("hello.so")); EXPECT_TRUE(fs::exists("second.d")); EXPECT_TRUE(fs::exists("second.o")); @@ -645,11 +647,13 @@ TEST_F(ymakeTest, build_one_dynamic_lib) result = run_command("../ymake clean", output); EXPECT_EQ(result, 0); - ASSERT_EQ(output.size(), 5); // deleted 5 files + ASSERT_EQ(output.size(), 7); // deleted 7 files EXPECT_TRUE(!fs::exists("hello.d")); EXPECT_TRUE(!fs::exists("hello.o")); EXPECT_TRUE(!fs::exists("hello.so.1.2.3")); + EXPECT_TRUE(!fs::exists("hello.so.1")); + EXPECT_TRUE(!fs::exists("hello.so")); EXPECT_TRUE(!fs::exists("second.d")); EXPECT_TRUE(!fs::exists("second.o")); @@ -662,6 +666,8 @@ TEST_F(ymakeTest, build_one_dynamic_lib) // TODO: // use static lib // use dynamic lib +// use static lib from subdir +// use dynamic lib from subdir TEST_F(yscanTest, no_cpp_file) { -- cgit v1.2.3