Skip to content

Commit 5e24032

Browse files
committed
Label failing or crashing CppInterOpTests emscripten build
1 parent 95f2fef commit 5e24032

File tree

8 files changed

+59
-6
lines changed

8 files changed

+59
-6
lines changed

.github/workflows/emscripten.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ jobs:
553553
./emsdk/emsdk activate ${{matrix.emsdk_ver}}
554554
source ./emsdk/emsdk_env.sh
555555
micromamba create -f environment-wasm.yml --platform=emscripten-wasm32
556-
556+
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
557557
export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm
558558
export CMAKE_PREFIX_PATH=$PREFIX
559559
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
@@ -587,6 +587,7 @@ jobs:
587587
-DCMAKE_INSTALL_PREFIX=$PREFIX \
588588
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
589589
-DLLVM_ENABLE_WERROR=On \
590+
-DSYSROOT_PATH=$SYSROOT_PATH \
590591
../
591592
else
592593
emcmake cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
@@ -599,12 +600,14 @@ jobs:
599600
-DCMAKE_INSTALL_PREFIX=$PREFIX \
600601
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
601602
-DLLVM_ENABLE_WERROR=On \
603+
-DSYSROOT_PATH=$SYSROOT_PATH \
602604
../
603605
fi
604606
605607
emmake make -j ${{ env.ncpus }} check-cppinterop
606608
cd ..
607-
609+
610+
echo "SYSROOT_PATH=$SYSROOT_PATH" >> $GITHUB_ENV
608611
echo "CB_PYTHON_DIR=$CB_PYTHON_DIR" >> $GITHUB_ENV
609612
echo "CPPINTEROP_BUILD_DIR=$CPPINTEROP_BUILD_DIR" >> $GITHUB_ENV
610613
echo "CPPINTEROP_DIR=$CPPINTEROP_DIR" >> $GITHUB_ENV
@@ -617,7 +620,6 @@ jobs:
617620
run: |
618621
./emsdk/emsdk activate ${{matrix.emsdk_ver}}
619622
source ./emsdk/emsdk_env.sh
620-
export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot
621623
micromamba activate CppInterOp-wasm
622624
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
623625
cd ./xeus-cpp
@@ -632,6 +634,6 @@ jobs:
632634
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
633635
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
634636
-DCppInterOp_DIR="${{ env.CPPINTEROP_BUILD_DIR }}/lib/cmake/CppInterOp" \
635-
-DSYSROOT_PATH=$SYSROOT_PATH \
637+
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} \
636638
..
637639
emmake make -j ${{ env.ncpus }} install

