================
@@ -0,0 +1,50 @@
+// Tests for ssaf-linker input validation.
+
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+
+// No extension on output.
+// RUN: not ssaf-linker %S/Inputs/tu-empty.json -o lu 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=NO-EXT-OUTPUT
+// NO-EXT-OUTPUT: ssaf-linker: error: failed to validate summary 'lu': 
Extension not supplied.
+
+// No extension on input.
+// RUN: not ssaf-linker %S/Inputs/tu-noext -o %t/lu.json 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=NO-EXT-INPUT -DPATH=%S/Inputs/tu-noext
+// NO-EXT-INPUT: ssaf-linker: error: failed to validate summary '[[PATH]]': 
Extension not supplied.
+
+// Invalid extension on output.
+// RUN: not ssaf-linker %S/Inputs/tu-empty.json -o lu.txt 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=BAD-EXT-OUTPUT
+// BAD-EXT-OUTPUT: ssaf-linker: error: failed to validate summary 'lu.txt': 
Format not registered for extension 'txt'.
+
+// Invalid extension on input.
+// RUN: not ssaf-linker %S/Inputs/tu-badext.txt -o %t/lu.json 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=BAD-EXT-INPUT 
-DPATH=%S/Inputs/tu-badext.txt
+// BAD-EXT-INPUT: ssaf-linker: error: failed to validate summary '[[PATH]]': 
Format not registered for extension 'txt'.
+
+// Output directory does not exist.
+// RUN: not ssaf-linker %S/Inputs/tu-empty.json -o 
%S/Outputs/NonExistentDirectory/lu.json 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=OUTPUT-PARENT-DIR-MISSING 
-DPATH=%S/Outputs/NonExistentDirectory/lu.json
+// OUTPUT-PARENT-DIR-MISSING: ssaf-linker: error: failed to validate summary 
'[[PATH]]': Parent directory does not exist.
+
+// Output parent directory exists but is not writable.
+// UNSUPPORTED: system-windows
----------------
aviralg wrote:

Yes. Moved this to a separate file.

https://github.com/llvm/llvm-project/pull/184713
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to