diff options
Diffstat (limited to 'tests/test_rpath_rpath_get.c')
-rw-r--r-- | tests/test_rpath_rpath_get.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/test_rpath_rpath_get.c b/tests/test_rpath_rpath_get.c index 17e7e7c..c8e573b 100644 --- a/tests/test_rpath_rpath_get.c +++ b/tests/test_rpath_rpath_get.c @@ -2,14 +2,20 @@ #include "framework.h" const char *testFmt = "returned '%s', expected '%s'\n"; -struct TestCase testCase[] = { - {}, -}; -size_t numCases = sizeof(testCase) / sizeof(struct TestCase); int main(int argc, char *argv[]) { - for (size_t i = 0; i < numCases; i++) { - // myassert() - } + int retval_lib = 0; + int retval_bin = 0; + char *filename_lib = mock_image(AS_MOCK_LIB, "libwinning", (char *[]) {"-L/usr/lib", "-lz", NULL}, &retval_lib); + char *filename_bin = mock_image(AS_MOCK_BIN, "winning", (char *[]) {"-L.", "-lwinning", NULL}, &retval_bin); + char *rpath_lib = rpath_get(filename_lib); + char *rpath_bin = rpath_get(filename_bin); + + myassert(retval_lib == 0, "mock library build failed with code: %d\n", retval_lib); + myassert(strcmp(dirname(filename_lib), rpath_lib) == 0, testFmt, dirname(filename_lib), rpath_lib); + + myassert(retval_lib == 0, "mock executable build failed with code: %d\n", retval_bin); + myassert(strcmp(dirname(filename_bin), rpath_bin) == 0, testFmt, dirname(filename_bin), rpath_bin); + return 0; }
\ No newline at end of file |