unittests/CppInterOp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif()
3333
if(EMSCRIPTEN)
3434
set_target_properties(CppInterOpTests PROPERTIES
3535
COMPILE_FLAGS "-s MAIN_MODULE=1"
36-
LINK_FLAGS "-s MAIN_MODULE=1 -s WASM_BIGINT"
36+
LINK_FLAGS "-s MAIN_MODULE=1 -s WASM_BIGINT -s EXPORTED_RUNTIME_METHODS='[\"FS\",\"PATH\",\"LDSO\",\"loadDynamicLibrary\",\"ERRNO_CODES\"]' -s ALLOW_MEMORY_GROWTH=1"
3737
)
3838
endif()
3939
target_link_libraries(CppInterOpTests
@@ -80,7 +80,7 @@ target_link_libraries(DynamicLibraryManagerTests
8080
if(EMSCRIPTEN)
8181
set_target_properties(DynamicLibraryManagerTests PROPERTIES
8282
COMPILE_FLAGS "-s MAIN_MODULE=1"
83-
LINK_FLAGS "-s MAIN_MODULE=1 -s WASM_BIGINT"
83+
LINK_FLAGS "-s MAIN_MODULE=1 -s WASM_BIGINT -s EXPORTED_RUNTIME_METHODS='[\"FS\",\"PATH\",\"LDSO\",\"loadDynamicLibrary\",\"ERRNO_CODES\"]' -s ALLOW_MEMORY_GROWTH=1"
8484
)
8585
endif()
8686

unittests/CppInterOp/FunctionReflectionTest.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ TEST(FunctionReflectionTest, ExistsFunctionTemplate) {
532532
}
533533

534534
TEST(FunctionReflectionTest, InstantiateTemplateFunctionFromString) {
535+
#ifdef EMSCRIPTEN
536+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
537+
#endif
535538
if (llvm::sys::RunningOnValgrind())
536539
GTEST_SKIP() << "XFAIL due to Valgrind report";
537540
Cpp::CreateInterpreter();
@@ -798,6 +801,9 @@ TEST(FunctionReflectionTest, IsStaticMethod) {
798801
}
799802

800803
TEST(FunctionReflectionTest, GetFunctionAddress) {
804+
#ifdef EMSCRIPTEN
805+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
806+
#endif
801807
if (llvm::sys::RunningOnValgrind())
802808
GTEST_SKIP() << "XFAIL due to Valgrind report";
803809
#ifdef _WIN32
@@ -842,6 +848,9 @@ TEST(FunctionReflectionTest, IsVirtualMethod) {
842848
}
843849

844850
TEST(FunctionReflectionTest, JitCallAdvanced) {
851+
#ifdef EMSCRIPTEN
852+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
853+
#endif
845854
if (llvm::sys::RunningOnValgrind())
846855
GTEST_SKIP() << "XFAIL due to Valgrind report";
847856
std::vector<Decl*> Decls;
@@ -866,6 +875,9 @@ TEST(FunctionReflectionTest, JitCallAdvanced) {
866875

867876

868877
TEST(FunctionReflectionTest, GetFunctionCallWrapper) {
878+
#ifdef EMSCRIPTEN
879+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
880+
#endif
869881
if (llvm::sys::RunningOnValgrind())
870882
GTEST_SKIP() << "XFAIL due to Valgrind report";
871883
std::vector<Decl*> Decls;
@@ -1127,6 +1139,9 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) {
11271139
}
11281140

11291141
TEST(FunctionReflectionTest, Construct) {
1142+
#ifdef EMSCRIPTEN
1143+
GTEST_SKIP() << "Test fails for Emscipten builds";
1144+
#endif
11301145
if (llvm::sys::RunningOnValgrind())
11311146
GTEST_SKIP() << "XFAIL due to Valgrind report";
11321147
#ifdef _WIN32
@@ -1167,6 +1182,9 @@ TEST(FunctionReflectionTest, Construct) {
11671182
}
11681183

11691184
TEST(FunctionReflectionTest, Destruct) {
1185+
#ifdef EMSCRIPTEN
1186+
GTEST_SKIP() << "Test fails for Emscipten builds";
1187+
#endif
11701188
if (llvm::sys::RunningOnValgrind())
11711189
GTEST_SKIP() << "XFAIL due to Valgrind report";
11721190

unittests/CppInterOp/InterpreterTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ TEST(InterpreterTest, DebugFlag) {
5858
}
5959

6060
TEST(InterpreterTest, Evaluate) {
61+
#ifdef EMSCRIPTEN
62+
GTEST_SKIP() << "Test fails for Emscipten builds";
63+
#endif
6164
#ifdef _WIN32
6265
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
6366
#endif
@@ -126,6 +129,9 @@ TEST(InterpreterTest, CreateInterpreter) {
126129

127130
#ifdef LLVM_BINARY_DIR
128131
TEST(InterpreterTest, DetectResourceDir) {
132+
#ifdef EMSCRIPTEN
133+
GTEST_SKIP() << "Test fails for Emscipten builds";
134+
#endif
129135
#else
130136
TEST(InterpreterTest, DISABLED_DetectResourceDir) {
131137
#endif // LLVM_BINARY_DIR
@@ -145,6 +151,9 @@ TEST(InterpreterTest, DISABLED_DetectResourceDir) {
145151
}
146152

147153
TEST(InterpreterTest, DetectSystemCompilerIncludePaths) {
154+
#ifdef EMSCRIPTEN
155+
GTEST_SKIP() << "Test fails for Emscipten builds";
156+
#endif
148157
#ifdef _WIN32
149158
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
150159
#endif

unittests/CppInterOp/JitTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ static int printf_jit(const char* format, ...) {
1212
}
1313

1414
TEST(JitTest, InsertOrReplaceJitSymbol) {
15+
#ifdef EMSCRIPTEN
16+
GTEST_SKIP() << "Test fails for Emscipten builds";
17+
#endif
1518
if (llvm::sys::RunningOnValgrind())
1619
GTEST_SKIP() << "XFAIL due to Valgrind report";
1720
#ifdef _WIN32

unittests/CppInterOp/ScopeReflectionTest.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ TEST(ScopeReflectionTest, SizeOf) {
161161

162162

163163
TEST(ScopeReflectionTest, IsBuiltin) {
164+
#ifdef EMSCRIPTEN
165+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
166+
#endif
164167
// static std::set<std::string> g_builtins =
165168
// {"bool", "char", "signed char", "unsigned char", "wchar_t", "short", "unsigned short",
166169
// "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long",
@@ -491,6 +494,9 @@ TEST(ScopeReflectionTest, GetScopefromCompleteName) {
491494
}
492495

493496
TEST(ScopeReflectionTest, GetNamed) {
497+
#ifdef EMSCRIPTEN
498+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
499+
#endif
494500
std::string code = R"(namespace N1 {
495501
namespace N2 {
496502
class C {
@@ -876,6 +882,9 @@ template<typename T> T TrivialFnTemplate() { return T(); }
876882
}
877883

878884
TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) {
885+
#ifdef EMSCRIPTEN
886+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
887+
#endif
879888
if (llvm::sys::RunningOnValgrind())
880889
GTEST_SKIP() << "XFAIL due to Valgrind report";
881890
Cpp::CreateInterpreter();
@@ -1016,6 +1025,9 @@ TEST(ScopeReflectionTest, GetClassTemplateInstantiationArgs) {
10161025

10171026

10181027
TEST(ScopeReflectionTest, IncludeVector) {
1028+
#ifdef EMSCRIPTEN
1029+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
1030+
#endif
10191031
if (llvm::sys::RunningOnValgrind())
10201032
GTEST_SKIP() << "XFAIL due to Valgrind report";
10211033
std::string code = R"(

unittests/CppInterOp/TypeReflectionTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ TEST(TypeReflectionTest, IsPODType) {
546546
}
547547

548548
TEST(TypeReflectionTest, IsSmartPtrType) {
549+
#ifdef EMSCRIPTEN
550+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
551+
#endif
549552
if (llvm::sys::RunningOnValgrind())
550553
GTEST_SKIP() << "XFAIL due to Valgrind report";
551554
Cpp::CreateInterpreter();

unittests/CppInterOp/VariableReflectionTest.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ TEST(VariableReflectionTest, GetVariableType) {
263263
CODE
264264

265265
TEST(VariableReflectionTest, GetVariableOffset) {
266+
#ifdef EMSCRIPTEN
267+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
268+
#endif
266269
std::vector<Decl *> Decls;
267270
#define Stringify(s) Stringifyx(s)
268271
#define Stringifyx(...) #__VA_ARGS__
@@ -328,6 +331,9 @@ TEST(VariableReflectionTest, GetVariableOffset) {
328331
CODE
329332

330333
TEST(VariableReflectionTest, VariableOffsetsWithInheritance) {
334+
#ifdef EMSCRIPTEN
335+
GTEST_SKIP() << "Test crashes gtest on Emscipten";
336+
#endif
331337
if (llvm::sys::RunningOnValgrind())
332338
GTEST_SKIP() << "XFAIL due to Valgrind report";
333339

0 commit comments

Comments
 (0)