Skip to content

Commit

Permalink
tests(build) add test cases to ngx_wasm_rs_linking.t
Browse files Browse the repository at this point in the history
Remove a duplicated test and add 2 more tests with static libwee8 +
dynamic ngx-wasm-rs.
  • Loading branch information
thibaultcha committed Aug 18, 2023
1 parent 454e888 commit e7e9232
Showing 1 changed file with 54 additions and 21 deletions.
75 changes: 54 additions & 21 deletions t/10-build/004-ngx_wasm_rs_linking.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,7 @@ stub4
=== TEST 3: dynamically linked libwee8 (environment variables) + dynamic ngx-wasm-rs built separately
--- SKIP: NYI - the V8 build system builds libwee8 statically
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="-L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug-lngx_wasm_rs" make}
--- grep_nginxV
ngx_wasm_module [dev debug v8]
=== TEST 4: dynamically linked libwasmer (environment variables) + dynamic ngx-wasm-rs built separately
=== TEST 3: dynamically linked libwasmer (environment variables) + dynamic ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'wasmer'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="-L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug -lngx_wasm_rs" make}
--- grep_nginxV
Expand All @@ -64,7 +55,7 @@ stub2
=== TEST 5: dynamically linked libwasmer (./configure arguments) + dynamic ngx-wasm-rs built separately
=== TEST 4: dynamically linked libwasmer (./configure arguments) + dynamic ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'wasmer'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='-L$ENV{NGX_WASM_RUNTIME_DIR} -L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug -lngx_wasm_rs'" make}
--- grep_nginxV
Expand All @@ -78,10 +69,10 @@ stub2
=== TEST 6: dynamically linked libwee8 (environment variables) + dynamic ngx-wasm-rs built separately
=== TEST 5: dynamically linked libwee8 (environment variables) + dynamic ngx-wasm-rs built separately
--- SKIP: NYI - the V8 build system builds libwee8 statically
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="-L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug-lngx_wasm_rs" make}
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="-L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug -lngx_wasm_rs" make}
--- grep_nginxV
ngx_wasm_module [dev debug v8]
--- grep_libs
Expand All @@ -93,10 +84,10 @@ stub2
=== TEST 7: dynamically linked libwee8 (./configure arguments) + dynamic ngx-wasm-rs built separately
=== TEST 6: dynamically linked libwee8 (./configure arguments) + dynamic ngx-wasm-rs built separately
--- SKIP: NYI - the V8 build system builds libwee8 statically
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='-L$ENV{NGX_WASM_RUNTIME_DIR} -L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug-lngx_wasm_rs'" make}
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='-L$ENV{NGX_WASM_RUNTIME_DIR} -L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug -lngx_wasm_rs'" make}
--- grep_nginxV
ngx_wasm_module [dev debug v8]
--- grep_libs
Expand All @@ -108,7 +99,7 @@ stub2
=== TEST 8: statically linked libwasmer (environment variables) + static ngx-wasm-rs built separately
=== TEST 7: statically linked libwasmer (environment variables) + static ngx-wasm-rs built separately
--- SKIP: Cannot link two static Rust libraries linked with different compilers
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'wasmer'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="$pwd/lib/ngx-wasm-rs/target/debug/libngx_wasm_rs.a" NGX_WASM_RUNTIME_INC="$ENV{NGX_WASM_RUNTIME_DIR}/include" NGX_WASM_RUNTIME_LD_OPT="$ENV{NGX_WASM_RUNTIME_DIR}/lib/lib$ENV{NGX_WASM_RUNTIME}.a" make}
Expand All @@ -126,7 +117,7 @@ libngx_wasm_rs
=== TEST 9: statically linked libwasmer (./configure arguments) + static ngx-wasm-rs built separately
=== TEST 8: statically linked libwasmer (./configure arguments) + static ngx-wasm-rs built separately
--- SKIP: Cannot link two static Rust libraries linked with different compilers
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'wasmer'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='$ENV{NGX_WASM_RUNTIME_DIR}/lib/lib$ENV{NGX_WASM_RUNTIME}.a $pwd/lib/ngx-wasm-rs/target/debug/libngx_wasm_rs.a'" make}
Expand All @@ -144,7 +135,7 @@ libngx_wasm_rs
=== TEST 10: statically linked libwee8 (environment variables) + static ngx-wasm-rs built separately
=== TEST 9: statically linked libwee8 (environment variables) + static ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="$pwd/lib/ngx-wasm-rs/target/debug/libngx_wasm_rs.a" NGX_WASM_RUNTIME_LD_OPT="$ENV{NGX_WASM_RUNTIME_DIR}/lib/libwee8.a -L$ENV{NGX_WASM_RUNTIME_DIR}/lib" make}
--- grep_nginxV
Expand All @@ -161,7 +152,7 @@ libngx_wasm_rs
=== TEST 11: statically linked libwee8 (./configure arguments) + static ngx-wasm-rs built separately
=== TEST 10: statically linked libwee8 (./configure arguments) + static ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='$ENV{NGX_WASM_RUNTIME_DIR}/lib/libwee8.a -L$ENV{NGX_WASM_RUNTIME_DIR} $pwd/lib/ngx-wasm-rs/target/debug/libngx_wasm_rs.a' " make}
--- grep_nginxV
Expand All @@ -178,7 +169,7 @@ libngx_wasm_rs
=== TEST 12: statically linked libwasmer (environment variables) + dynamic ngx-wasm-rs built separately
=== TEST 11: statically linked libwasmer (environment variables) + dynamic ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'wasmer'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="-L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug -lngx_wasm_rs" NGX_WASM_RUNTIME_INC="$ENV{NGX_WASM_RUNTIME_DIR}/include" NGX_WASM_RUNTIME_LD_OPT="$ENV{NGX_WASM_RUNTIME_DIR}/lib/lib$ENV{NGX_WASM_RUNTIME}.a" make}
--- grep_nginxV
Expand All @@ -199,7 +190,7 @@ libwasmer
=== TEST 13: statically linked libwasmer (./configure arguments) + dynamic ngx-wasm-rs built separately
=== TEST 12: statically linked libwasmer (./configure arguments) + dynamic ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'wasmer'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='$ENV{NGX_WASM_RUNTIME_DIR}/lib/lib$ENV{NGX_WASM_RUNTIME}.a -L$pwd/lib/ngx-wasm-rs/target/debug/ -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug/ -lngx_wasm_rs'" make}
--- grep_nginxV
Expand All @@ -217,3 +208,45 @@ ngx_wasm_module [dev debug wasmer]
libngx_wasm_rs
--- no_grep_libs
libwasmer
=== TEST 13: statically linked libwee8 (environment variables) + dynamic ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_BUILD_CC_OPT="-I $pwd/lib/ngx-wasm-rs/include" NGX_BUILD_LD_OPT="-L$pwd/lib/ngx-wasm-rs/target/debug -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug -lngx_wasm_rs" NGX_WASM_RUNTIME_LD_OPT="$ENV{NGX_WASM_RUNTIME_DIR}/lib/libwee8.a -L$ENV{NGX_WASM_RUNTIME_DIR}/lib" make}
--- grep_nginxV
ngx_wasm_module [dev debug v8]
--- run_cmd eval: qq{nm -g $::buildroot/nginx}
--- grep_cmd eval
[
qr/T _?wasm_store_new/,
]
--- no_grep_cmd eval
[
qr/T _?ngx_wasm_backtrace_demangle/,
]
--- grep_libs
libngx_wasm_rs
--- no_grep_libs
libwee8
=== TEST 14: statically linked libwee8 (./configure arguments) + dynamic ngx-wasm-rs built separately
--- skip_eval: 6: $ENV{NGX_WASM_RUNTIME} ne 'v8'
--- build eval: use Cwd qw(cwd); my $pwd = cwd(); qq{( cd $pwd/lib/ngx-wasm-rs; cargo build --features wat ) && NGX_WASM_CARGO=0 NGX_WASM_RUNTIME_INC= NGX_WASM_RUNTIME_LIB= NGX_WASM_RUNTIME_LD_OPT= NGX_BUILD_CONFIGURE_OPT="--with-cc-opt='-I$ENV{NGX_WASM_RUNTIME_DIR}/include -I$pwd/lib/ngx-wasm-rs/include' --with-ld-opt='$ENV{NGX_WASM_RUNTIME_DIR}/lib/libwee8.a -L$pwd/lib/ngx-wasm-rs/target/debug/ -Wl,-rpath=$pwd/lib/ngx-wasm-rs/target/debug/ -lngx_wasm_rs'" make}
--- grep_nginxV
ngx_wasm_module [dev debug v8]
--- run_cmd eval: qq{nm -g $::buildroot/nginx}
--- grep_cmd eval
[
qr/T _?wasm_store_new/,
]
--- no_grep_cmd eval
[
qr/T _?ngx_wasm_backtrace_demangle/,
]
--- grep_libs
libngx_wasm_rs
--- no_grep_libs
libwee8

0 comments on commit e7e9232

Please sign in to comment.